public enum SignatureAlgorithm extends Enum<SignatureAlgorithm>
Enum Constant and Description |
---|
ES256
JWA algorithm name for
ECDSA using P-256 and SHA-256 . |
ES384
JWA algorithm name for
ECDSA using P-384 and SHA-384 . |
ES512
JWA algorithm name for
ECDSA using P-512 and SHA-512 . |
HS256
JWA algorithm name for
HMAC using SHA-256 |
HS384
JWA algorithm name for
HMAC using SHA-384 |
HS512
JWA algorithm name for
HMAC using SHA-512 |
NONE
JWA name for
No digital signature or MAC performed |
PS256
JWA algorithm name for
RSASSA-PSS using SHA-256 and MGF1 with SHA-256 . |
PS384
JWA algorithm name for
RSASSA-PSS using SHA-384 and MGF1 with SHA-384 . |
PS512
JWA algorithm name for
RSASSA-PSS using SHA-512 and MGF1 with SHA-512 . |
RS256
JWA algorithm name for
RSASSA-PKCS-v1_5 using SHA-256 |
RS384
JWA algorithm name for
RSASSA-PKCS-v1_5 using SHA-384 |
RS512
JWA algorithm name for
RSASSA-PKCS-v1_5 using SHA-512 |
Modifier and Type | Method and Description |
---|---|
static SignatureAlgorithm |
forName(String value)
Looks up and returns the corresponding
SignatureAlgorithm enum instance based on a
case-insensitive name comparison. |
String |
getDescription()
Returns the JWA algorithm description.
|
String |
getJcaName()
Returns the name of the JCA algorithm used to compute the signature.
|
String |
getValue()
Returns the JWA algorithm name constant.
|
boolean |
isEllipticCurve()
Returns
true if the enum instance represents an Elliptic Curve signature algorithm, false
otherwise. |
boolean |
isHmac()
Returns
true if the enum instance represents an HMAC signature algorithm, false otherwise. |
boolean |
isJdkStandard()
Returns
true if the algorithm is supported by standard JDK distributions or false if the
algorithm implementation is not in the JDK and must be provided by a separate runtime JCA Provider (like
BouncyCastle for example). |
boolean |
isRsa()
Returns
true if the enum instance represents an RSA public/private key pair signature algorithm,
false otherwise. |
static SignatureAlgorithm |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static SignatureAlgorithm[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SignatureAlgorithm NONE
No digital signature or MAC performed
public static final SignatureAlgorithm HS256
HMAC using SHA-256
public static final SignatureAlgorithm HS384
HMAC using SHA-384
public static final SignatureAlgorithm HS512
HMAC using SHA-512
public static final SignatureAlgorithm RS256
RSASSA-PKCS-v1_5 using SHA-256
public static final SignatureAlgorithm RS384
RSASSA-PKCS-v1_5 using SHA-384
public static final SignatureAlgorithm RS512
RSASSA-PKCS-v1_5 using SHA-512
public static final SignatureAlgorithm ES256
ECDSA using P-256 and SHA-256
. This is not a JDK standard algorithm and
requires that a JCA provider like BouncyCastle be in the runtime classpath. BouncyCastle will be used
automatically if found in the runtime classpath.public static final SignatureAlgorithm ES384
ECDSA using P-384 and SHA-384
. This is not a JDK standard algorithm and
requires that a JCA provider like BouncyCastle be in the runtime classpath. BouncyCastle will be used
automatically if found in the runtime classpath.public static final SignatureAlgorithm ES512
ECDSA using P-512 and SHA-512
. This is not a JDK standard algorithm and
requires that a JCA provider like BouncyCastle be in the runtime classpath. BouncyCastle will be used
automatically if found in the runtime classpath.public static final SignatureAlgorithm PS256
RSASSA-PSS using SHA-256 and MGF1 with SHA-256
. This is not a JDK standard
algorithm and requires that a JCA provider like BouncyCastle be in the runtime classpath. BouncyCastle
will be used automatically if found in the runtime classpath.public static final SignatureAlgorithm PS384
RSASSA-PSS using SHA-384 and MGF1 with SHA-384
. This is not a JDK standard
algorithm and requires that a JCA provider like BouncyCastle be in the runtime classpath. BouncyCastle
will be used automatically if found in the runtime classpath.public static final SignatureAlgorithm PS512
RSASSA-PSS using SHA-512 and MGF1 with SHA-512
. This is not a JDK standard
algorithm and requires that a JCA provider like BouncyCastle be in the classpath. BouncyCastle will be used
automatically if found in the runtime classpath.public static SignatureAlgorithm[] values()
for (SignatureAlgorithm c : SignatureAlgorithm.values()) System.out.println(c);
public static SignatureAlgorithm valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic String getValue()
public String getDescription()
public String getJcaName()
public boolean isJdkStandard()
true
if the algorithm is supported by standard JDK distributions or false
if the
algorithm implementation is not in the JDK and must be provided by a separate runtime JCA Provider (like
BouncyCastle for example).true
if the algorithm is supported by standard JDK distributions or false
if the
algorithm implementation is not in the JDK and must be provided by a separate runtime JCA Provider (like
BouncyCastle for example).public boolean isHmac()
true
if the enum instance represents an HMAC signature algorithm, false
otherwise.true
if the enum instance represents an HMAC signature algorithm, false
otherwise.public boolean isRsa()
true
if the enum instance represents an RSA public/private key pair signature algorithm,
false
otherwise.true
if the enum instance represents an RSA public/private key pair signature algorithm,
false
otherwise.public boolean isEllipticCurve()
true
if the enum instance represents an Elliptic Curve signature algorithm, false
otherwise.true
if the enum instance represents an Elliptic Curve signature algorithm, false
otherwise.public static SignatureAlgorithm forName(String value) throws SignatureException
SignatureAlgorithm
enum instance based on a
case-insensitive name comparison.value
- The case-insensitive name of the SignatureAlgorithm
instance to returnSignatureAlgorithm
enum instance based on a
case-insensitive name comparison.SignatureException
- if the specified value does not match any SignatureAlgorithm
name.Copyright © 2014. All rights reserved.