com.nimbusds.jose
Class JWSAlgorithm

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

@Immutable
public final class JWSAlgorithm
extends Algorithm

JSON Web Signature (JWS) algorithm name, represents the 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.

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

Field Summary
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 RS256
          RSA using SHA-256 hash algorithm (recommended).
static JWSAlgorithm RS384
          RSA using SHA-384 hash algorithm (optional).
static JWSAlgorithm RS512
          RSA using SHA-512 hash algorithm (optional).
 
Fields inherited from class com.nimbusds.jose.Algorithm
NONE
 
Constructor Summary
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.
 
Method Summary
static JWSAlgorithm parse(String s)
          Parses a JWS 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

HS256

public static final JWSAlgorithm HS256
HMAC using SHA-256 hash algorithm (required).


HS384

public static final JWSAlgorithm HS384
HMAC using SHA-384 hash algorithm (optional).


HS512

public static final JWSAlgorithm HS512
HMAC using SHA-512 hash algorithm (optional).


RS256

public static final JWSAlgorithm RS256
RSA using SHA-256 hash algorithm (recommended).


RS384

public static final JWSAlgorithm RS384
RSA using SHA-384 hash algorithm (optional).


RS512

public static final JWSAlgorithm RS512
RSA using SHA-512 hash algorithm (optional).


ES256

public static final JWSAlgorithm ES256
ECDSA using P-256 curve and SHA-256 hash algorithm (recommended).


ES384

public static final JWSAlgorithm ES384
ECDSA using P-384 curve and SHA-384 hash algorithm (optional).


ES512

public static final JWSAlgorithm ES512
ECDSA using P-521 curve and SHA-512 hash algorithm (optional).

Constructor Detail

JWSAlgorithm

public JWSAlgorithm(String name,
                    Requirement req)
Creates a new JSON Web Signature (JWS) algorithm name.

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

JWSAlgorithm

public JWSAlgorithm(String name)
Creates a new JSON Web Signature (JWS) algorithm name.

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

parse

public static JWSAlgorithm parse(String s)
Parses a JWS algorithm from the specified string.

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


Copyright © 2013 NimbusDS. All Rights Reserved.