Enum RSASigningAlgorithm
- java.lang.Object
-
- java.lang.Enum<RSASigningAlgorithm>
-
- org.smallmind.nutsnbolts.security.RSASigningAlgorithm
-
- All Implemented Interfaces:
Serializable,Comparable<RSASigningAlgorithm>,SecurityAlgorithm,SigningAlgorithm
public enum RSASigningAlgorithm extends Enum<RSASigningAlgorithm> implements SecurityAlgorithm, SigningAlgorithm
-
-
Enum Constant Summary
Enum Constants Enum Constant Description SHA_256_WITH_RSA
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAlgorithmName()byte[]sign(Key key, byte[] data)static RSASigningAlgorithmvalueOf(String name)Returns the enum constant of this type with the specified name.static RSASigningAlgorithm[]values()Returns an array containing the constants of this enum type, in the order they are declared.booleanverify(Key key, String[] parts, boolean urlSafe)-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Methods inherited from interface org.smallmind.nutsnbolts.security.SigningAlgorithm
verify
-
-
-
-
Enum Constant Detail
-
SHA_256_WITH_RSA
public static final RSASigningAlgorithm SHA_256_WITH_RSA
-
-
Method Detail
-
values
public static RSASigningAlgorithm[] 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 (RSASigningAlgorithm c : RSASigningAlgorithm.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static RSASigningAlgorithm valueOf(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:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getAlgorithmName
public String getAlgorithmName()
- Specified by:
getAlgorithmNamein interfaceSecurityAlgorithm
-
sign
public byte[] sign(Key key, byte[] data) throws NoSuchProviderException, NoSuchAlgorithmException, InvalidKeyException, SignatureException
- Specified by:
signin interfaceSigningAlgorithm- Throws:
NoSuchProviderExceptionNoSuchAlgorithmExceptionInvalidKeyExceptionSignatureException
-
verify
public boolean verify(Key key, String[] parts, boolean urlSafe) throws IOException, NoSuchProviderException, NoSuchAlgorithmException, InvalidKeyException, SignatureException
- Specified by:
verifyin interfaceSigningAlgorithm- Throws:
IOExceptionNoSuchProviderExceptionNoSuchAlgorithmExceptionInvalidKeyExceptionSignatureException
-
-