Package org.tomitribe.auth.signatures
Enum EC
- java.lang.Object
-
- java.lang.Enum<EC>
-
- org.tomitribe.auth.signatures.EC
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.security.PrivateKeyprivateKeyFromPKCS8(byte[] pkcs8)Returns a private key constructed from the given DER bytes in PKCS#8 format.static java.security.PublicKeypublicKeyFrom(byte[] derBytes)Returns a public key constructed from the given DER bytes.static ECvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static EC[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Method Detail
-
values
public static EC[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (EC c : EC.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EC valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
privateKeyFromPKCS8
public static java.security.PrivateKey privateKeyFromPKCS8(byte[] pkcs8) throws java.security.spec.InvalidKeySpecExceptionReturns a private key constructed from the given DER bytes in PKCS#8 format.- Parameters:
pkcs8- DER bytes in PKCS#8 format- Returns:
- Private key
- Throws:
java.security.spec.InvalidKeySpecException- if the DER bytes cannot be converted to a private key
-
publicKeyFrom
public static java.security.PublicKey publicKeyFrom(byte[] derBytes) throws java.security.spec.InvalidKeySpecExceptionReturns a public key constructed from the given DER bytes.- Parameters:
derBytes- DER bytes- Returns:
- Public key
- Throws:
java.security.spec.InvalidKeySpecException- if the DER bytes cannot be converted to a public key
-
-