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
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSdJws(com.fasterxml.jackson.databind.JsonNode payload) protectedSdJws(com.fasterxml.jackson.databind.JsonNode payload, SignatureSignerContext signer, String jwsType) protectedprotected -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.databind.JsonNodeprotected static JWSInputsign(com.fasterxml.jackson.databind.JsonNode payload, SignatureSignerContext signer, String jwsType) toJws()voidverifyAge(int maxAge) Verifies that the JWS is not too old.voidvoidverifyIssClaim(List<String> issuers) Verifies that SD-JWT was issued by one of the provided issuers.voidvoidvoidverifySignature(SignatureVerifierContext verifier) voidverifyVctClaim(List<String> vcts) Verifies that SD-JWT vct claim matches the expected one.
-
Field Details
-
CLAIM_NAME_ISSUER
- See Also:
-
-
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
-