Package io.jans.as.model.jwt
Class DPoP
- java.lang.Object
-
- io.jans.as.model.token.JsonWebResponse
-
- io.jans.as.model.jwt.Jwt
-
- io.jans.as.model.jwt.DPoP
-
- All Implemented Interfaces:
java.io.Serializable
public class DPoP extends Jwt
- Version:
- September 30, 2021
- Author:
- Javier Rojas Blum
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class io.jans.as.model.token.JsonWebResponse
claims, header
-
-
Constructor Summary
Constructors Constructor Description DPoP(AsymmetricSignatureAlgorithm asymmetricSignatureAlgorithm, JSONWebKey jwk, java.lang.String jti, java.lang.String htm, java.lang.String htu, java.lang.String keyId, AbstractCryptoProvider cryptoProvider)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.String
generateAccessTokenHash(java.lang.String accessToken)
static java.lang.String
generateJti()
java.lang.String
getAth()
Returns the Hash of the access token.AbstractCryptoProvider
getCryptoProvider()
java.lang.String
getEncodedJwt()
java.lang.String
getHtm()
Returns the HTTP method for the request to which the JWT is attached.java.lang.String
getHtu()
Returns the HTTP URI used for the request, without query and fragment parts.java.lang.Long
getIat()
Returns the time at which the JWT was created.java.lang.String
getJti()
Returns the unique identifier for the DPoP proof JWT.JSONWebKey
getJwk()
Returns the public key chosen by the client, in JWK format.AsymmetricSignatureAlgorithm
getSignatureAlgorithm()
Returns the digital signature algorithm identifier (Asymmetric Algorithm, must not be none).JwtType
getType()
Returns the type header (typ) dpop+jwtvoid
setAth(java.lang.String ath)
void
setCryptoProvider(AbstractCryptoProvider cryptoProvider)
void
setHtm(java.lang.String htm)
Sets the HTTP method for the request to which the JWT is attached.void
setHtu(java.lang.String htu)
Sets the HTTP URI used for the request, without query and fragment parts.void
setIat(java.lang.Long iat)
Sets the time at which the JWT was created.void
setJti(java.lang.String jti)
Sets the unique identifier for the DPoP proof JWT.void
setJwk(JSONWebKey jwk)
Sets the public key chosen by the client, in JWK format.void
setSignatureAlgorithm(AsymmetricSignatureAlgorithm asymmetricSignatureAlgorithm)
Sets the digital signature algorithm identifier (Asymmetric Algorithm, must not be none).java.lang.String
toString()
-
Methods inherited from class io.jans.as.model.jwt.Jwt
getEncodedSignature, getSigningInput, parse, parseOrThrow, parseSilently, setEncodedSignature
-
-
-
-
Constructor Detail
-
DPoP
public DPoP(AsymmetricSignatureAlgorithm asymmetricSignatureAlgorithm, JSONWebKey jwk, java.lang.String jti, java.lang.String htm, java.lang.String htu, java.lang.String keyId, AbstractCryptoProvider cryptoProvider)
-
-
Method Detail
-
generateJti
public static java.lang.String generateJti()
-
generateAccessTokenHash
public static java.lang.String generateAccessTokenHash(java.lang.String accessToken)
-
getType
public JwtType getType()
Returns the type header (typ) dpop+jwt- Returns:
- The type header (typ) dpop+jwt
-
getSignatureAlgorithm
public AsymmetricSignatureAlgorithm getSignatureAlgorithm()
Returns the digital signature algorithm identifier (Asymmetric Algorithm, must not be none).- Returns:
- The digital signature algorithm identifier.
-
setSignatureAlgorithm
public void setSignatureAlgorithm(AsymmetricSignatureAlgorithm asymmetricSignatureAlgorithm)
Sets the digital signature algorithm identifier (Asymmetric Algorithm, must not be none).- Parameters:
asymmetricSignatureAlgorithm
- The digital signature algorithm identifier.
-
getJwk
public JSONWebKey getJwk()
Returns the public key chosen by the client, in JWK format.- Returns:
- The public key.
-
setJwk
public void setJwk(JSONWebKey jwk)
Sets the public key chosen by the client, in JWK format. Must not contain the private key.- Parameters:
jwk
- The public key.
-
getJti
public java.lang.String getJti()
Returns the unique identifier for the DPoP proof JWT.- Returns:
- The unique identifier for the DPoP proof JWT.
-
setJti
public void setJti(java.lang.String jti)
Sets the unique identifier for the DPoP proof JWT. The value must be assigned such that there is a negligible probability that the same value will be assigned to any other DPoP proof used in the same context during the time window of validity.- Parameters:
jti
- The unique identifier for the DPoP JWT.
-
getHtm
public java.lang.String getHtm()
Returns the HTTP method for the request to which the JWT is attached.- Returns:
- The HTTP method.
-
setHtm
public void setHtm(java.lang.String htm)
Sets the HTTP method for the request to which the JWT is attached.- Parameters:
htm
- The HTTP method.
-
getHtu
public java.lang.String getHtu()
Returns the HTTP URI used for the request, without query and fragment parts.- Returns:
- The HTTP URI used for the request.
-
setHtu
public void setHtu(java.lang.String htu)
Sets the HTTP URI used for the request, without query and fragment parts.- Parameters:
htu
- The HTTP URI used for the request.
-
getIat
public java.lang.Long getIat()
Returns the time at which the JWT was created.- Returns:
- The time at which the JWT was created.
-
setIat
public void setIat(java.lang.Long iat)
Sets the time at which the JWT was created.- Parameters:
iat
- The time at which the JWT was created.
-
getAth
public java.lang.String getAth()
Returns the Hash of the access token. Required when the DPoP proof is used in conjunction with the presentation of an access token.- Returns:
- The Hash of the access token.
-
setAth
public void setAth(java.lang.String ath)
-
getCryptoProvider
public AbstractCryptoProvider getCryptoProvider()
-
setCryptoProvider
public void setCryptoProvider(AbstractCryptoProvider cryptoProvider)
-
getEncodedJwt
public java.lang.String getEncodedJwt() throws java.lang.Exception
- Throws:
java.lang.Exception
-
-