public class JWTTransferCartTokenEncoder extends Object implements TransferCartTokenEncoder
TransferCartTokenEncoder
that encodes the
TransferCartToken
into a JWT token string.Constructor and Description |
---|
JWTTransferCartTokenEncoder()
Optional constructor if looking to manually configure the encoder using the setters.
|
JWTTransferCartTokenEncoder(JWTTransferCartTokenEncoderProperties properties)
Primary constructor for initializing the encoder
|
Modifier and Type | Method and Description |
---|---|
TransferCartToken |
encode(TransferCartToken transferCartToken)
Encodes a token from the
TransferCartToken and should return the same object with
`token` property containing the encoded token string. |
protected com.nimbusds.jwt.JWTClaimsSet |
getClaims(TransferCartToken transferCartToken) |
protected Date |
getExpirationTime() |
protected JWTTransferCartTokenEncoderProperties |
getProperties() |
protected com.nimbusds.jose.JWSSigner |
getSigner() |
void |
setEncodedPrivateKey(String encodedPrivateKey)
Sets the value of
JWTTransferCartTokenEncoderProperties.getEncodedPrivateKey() , and
initializes the signer used to sign JWT tokens. |
void |
setExpirationTimeout(Duration expirationTimeout)
Setter for overwriting the current expiration time for
JWTTransferCartTokenEncoderProperties . |
void |
setIssuer(String issuer)
Setter for overwriting the current issuer for
JWTTransferCartTokenEncoderProperties . |
public JWTTransferCartTokenEncoder(@NonNull JWTTransferCartTokenEncoderProperties properties)
properties
- the property configuration for the encoderpublic JWTTransferCartTokenEncoder()
public void setEncodedPrivateKey(String encodedPrivateKey)
JWTTransferCartTokenEncoderProperties.getEncodedPrivateKey()
, and
initializes the signer
used to sign JWT tokens.encodedPrivateKey
- the encoded private keypublic void setIssuer(String issuer)
JWTTransferCartTokenEncoderProperties
.issuer
- the issuerpublic void setExpirationTimeout(Duration expirationTimeout)
JWTTransferCartTokenEncoderProperties
.expirationTimeout
- the expiration timeout durationpublic TransferCartToken encode(TransferCartToken transferCartToken) throws TransferCartTokenEncoderException
TransferCartTokenEncoder
TransferCartToken
and should return the same object with
`token` property containing the encoded token string.encode
in interface TransferCartTokenEncoder
transferCartToken
- the transfer cart token without an encoded token stringTransferCartTokenEncoderException
- when it fails to encode the tokenprotected com.nimbusds.jwt.JWTClaimsSet getClaims(TransferCartToken transferCartToken)
protected Date getExpirationTime()
protected JWTTransferCartTokenEncoderProperties getProperties()
protected com.nimbusds.jose.JWSSigner getSigner()
Copyright © 2021. All rights reserved.