com.nimbusds.jose
Class EncryptionMethod

java.lang.Object
  extended by com.nimbusds.jose.Algorithm
      extended by com.nimbusds.jose.EncryptionMethod
All Implemented Interfaces:
net.minidev.json.JSONAware

@Immutable
public final class EncryptionMethod
extends Algorithm

Encryption method name, represents the enc header parameter in JSON Web Encryption (JWE) objects. This class is immutable.

Includes constants for the following standard encryption method names:

Additional encryption method names can be defined using the constructors.

Version:
$version$ (2013-01-08)
Author:
Vladimir Dzhuvinov

Field Summary
static EncryptionMethod A128CBC_HS256
          Composite Authenticated Encryption algorithm using Advanced Encryption Standard (AES) in Cipher Block Chaining (CBC) mode with PKCS #5 padding (NIST.800-38A) with an integrity calculation using HMAC SHA-256, using a 256 bit CMK (and a 128 bit CEK) (required).
static EncryptionMethod A128GCM
          Advanced Encryption Standard (AES) in Galois/Counter Mode (GCM) (NIST.800-38D) using 128 bit keys (recommended).
static EncryptionMethod A256CBC_HS512
          Composite Authenticated Encryption algorithm using Advanced Encryption Standard (AES) in Cipher Block Chaining (CBC) mode with PKCS #5 padding (NIST.800-38A) with an integrity calculation using HMAC SHA-512, using a 512 bit CMK (and a 256 bit CEK) (required).
static EncryptionMethod A256GCM
          Advanced Encryption Standard (AES) in Galois/Counter Mode (GCM) (NIST.800-38D) using 256 bit keys (recommended).
 
Fields inherited from class com.nimbusds.jose.Algorithm
NONE
 
Constructor Summary
EncryptionMethod(java.lang.String name)
          Creates a new encryption method.
EncryptionMethod(java.lang.String name, Requirement req)
          Creates a new encryption method.
 
Method Summary
static EncryptionMethod parse(java.lang.String s)
          Parses an encryption method from the specified string.
 
Methods inherited from class com.nimbusds.jose.Algorithm
equals, getName, getRequirement, hashCode, toJSONString, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

A128CBC_HS256

public static final EncryptionMethod A128CBC_HS256
Composite Authenticated Encryption algorithm using Advanced Encryption Standard (AES) in Cipher Block Chaining (CBC) mode with PKCS #5 padding (NIST.800-38A) with an integrity calculation using HMAC SHA-256, using a 256 bit CMK (and a 128 bit CEK) (required).


A256CBC_HS512

public static final EncryptionMethod A256CBC_HS512
Composite Authenticated Encryption algorithm using Advanced Encryption Standard (AES) in Cipher Block Chaining (CBC) mode with PKCS #5 padding (NIST.800-38A) with an integrity calculation using HMAC SHA-512, using a 512 bit CMK (and a 256 bit CEK) (required).


A128GCM

public static final EncryptionMethod A128GCM
Advanced Encryption Standard (AES) in Galois/Counter Mode (GCM) (NIST.800-38D) using 128 bit keys (recommended).


A256GCM

public static final EncryptionMethod A256GCM
Advanced Encryption Standard (AES) in Galois/Counter Mode (GCM) (NIST.800-38D) using 256 bit keys (recommended).

Constructor Detail

EncryptionMethod

public EncryptionMethod(java.lang.String name,
                        Requirement req)
Creates a new encryption method.

Parameters:
name - The encryption method name. Must not be null.
req - The implementation requirement, null if not known.

EncryptionMethod

public EncryptionMethod(java.lang.String name)
Creates a new encryption method.

Parameters:
name - The encryption method name. Must not be null.
Method Detail

parse

public static EncryptionMethod parse(java.lang.String s)
Parses an encryption method from the specified string.

Parameters:
s - The string to parse. Must not be null.
Returns:
The encryption method (matching standard algorithm constant, else a newly created algorithm).


Copyright © 2013 NimbusDS. All Rights Reserved.