com.nimbusds.jose
Class JWEAlgorithm

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

@Immutable
public final class JWEAlgorithm
extends Algorithm

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

Includes constants for the following standard JWE algorithm names:

Additional JWE algorithm names can be defined using the constructors.

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

Field Summary
static JWEAlgorithm A128KW
          Advanced Encryption Standard (AES) Key Wrap Algorithm (RFC 3394) using 256 bit keys (recommended).
static JWEAlgorithm A256KW
          Advanced Encryption Standard (AES) Key Wrap Algorithm (RFC 3394) using 256 bit keys (recommended).
static JWEAlgorithm DIR
          Direct use of a shared symmetric key as the Content Master Key (CMK) for the block encryption step (rather than using the symmetric key to wrap the CMK) (recommended).
static JWEAlgorithm ECDH_ES
          Elliptic Curve Diffie-Hellman Ephemeral Static (RFC 6090) key agreement using the Concat KDF, as defined in section 5.8.1 of NIST.800-56A, with the agreed-upon key being used directly as the Content Master Key (CMK) (rather than being used to wrap the CMK) (recommended).
static JWEAlgorithm ECDH_ES_A128KW
          Elliptic Curve Diffie-Hellman Ephemeral Static key agreement per "ECDH-ES", but where the agreed-upon key is used to wrap the Content Master Key (CMK) with the "A128KW" function (rather than being used directly as the CMK) (recommended).
static JWEAlgorithm ECDH_ES_A256KW
          Elliptic Curve Diffie-Hellman Ephemeral Static key agreement per "ECDH-ES", but where the agreed-upon key is used to wrap the Content Master Key (CMK) with the "A256KW" function (rather than being used directly as the CMK) (recommended).
static JWEAlgorithm RSA_OAEP
          RSAES using Optimal Assymetric Encryption Padding (OAEP) (RFC 3447), with the default parameters specified by RFC 3447 in section A.2.1 (recommended).
static JWEAlgorithm RSA1_5
          RSAES-PKCS1-V1_5 (RFC 3447) (required).
 
Fields inherited from class com.nimbusds.jose.Algorithm
NONE
 
Constructor Summary
JWEAlgorithm(String name)
          Creates a new JSON Web Encryption (JWE) algorithm.
JWEAlgorithm(String name, Requirement req)
          Creates a new JSON Web Encryption (JWE) algorithm.
 
Method Summary
static JWEAlgorithm parse(String s)
          Parses a JWE algorithm 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

RSA1_5

public static final JWEAlgorithm RSA1_5
RSAES-PKCS1-V1_5 (RFC 3447) (required).


RSA_OAEP

public static final JWEAlgorithm RSA_OAEP
RSAES using Optimal Assymetric Encryption Padding (OAEP) (RFC 3447), with the default parameters specified by RFC 3447 in section A.2.1 (recommended).


A128KW

public static final JWEAlgorithm A128KW
Advanced Encryption Standard (AES) Key Wrap Algorithm (RFC 3394) using 256 bit keys (recommended).


A256KW

public static final JWEAlgorithm A256KW
Advanced Encryption Standard (AES) Key Wrap Algorithm (RFC 3394) using 256 bit keys (recommended).


DIR

public static final JWEAlgorithm DIR
Direct use of a shared symmetric key as the Content Master Key (CMK) for the block encryption step (rather than using the symmetric key to wrap the CMK) (recommended).


ECDH_ES

public static final JWEAlgorithm ECDH_ES
Elliptic Curve Diffie-Hellman Ephemeral Static (RFC 6090) key agreement using the Concat KDF, as defined in section 5.8.1 of NIST.800-56A, with the agreed-upon key being used directly as the Content Master Key (CMK) (rather than being used to wrap the CMK) (recommended).


ECDH_ES_A128KW

public static final JWEAlgorithm ECDH_ES_A128KW
Elliptic Curve Diffie-Hellman Ephemeral Static key agreement per "ECDH-ES", but where the agreed-upon key is used to wrap the Content Master Key (CMK) with the "A128KW" function (rather than being used directly as the CMK) (recommended).


ECDH_ES_A256KW

public static final JWEAlgorithm ECDH_ES_A256KW
Elliptic Curve Diffie-Hellman Ephemeral Static key agreement per "ECDH-ES", but where the agreed-upon key is used to wrap the Content Master Key (CMK) with the "A256KW" function (rather than being used directly as the CMK) (recommended).

Constructor Detail

JWEAlgorithm

public JWEAlgorithm(String name,
                    Requirement req)
Creates a new JSON Web Encryption (JWE) algorithm.

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

JWEAlgorithm

public JWEAlgorithm(String name)
Creates a new JSON Web Encryption (JWE) algorithm.

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

parse

public static JWEAlgorithm parse(String s)
Parses a JWE algorithm from the specified string.

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


Copyright © 2013 NimbusDS. All Rights Reserved.