Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
RSA |
Modifier and Type | Method and Description |
---|---|
private static java.security.spec.RSAPrivateCrtKeySpec |
newRSAPrivateCrtKeySpec(byte[] keyInPkcs1)
Amazon Modifications: Copyright 2014 Amazon.com, Inc.
|
static java.security.PrivateKey |
privateKeyFromPKCS1(byte[] pkcs1)
Returns a private key constructed from the given DER bytes in PKCS#1 format.
|
static java.security.PrivateKey |
privateKeyFromPKCS8(byte[] pkcs8)
Returns a private key constructed from the given DER bytes in PKCS#8 format.
|
static java.security.PublicKey |
publicKeyFrom(byte[] derBytes)
Returns a public key constructed from the given DER bytes.
|
static RSA |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static RSA[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
private static final java.lang.String RSA
public static RSA[] values()
for (RSA c : RSA.values()) System.out.println(c);
public static RSA valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static java.security.PrivateKey privateKeyFromPKCS8(byte[] pkcs8) throws java.security.spec.InvalidKeySpecException
java.security.spec.InvalidKeySpecException
public static java.security.PrivateKey privateKeyFromPKCS1(byte[] pkcs1) throws java.security.spec.InvalidKeySpecException
java.security.spec.InvalidKeySpecException
public static java.security.PublicKey publicKeyFrom(byte[] derBytes) throws java.security.spec.InvalidKeySpecException
java.security.spec.InvalidKeySpecException
private static java.security.spec.RSAPrivateCrtKeySpec newRSAPrivateCrtKeySpec(byte[] keyInPkcs1) throws java.io.IOException
-- -- Representation of RSA private key with information for the CRT algorithm. -- RSAPrivateKey ::= SEQUENCE { version Version, modulus INTEGER, -- n publicExponent INTEGER, -- e privateExponent INTEGER, -- d prime1 INTEGER, -- p prime2 INTEGER, -- q exponent1 INTEGER, -- d mod (p-1) exponent2 INTEGER, -- d mod (q-1) coefficient INTEGER, -- (inverse of q) mod p otherPrimeInfos OtherPrimeInfos OPTIONAL }
keyInPkcs1
- PKCS#1 encoded keyjava.io.IOException