Package de.adorsys.sdjwt
Class SdJws
- java.lang.Object
-
- de.adorsys.sdjwt.SdJws
-
- Direct Known Subclasses:
IssuerSignedJWT,KeyBindingJWT
public abstract class SdJws extends Object
Handle jws, either the issuer jwt or the holder key binding jwt.- Author:
- Francis Pouatcha
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSdJws(com.fasterxml.jackson.databind.JsonNode payload)protectedSdJws(com.fasterxml.jackson.databind.JsonNode payload, com.nimbusds.jose.JWSObject signedJwt)protectedSdJws(com.fasterxml.jackson.databind.JsonNode payload, com.nimbusds.jose.JWSSigner signer, String keyId, com.nimbusds.jose.JWSAlgorithm jwsAlgorithm, String jwsType)protectedSdJws(com.nimbusds.jose.util.Base64URL payloadBase64Url, com.nimbusds.jose.JWSSigner signer, String keyId, com.nimbusds.jose.JWSAlgorithm jwsAlgorithm, String jwsType)protectedSdJws(String jwsString)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.fasterxml.jackson.databind.JsonNodegetHeader()com.fasterxml.jackson.databind.JsonNodegetPayload()StringtoJws()voidverifyExpClaim()voidverifyIssClaim(List<String> issuers)Verifies that SD-JWT was issued by one of the provided issuers.voidverifyIssuedAtClaim()voidverifyNotBeforeClaim()voidverifySignature(com.nimbusds.jose.JWSVerifier verifier)voidverifyVctClaim(List<String> vcts)Verifies that SD-JWT vct claim matches the expected one.
-
-
-
Constructor Detail
-
SdJws
protected SdJws(com.fasterxml.jackson.databind.JsonNode payload)
-
SdJws
protected SdJws(String jwsString)
-
SdJws
protected SdJws(com.fasterxml.jackson.databind.JsonNode payload, com.nimbusds.jose.JWSObject signedJwt)
-
SdJws
protected SdJws(com.fasterxml.jackson.databind.JsonNode payload, com.nimbusds.jose.JWSSigner signer, String keyId, com.nimbusds.jose.JWSAlgorithm jwsAlgorithm, String jwsType)
-
-
Method Detail
-
toJws
public String toJws()
-
getPayload
public com.fasterxml.jackson.databind.JsonNode getPayload()
-
getHeader
public com.fasterxml.jackson.databind.JsonNode getHeader()
-
verifySignature
public void verifySignature(com.nimbusds.jose.JWSVerifier verifier) throws com.nimbusds.jose.JOSEException- Throws:
com.nimbusds.jose.JOSEException
-
verifyIssuedAtClaim
public void verifyIssuedAtClaim() throws SdJwtVerificationException- Throws:
SdJwtVerificationException
-
verifyExpClaim
public void verifyExpClaim() throws SdJwtVerificationException- Throws:
SdJwtVerificationException
-
verifyNotBeforeClaim
public void verifyNotBeforeClaim() throws SdJwtVerificationException- Throws:
SdJwtVerificationException
-
verifyIssClaim
public void verifyIssClaim(List<String> issuers) throws SdJwtVerificationException
Verifies that SD-JWT was issued by one of the provided issuers. Verification is case-insensitive- Parameters:
issuers- List of trusted issuers- Throws:
SdJwtVerificationException
-
verifyVctClaim
public void verifyVctClaim(List<String> vcts) throws SdJwtVerificationException
Verifies that SD-JWT vct claim matches the expected one. Verification is case-insensitive- Parameters:
vcts- list of supported verifiable credential types- Throws:
SdJwtVerificationException
-
-