public enum JWSAlg extends Enum<JWSAlg>
"alg" (Algorithm) Header Parameter Values for JWS.| Enum Constant and Description |
|---|
ES256
"ES256" (7); ECDSA using P-256 and SHA-256. |
ES384
"ES384" (8); ECDSA using P-384 and SHA-384. |
ES512
"ES512" (9); ECDSA using P-521 and SHA-512. |
HS256
"HS256" (1); HMAC using SHA-256. |
HS384
"HS384" (2); HMAC using SHA-384. |
HS512
"HS512" (3); HMAC using SHA-512. |
NONE
"none" (0); No digital signature or MAC performed. |
PS256
"PS256" (10); RSASSA-PSS using SHA-256 and MGF1 with SHA-256. |
PS384
"PS384" (11); RSASSA-PSS using SHA-384 and MGF1 with SHA-384. |
PS512
"PS512" (12); RSASSA-PSS using SHA-512 and MGF1 with SHA-512. |
RS256
"RS256" (4); RSASSA-PKCS-v1_5 using SHA-256. |
RS384
"RS384" (5); RSASSA-PKCS-v1_5 using SHA-384. |
RS512
"RS512" (6); RSASSA-PKCS-v1_5 using SHA-512. |
| Modifier and Type | Method and Description |
|---|---|
static JWSAlg |
getByValue(short value)
Find an instance of this enum by a value.
|
HashAlg |
getHashAlg()
Get the hash algorithm used by this signature algorithm.
|
String |
getName()
Get the name of this algorithm.
|
short |
getValue()
Get the integer representation of this enum instance.
|
boolean |
isAsymmetric()
Check if this algorithm is an asymmetric one.
|
static boolean |
isAsymmetric(JWSAlg alg)
Check if the given JWS algorithm is an asymmetric one.
|
boolean |
isSymmetric()
Check if this algorithm is a symmetric one.
|
static boolean |
isSymmetric(JWSAlg alg)
Check if the given JWS algorithm is a symmetric one.
|
static JWSAlg |
parse(String alg)
Convert
String to JWSAlg. |
static JWSAlg[] |
toArray(int bits) |
static int |
toBits(EnumSet<JWSAlg> set) |
static EnumSet<JWSAlg> |
toSet(int bits) |
static EnumSet<JWSAlg> |
toSet(JWSAlg[] array) |
String |
toString() |
static JWSAlg |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static JWSAlg[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final JWSAlg NONE
"none" (0); No digital signature or MAC performed.public static final JWSAlg HS256
"HS256" (1); HMAC using SHA-256.public static final JWSAlg HS384
"HS384" (2); HMAC using SHA-384.public static final JWSAlg HS512
"HS512" (3); HMAC using SHA-512.public static final JWSAlg RS256
"RS256" (4); RSASSA-PKCS-v1_5 using SHA-256.public static final JWSAlg RS384
"RS384" (5); RSASSA-PKCS-v1_5 using SHA-384.public static final JWSAlg RS512
"RS512" (6); RSASSA-PKCS-v1_5 using SHA-512.public static final JWSAlg ES256
"ES256" (7); ECDSA using P-256 and SHA-256.public static final JWSAlg ES384
"ES384" (8); ECDSA using P-384 and SHA-384.public static final JWSAlg ES512
"ES512" (9); ECDSA using P-521 and SHA-512.public static final JWSAlg PS256
"PS256" (10); RSASSA-PSS using SHA-256 and MGF1 with SHA-256.public static final JWSAlg PS384
"PS384" (11); RSASSA-PSS using SHA-384 and MGF1 with SHA-384.public static final JWSAlg PS512
"PS512" (12); RSASSA-PSS using SHA-512 and MGF1 with SHA-512.public static JWSAlg[] values()
for (JWSAlg c : JWSAlg.values()) System.out.println(c);
public static JWSAlg 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 getName()
public short getValue()
public HashAlg getHashAlg()
NONE returns null.public static JWSAlg getByValue(short value)
value - The integer representation of the instance to find.null if not found.public static JWSAlg parse(String alg)
String to JWSAlg.alg - Algorithm name. For example, "HS256".JWSAlg instance, or null.public static JWSAlg[] toArray(int bits)
public static boolean isSymmetric(JWSAlg alg)
public static boolean isAsymmetric(JWSAlg alg)
public boolean isSymmetric()
Copyright © 2019. All rights reserved.