com.nimbusds.openid.connect.sdk.util
Class DefaultJOSEObjectDecoder

java.lang.Object
  extended by com.nimbusds.openid.connect.sdk.util.DefaultJOSEObjectDecoder
All Implemented Interfaces:
JOSEObjectDecoder

@ThreadSafe
public class DefaultJOSEObjectDecoder
extends Object
implements JOSEObjectDecoder

The default decoder of JOSE objects. This class is thread-safe.

Supports:

Not supported: JWS-signed and then JWE-encrypted (nested) objects.

Version:
$version$ (2012-11-13)
Author:
Vladimir Dzhuvinov

Constructor Summary
DefaultJOSEObjectDecoder()
          Creates a new decoder of JOSE objects.
 
Method Summary
 void addJWEDecrypter(com.nimbusds.jose.JWEDecrypter decrypter)
          Adds the specified JWE decrypter for decoding encrypted JOSE objects.
 void addJWSVerifier(com.nimbusds.jose.JWSVerifier verifier)
          Adds the specified JWS verifier for decoding signed JOSE objects.
 com.nimbusds.jose.Payload decodeJOSEObject(com.nimbusds.jose.JOSEObject joseObject)
          Decodes a JOSE object by applying JWS signature validation and/or JWE decryption if the object is secured.
 Collection<com.nimbusds.jose.JWEDecrypter> getJWEDecrypters()
          Gets the JWE decrypters.
 Collection<com.nimbusds.jose.JWSVerifier> getJWSVerifiers()
          Gets the JWS verifiers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultJOSEObjectDecoder

public DefaultJOSEObjectDecoder()
Creates a new decoder of JOSE objects. It must then be configured by adding one ore more JWS verifiers and/or JWE decrypters.

Method Detail

addJWSVerifier

public void addJWSVerifier(com.nimbusds.jose.JWSVerifier verifier)
Adds the specified JWS verifier for decoding signed JOSE objects. The JWS algorithms accepted by the verifier should match the ones used to secure the expected JOSE objects.

Parameters:
verifier - The JWS verifier to add. Must be ready to verify signed JOSE objects and not null.

getJWSVerifiers

public Collection<com.nimbusds.jose.JWSVerifier> getJWSVerifiers()
Gets the JWS verifiers.

Returns:
The JWS verifiers, empty collection if none.

addJWEDecrypter

public void addJWEDecrypter(com.nimbusds.jose.JWEDecrypter decrypter)
Adds the specified JWE decrypter for decoding encrypted JOSE objects. The JWE algorithms accepted by the decrypter should match the ones used to secure the expected JOSE objects.

Parameters:
decrypter - The JWE decrypter to add. Must be ready to decrypt encrypted JOSE objects and not null.

getJWEDecrypters

public Collection<com.nimbusds.jose.JWEDecrypter> getJWEDecrypters()
Gets the JWE decrypters.

Returns:
The JWE decrypters, empty collection if none.

decodeJOSEObject

public com.nimbusds.jose.Payload decodeJOSEObject(com.nimbusds.jose.JOSEObject joseObject)
                                           throws com.nimbusds.jose.JOSEException
Description copied from interface: JOSEObjectDecoder
Decodes a JOSE object by applying JWS signature validation and/or JWE decryption if the object is secured.

Specified by:
decodeJOSEObject in interface JOSEObjectDecoder
Parameters:
joseObject - The JOSE object. Must not be null.
Returns:
The decoded JOSE object payload.
Throws:
com.nimbusds.jose.JOSEException - If decoding, signature validation and/or JWE decryption of the JOSE object failed.


Copyright © 2013 NimbusDS. All Rights Reserved.