Package org.keycloak.sdjwt
Class SdJws
java.lang.Object
org.keycloak.sdjwt.SdJws
- Direct Known Subclasses:
IssuerSignedJWT
,KeyBindingJWT
Handle jws, either the issuer jwt or the holder key binding jwt.
- Author:
- Francis Pouatcha
-
Constructor Summary
ModifierConstructorDescriptionprotected
SdJws
(com.fasterxml.jackson.databind.JsonNode payload) protected
SdJws
(com.fasterxml.jackson.databind.JsonNode payload, SignatureSignerContext signer, String jwsType) protected
protected
-
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.databind.JsonNode
protected static JWSInput
sign
(com.fasterxml.jackson.databind.JsonNode payload, SignatureSignerContext signer, String jwsType) toJws()
void
verifyAge
(int maxAge) Verifies that the JWS is not too old.void
void
verifyIssClaim
(List<String> issuers) Verifies that SD-JWT was issued by one of the provided issuers.void
void
void
verifySignature
(SignatureVerifierContext verifier) void
verifyVctClaim
(List<String> vcts) Verifies that SD-JWT vct claim matches the expected one.
-
Constructor Details
-
SdJws
protected SdJws(com.fasterxml.jackson.databind.JsonNode payload) -
SdJws
-
SdJws
-
SdJws
protected SdJws(com.fasterxml.jackson.databind.JsonNode payload, SignatureSignerContext signer, String jwsType)
-
-
Method Details
-
toJws
-
getPayload
public com.fasterxml.jackson.databind.JsonNode getPayload() -
sign
protected static JWSInput sign(com.fasterxml.jackson.databind.JsonNode payload, SignatureSignerContext signer, String jwsType) -
verifySignature
- Throws:
VerificationException
-
getHeader
-
verifyIssuedAtClaim
- Throws:
VerificationException
-
verifyExpClaim
- Throws:
VerificationException
-
verifyNotBeforeClaim
- Throws:
VerificationException
-
verifyAge
Verifies that the JWS is not too old.- Parameters:
maxAge
- Maximum age in seconds- Throws:
VerificationException
- if too old
-
verifyIssClaim
Verifies that SD-JWT was issued by one of the provided issuers.- Parameters:
issuers
- List of trusted issuers- Throws:
VerificationException
-
verifyVctClaim
Verifies that SD-JWT vct claim matches the expected one.- Parameters:
vcts
- list of supported verifiable credential types- Throws:
VerificationException
-