Package com.nimbusds.oauth2.sdk.dpop
Class DefaultDPoPProofFactory
- java.lang.Object
-
- com.nimbusds.oauth2.sdk.dpop.DefaultDPoPProofFactory
-
- All Implemented Interfaces:
DPoPProofFactory
public class DefaultDPoPProofFactory extends Object implements DPoPProofFactory
Default DPoP proof factory.
-
-
Field Summary
-
Fields inherited from interface com.nimbusds.oauth2.sdk.dpop.DPoPProofFactory
MINIMAL_JTI_BYTE_LENGTH, TYPE
-
-
Constructor Summary
Constructors Constructor Description DefaultDPoPProofFactory(com.nimbusds.jose.jwk.JWK jwk, com.nimbusds.jose.JWSAlgorithm jwsAlg)
Creates a new DPoP proof factory using the default JCA provider.DefaultDPoPProofFactory(com.nimbusds.jose.jwk.JWK jwk, com.nimbusds.jose.JWSAlgorithm jwsAlg, Provider jcaProvider)
Creates a new DPoP proof factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.nimbusds.jwt.SignedJWT
createDPoPJWT(JWTID jti, String htm, URI htu, Date iat, AccessToken accessToken)
Creates a new DPoP proof.com.nimbusds.jwt.SignedJWT
createDPoPJWT(JWTID jti, String htm, URI htu, Date iat, AccessToken accessToken, Nonce nonce)
Creates a new DPoP proof.com.nimbusds.jwt.SignedJWT
createDPoPJWT(String htm, URI htu)
Creates a new DPoP proof.com.nimbusds.jwt.SignedJWT
createDPoPJWT(String htm, URI htu, AccessToken accessToken)
Creates a new DPoP proof.com.nimbusds.jwt.SignedJWT
createDPoPJWT(String htm, URI htu, AccessToken accessToken, Nonce nonce)
Creates a new DPoP proof.com.nimbusds.jwt.SignedJWT
createDPoPJWT(String htm, URI htu, Nonce nonce)
Creates a new DPoP proof.com.nimbusds.jose.JWSAlgorithm
getJWSAlgorithm()
Returns the configured JWS algorithm.com.nimbusds.jose.JWSSigner
getJWSSigner()
Returns the JWS signer.com.nimbusds.jose.jwk.JWK
getPublicJWK()
Returns the configured public signing JWK.
-
-
-
Constructor Detail
-
DefaultDPoPProofFactory
public DefaultDPoPProofFactory(com.nimbusds.jose.jwk.JWK jwk, com.nimbusds.jose.JWSAlgorithm jwsAlg) throws com.nimbusds.jose.JOSEException
Creates a new DPoP proof factory using the default JCA provider.- Parameters:
jwk
- The signing JWK. Must not benull
.jwsAlg
- The signing JWS algorithm. Must not benull
.- Throws:
com.nimbusds.jose.JOSEException
- If signer creation failed.
-
DefaultDPoPProofFactory
public DefaultDPoPProofFactory(com.nimbusds.jose.jwk.JWK jwk, com.nimbusds.jose.JWSAlgorithm jwsAlg, Provider jcaProvider) throws com.nimbusds.jose.JOSEException
Creates a new DPoP proof factory.- Parameters:
jwk
- The signing JWK. Must not benull
.jwsAlg
- The signing JWS algorithm. Must not benull
.jcaProvider
- The JCA provider to use for signing,null
to use the default.- Throws:
com.nimbusds.jose.JOSEException
- If signer creation failed.
-
-
Method Detail
-
getPublicJWK
public com.nimbusds.jose.jwk.JWK getPublicJWK()
Returns the configured public signing JWK.- Returns:
- The public signing JWK.
-
getJWSAlgorithm
public com.nimbusds.jose.JWSAlgorithm getJWSAlgorithm()
Returns the configured JWS algorithm.- Returns:
- The JWS algorithm.
-
getJWSSigner
public com.nimbusds.jose.JWSSigner getJWSSigner()
Returns the JWS signer.- Returns:
- The JWS signer.
-
createDPoPJWT
public com.nimbusds.jwt.SignedJWT createDPoPJWT(String htm, URI htu) throws com.nimbusds.jose.JOSEException
Description copied from interface:DPoPProofFactory
Creates a new DPoP proof.- Specified by:
createDPoPJWT
in interfaceDPoPProofFactory
- Parameters:
htm
- The HTTP request method. Must not benull
.htu
- The HTTP URI, without a query or fragment. Must not benull
.- Returns:
- The signed DPoP JWT.
- Throws:
com.nimbusds.jose.JOSEException
- If signing failed.
-
createDPoPJWT
public com.nimbusds.jwt.SignedJWT createDPoPJWT(String htm, URI htu, Nonce nonce) throws com.nimbusds.jose.JOSEException
Description copied from interface:DPoPProofFactory
Creates a new DPoP proof.- Specified by:
createDPoPJWT
in interfaceDPoPProofFactory
- Parameters:
htm
- The HTTP request method. Must not benull
.htu
- The HTTP URI, without a query or fragment. Must not benull
.nonce
- The nonce,null
if not specified.- Returns:
- The signed DPoP JWT.
- Throws:
com.nimbusds.jose.JOSEException
- If signing failed.
-
createDPoPJWT
public com.nimbusds.jwt.SignedJWT createDPoPJWT(String htm, URI htu, AccessToken accessToken) throws com.nimbusds.jose.JOSEException
Description copied from interface:DPoPProofFactory
Creates a new DPoP proof.- Specified by:
createDPoPJWT
in interfaceDPoPProofFactory
- Parameters:
htm
- The HTTP request method. Must not benull
.htu
- The HTTP URI, without a query or fragment. Must not benull
.accessToken
- The access token for the access token hash ("ath") claim computation,null
if not specified.- Returns:
- The signed DPoP JWT.
- Throws:
com.nimbusds.jose.JOSEException
- If signing failed.
-
createDPoPJWT
public com.nimbusds.jwt.SignedJWT createDPoPJWT(String htm, URI htu, AccessToken accessToken, Nonce nonce) throws com.nimbusds.jose.JOSEException
Description copied from interface:DPoPProofFactory
Creates a new DPoP proof.- Specified by:
createDPoPJWT
in interfaceDPoPProofFactory
- Parameters:
htm
- The HTTP request method. Must not benull
.htu
- The HTTP URI, without a query or fragment. Must not benull
.accessToken
- The access token for the access token hash ("ath") claim computation,null
if not specified.nonce
- The nonce,null
if not specified.- Returns:
- The signed DPoP JWT.
- Throws:
com.nimbusds.jose.JOSEException
- If signing failed.
-
createDPoPJWT
public com.nimbusds.jwt.SignedJWT createDPoPJWT(JWTID jti, String htm, URI htu, Date iat, AccessToken accessToken) throws com.nimbusds.jose.JOSEException
Description copied from interface:DPoPProofFactory
Creates a new DPoP proof.- Specified by:
createDPoPJWT
in interfaceDPoPProofFactory
- Parameters:
jti
- The JWT ID. Must not benull
.htm
- The HTTP request method. Must not benull
.htu
- The HTTP URI, without a query or fragment. Must not benull
.iat
- The issue time. Must not benull
.accessToken
- The access token for the access token hash ("ath") claim computation,null
if not specified.- Returns:
- The signed DPoP JWT.
- Throws:
com.nimbusds.jose.JOSEException
- If signing failed.
-
createDPoPJWT
public com.nimbusds.jwt.SignedJWT createDPoPJWT(JWTID jti, String htm, URI htu, Date iat, AccessToken accessToken, Nonce nonce) throws com.nimbusds.jose.JOSEException
Description copied from interface:DPoPProofFactory
Creates a new DPoP proof.- Specified by:
createDPoPJWT
in interfaceDPoPProofFactory
- Parameters:
jti
- The JWT ID. Must not benull
.htm
- The HTTP request method. Must not benull
.htu
- The HTTP URI, without a query or fragment. Must not benull
.iat
- The issue time. Must not benull
.accessToken
- The access token for the access token hash ("ath") claim computation,null
if not specified.nonce
- The nonce,null
if not specified.- Returns:
- The signed DPoP JWT.
- Throws:
com.nimbusds.jose.JOSEException
- If signing failed.
-
-