public class SignedThenEncryptedJwt extends EncryptedJwt
Constructor and Description |
---|
SignedThenEncryptedJwt(EncryptedJwt encryptedJwt)
Constructs a fresh signed-then-encrypted JWT from an encrypted JWT.
|
SignedThenEncryptedJwt(JweHeader header,
SignedJwt payload,
Key publicKey)
Constructs a fresh signed-then-encrypted JWT with the given signed JWT payload, JWE headers and encryption key.
|
SignedThenEncryptedJwt(JweHeader header,
String encodedHeader,
byte[] encryptedContentEncryptionKey,
byte[] initialisationVector,
byte[] ciphertext,
byte[] authenticationTag)
Reconstructs a signed-then-encrypted JWT from components parts of the encrypted JWT string.
|
Modifier and Type | Method and Description |
---|---|
SignedThenEncryptedJwt |
copy()
Create a copy of the current payload.
|
boolean |
decryptAndVerify(Key decryptionKey,
SigningHandler signingHandler)
Decrypts the outer JWT and then verifies the signature on the inner JWT.
|
JwtClaimsSet |
getClaimsSet()
Gets the claims set object for the Jwt, which contains all of the claims (name value pairs) conveyed by the JWT.
|
SignedJwt |
getSignedJwt()
Get the signed JWT.
|
boolean |
verify(SigningHandler signingHandler)
Verifies that the signature is valid on the nested signed JWT.
|
build, decrypt, decryptRawPayload, getHeader
public SignedThenEncryptedJwt(EncryptedJwt encryptedJwt)
encryptedJwt
- the encrypted JWT.public SignedThenEncryptedJwt(JweHeader header, SignedJwt payload, Key publicKey)
header
- the JWE headers.payload
- the signed JWT payload.publicKey
- the encryption key.public SignedThenEncryptedJwt(JweHeader header, String encodedHeader, byte[] encryptedContentEncryptionKey, byte[] initialisationVector, byte[] ciphertext, byte[] authenticationTag)
header
- the decoded headers.encodedHeader
- the encoded headers.encryptedContentEncryptionKey
- the encrypted content encryption key (CEK), or null if not used.initialisationVector
- the initialisation vector (IV).ciphertext
- the encrypted ciphertext payload.authenticationTag
- the authentication MAC tag.public boolean verify(SigningHandler signingHandler)
signingHandler
- the handler to use for verifying the signature.JwsVerifyingException
- if the outer JWT has not already been decrypted.public boolean decryptAndVerify(Key decryptionKey, SigningHandler signingHandler)
decryptionKey
- the decryption key for the outer JWE.signingHandler
- the signing handler for verifying the nested JWS.JweDecryptionException
- if the JWE cannot be decrypted.public JwtClaimsSet getClaimsSet()
Jwt
getClaimsSet
in interface Jwt
getClaimsSet
in class EncryptedJwt
public SignedJwt getSignedJwt()
EncryptedJwt.decrypt(Key)
first.public SignedThenEncryptedJwt copy()
Payload
copy
in interface Payload
copy
in class EncryptedJwt
Copyright © 2010-2018, ForgeRock All Rights Reserved.