public enum SignatureAlgorithm extends java.lang.Enum<SignatureAlgorithm>
枚举常量和说明 |
---|
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 |
限定符和类型 | 方法和说明 |
---|---|
static SignatureAlgorithm |
forName(java.lang.String value)
Looks up and returns the corresponding
SignatureAlgorithm enum instance based on a
case-insensitive name comparison. |
java.lang.String |
getDescription()
Returns the JWA algorithm description.
|
java.lang.String |
getFamilyName()
Returns the cryptographic family name of the signature algorithm.
|
java.lang.String |
getJcaName()
Returns the name of the JCA algorithm used to compute the signature.
|
java.lang.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(java.lang.String name)
返回带有指定名称的该类型的枚举常量。
|
static SignatureAlgorithm[] |
values()
按照声明该枚举类型的常量的顺序, 返回
包含这些常量的数组。
|
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(java.lang.String name)
name
- 要返回的枚举常量的名称。java.lang.IllegalArgumentException
- 如果该枚举类型没有带有指定名称的常量java.lang.NullPointerException
- 如果参数为空值public java.lang.String getValue()
public java.lang.String getDescription()
public java.lang.String getFamilyName()
SignatureAlgorithm | Family Name |
---|---|
HS256 | HMAC |
HS384 | HMAC |
HS512 | HMAC |
RS256 | RSA |
RS384 | RSA |
RS512 | RSA |
PS256 | RSA |
PS384 | RSA |
PS512 | RSA |
ES256 | Elliptic Curve |
ES384 | Elliptic Curve |
ES512 | Elliptic Curve |
public java.lang.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(java.lang.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.