Codota Logo
RSAPrivateKey.getAlgorithm
Code IndexAdd Codota to your IDE (free)

How to use
getAlgorithm
method
in
java.security.interfaces.RSAPrivateKey

Best Java code snippets using java.security.interfaces.RSAPrivateKey.getAlgorithm (Showing top 2 results out of 315)

  • Common ways to obtain RSAPrivateKey
private void myMethod () {
RSAPrivateKey r =
  • Codota IconKeyFactory keyFactory;KeySpec keySpec;(RSAPrivateKey) keyFactory.generatePrivate(keySpec)
  • Codota IconKeyPair keyPair;(RSAPrivateKey) keyPair.getPrivate()
  • Codota IconQute.libg.cryptography.RSA rSA;BigInteger modulus;BigInteger privateExponent;rSA.create(new RSAPrivateKeySpec(modulus, privateExponent))
  • Smart code suggestions by Codota
}
origin: jenkinsci/jenkins

/**
 * Sign a message and base64 encode the signature.
 */
public String sign(String msg) {
  try {
    RSAPrivateKey key = getPrivateKey();
    Signature sig = Signature.getInstance(SIGNING_ALGORITHM + "with" + key.getAlgorithm());
    sig.initSign(key);
    sig.update(msg.getBytes("UTF-8"));
    return hudson.remoting.Base64.encode(sig.sign());
  } catch (GeneralSecurityException e) {
    throw new SecurityException(e);
  } catch (UnsupportedEncodingException e) {
    throw new AssertionError(e);    // UTF-8 is mandatory
  }
}
origin: org.jenkins-ci.main/jenkins-core

/**
 * Sign a message and base64 encode the signature.
 */
public String sign(String msg) {
  try {
    RSAPrivateKey key = getPrivateKey();
    Signature sig = Signature.getInstance(SIGNING_ALGORITHM + "with" + key.getAlgorithm());
    sig.initSign(key);
    sig.update(msg.getBytes("UTF-8"));
    return hudson.remoting.Base64.encode(sig.sign());
  } catch (GeneralSecurityException e) {
    throw new SecurityException(e);
  } catch (UnsupportedEncodingException e) {
    throw new AssertionError(e);    // UTF-8 is mandatory
  }
}
java.security.interfacesRSAPrivateKeygetAlgorithm

Popular methods of RSAPrivateKey

  • getModulus
  • getPrivateExponent
    Returns the private exponent d.
  • getEncoded
  • getFormat
  • <init>

Popular in Java

  • Creating JSON documents from java classes using gson
  • requestLocationUpdates (LocationManager)
  • onCreateOptionsMenu (Activity)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Hashtable (java.util)
    Hashtable is a synchronized implementation of Map. All optional operations are supported.Neither key
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now