@Immutable public final class EncryptionMethod extends Algorithm
enc header parameter in JSON
Web Encryption (JWE) objects. This class is immutable.
Includes constants for the following standard encryption method names:
A128CBC-HS256
A192CBC-HS384
A256CBC-HS512
A128GCM
A192GCM
A256GCM
A128CBC+HS256 (deprecated)
A256CBC+HS512 (deprecated)
Additional encryption method names can be defined using the constructors.
| Modifier and Type | Class and Description |
|---|---|
static class |
EncryptionMethod.Family
Encryption method family.
|
| Modifier and Type | Field and Description |
|---|---|
static EncryptionMethod |
A128CBC_HS256
AES_128_CBC_HMAC_SHA_256 authenticated encryption using a 256 bit
key (required).
|
static EncryptionMethod |
A128CBC_HS256_DEPRECATED
AES_128_CBC_HMAC_SHA_256 authenticated encryption using a 256 bit
key, deprecated in JOSE draft suite version 09.
|
static EncryptionMethod |
A128GCM
AES in Galois/Counter Mode (GCM) (NIST.800-38D) using a 128 bit key
(recommended).
|
static EncryptionMethod |
A192CBC_HS384
AES_192_CBC_HMAC_SHA_384 authenticated encryption using a 384 bit
key (optional).
|
static EncryptionMethod |
A192GCM
AES in Galois/Counter Mode (GCM) (NIST.800-38D) using a 192 bit key
(optional).
|
static EncryptionMethod |
A256CBC_HS512
AES_256_CBC_HMAC_SHA_512 authenticated encryption using a 512 bit
key (required).
|
static EncryptionMethod |
A256CBC_HS512_DEPRECATED
AES_256_CBC_HMAC_SHA_512 authenticated encryption using a 512 bit
key, deprecated in JOSE draft suite version 09.
|
static EncryptionMethod |
A256GCM
AES in Galois/Counter Mode (GCM) (NIST.800-38D) using a 256 bit key
(recommended).
|
| Constructor and Description |
|---|
EncryptionMethod(String name)
Creates a new encryption method.
|
EncryptionMethod(String name,
Requirement req)
Creates a new encryption method.
|
EncryptionMethod(String name,
Requirement req,
int cekBitLength)
Creates a new encryption method.
|
| Modifier and Type | Method and Description |
|---|---|
int |
cekBitLength()
Gets the length of the associated Content Encryption Key (CEK).
|
static EncryptionMethod |
parse(String s)
Parses an encryption method from the specified string.
|
equals, getName, getRequirement, hashCode, toJSONString, toStringpublic static final EncryptionMethod A128CBC_HS256
public static final EncryptionMethod A192CBC_HS384
public static final EncryptionMethod A256CBC_HS512
public static final EncryptionMethod A128CBC_HS256_DEPRECATED
public static final EncryptionMethod A256CBC_HS512_DEPRECATED
public static final EncryptionMethod A128GCM
public static final EncryptionMethod A192GCM
public static final EncryptionMethod A256GCM
public EncryptionMethod(String name, Requirement req, int cekBitLength)
name - The encryption method name. Must not be
null.req - The implementation requirement, null if
not known.cekBitLength - The Content Encryption Key (CEK) bit length,
zero if not specified.public EncryptionMethod(String name, Requirement req)
name - The encryption method name. Must not be null.req - The implementation requirement, null if not
known.public EncryptionMethod(String name)
name - The encryption method name. Must not be null.public int cekBitLength()
public static EncryptionMethod parse(String s)
s - The string to parse. Must not be null.Copyright © 2018 Connect2id Ltd.. All rights reserved.