@Immutable public final class JWSAlgorithm extends Algorithm
alg
header
parameter in JWS objects. Also used to represent integrity algorithm
(ia
) header parameters in JWE objects. This class is immutable.
Includes constants for the following standard JWS algorithm names:
Additional JWS algorithm names can be defined using the constructors.
Modifier and Type | Class and Description |
---|---|
static class |
JWSAlgorithm.Family
JWS algorithm family.
|
Modifier and Type | Field and Description |
---|---|
static JWSAlgorithm |
ES256
ECDSA using P-256 curve and SHA-256 hash algorithm (recommended).
|
static JWSAlgorithm |
ES384
ECDSA using P-384 curve and SHA-384 hash algorithm (optional).
|
static JWSAlgorithm |
ES512
ECDSA using P-521 curve and SHA-512 hash algorithm (optional).
|
static JWSAlgorithm |
HS256
HMAC using SHA-256 hash algorithm (required).
|
static JWSAlgorithm |
HS384
HMAC using SHA-384 hash algorithm (optional).
|
static JWSAlgorithm |
HS512
HMAC using SHA-512 hash algorithm (optional).
|
static JWSAlgorithm |
PS256
RSASSA-PSS using SHA-256 hash algorithm and MGF1 mask generation
function with SHA-256 (optional).
|
static JWSAlgorithm |
PS384
RSASSA-PSS using SHA-384 hash algorithm and MGF1 mask generation
function with SHA-384 (optional).
|
static JWSAlgorithm |
PS512
RSASSA-PSS using SHA-512 hash algorithm and MGF1 mask generation
function with SHA-512 (optional).
|
static JWSAlgorithm |
RS256
RSASSA-PKCS-v1_5 using SHA-256 hash algorithm (recommended).
|
static JWSAlgorithm |
RS384
RSASSA-PKCS-v1_5 using SHA-384 hash algorithm (optional).
|
static JWSAlgorithm |
RS512
RSASSA-PKCS-v1_5 using SHA-512 hash algorithm (optional).
|
Constructor and Description |
---|
JWSAlgorithm(String name)
Creates a new JSON Web Signature (JWS) algorithm name.
|
JWSAlgorithm(String name,
Requirement req)
Creates a new JSON Web Signature (JWS) algorithm name.
|
Modifier and Type | Method and Description |
---|---|
static JWSAlgorithm |
parse(String s)
Parses a JWS algorithm from the specified string.
|
equals, getName, getRequirement, hashCode, toJSONString, toString
public static final JWSAlgorithm HS256
public static final JWSAlgorithm HS384
public static final JWSAlgorithm HS512
public static final JWSAlgorithm RS256
public static final JWSAlgorithm RS384
public static final JWSAlgorithm RS512
public static final JWSAlgorithm ES256
public static final JWSAlgorithm ES384
public static final JWSAlgorithm ES512
public static final JWSAlgorithm PS256
public static final JWSAlgorithm PS384
public static final JWSAlgorithm PS512
public JWSAlgorithm(String name, Requirement req)
name
- The algorithm name. Must not be null
.req
- The implementation requirement, null
if not
known.public JWSAlgorithm(String name)
name
- The algorithm name. Must not be null
.public static JWSAlgorithm parse(String s)
s
- The string to parse. Must not be null
.Copyright © 2017 Connect2id Ltd.. All rights reserved.