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:
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, String jti, String htm, String htu, String keyId, AbstractCryptoProvider cryptoProvider)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringgenerateAccessTokenHash(String accessToken)static StringgenerateJti()StringgetAth()Returns the Hash of the access token.AbstractCryptoProvidergetCryptoProvider()StringgetEncodedJwt()StringgetHtm()Returns the HTTP method for the request to which the JWT is attached.StringgetHtu()Returns the HTTP URI used for the request, without query and fragment parts.LonggetIat()Returns the time at which the JWT was created.StringgetJti()Returns the unique identifier for the DPoP proof JWT.JSONWebKeygetJwk()Returns the public key chosen by the client, in JWK format.AsymmetricSignatureAlgorithmgetSignatureAlgorithm()Returns the digital signature algorithm identifier (Asymmetric Algorithm, must not be none).JwtTypegetType()Returns the type header (typ) dpop+jwtvoidsetAth(String ath)voidsetCryptoProvider(AbstractCryptoProvider cryptoProvider)voidsetHtm(String htm)Sets the HTTP method for the request to which the JWT is attached.voidsetHtu(String htu)Sets the HTTP URI used for the request, without query and fragment parts.voidsetIat(Long iat)Sets the time at which the JWT was created.voidsetJti(String jti)Sets the unique identifier for the DPoP proof JWT.voidsetJwk(JSONWebKey jwk)Sets the public key chosen by the client, in JWK format.voidsetSignatureAlgorithm(AsymmetricSignatureAlgorithm asymmetricSignatureAlgorithm)Sets the digital signature algorithm identifier (Asymmetric Algorithm, must not be none).StringtoString()-
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, String jti, String htm, String htu, String keyId, AbstractCryptoProvider cryptoProvider)
-
-
Method Detail
-
generateJti
public static String generateJti()
-
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 String getJti()
Returns the unique identifier for the DPoP proof JWT.- Returns:
- The unique identifier for the DPoP proof JWT.
-
setJti
public void setJti(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 String getHtm()
Returns the HTTP method for the request to which the JWT is attached.- Returns:
- The HTTP method.
-
setHtm
public void setHtm(String htm)
Sets the HTTP method for the request to which the JWT is attached.- Parameters:
htm- The HTTP method.
-
getHtu
public 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(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 Long getIat()
Returns the time at which the JWT was created.- Returns:
- The time at which the JWT was created.
-
setIat
public void setIat(Long iat)
Sets the time at which the JWT was created.- Parameters:
iat- The time at which the JWT was created.
-
getAth
public 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(String ath)
-
getCryptoProvider
public AbstractCryptoProvider getCryptoProvider()
-
setCryptoProvider
public void setCryptoProvider(AbstractCryptoProvider cryptoProvider)
-
getEncodedJwt
public String getEncodedJwt() throws InvalidJwtException, InvalidParameterException, CryptoProviderException
-
-