Class VerifiableCredential
-
- All Implemented Interfaces:
public final class VerifiableCredentialRepresents a Verifiable Credential according to the W3C Verifiable Credentials Data Model v1.1 and conformant to the Web5 specification. A Verifiable Credential is a tamper-evident credential that has authorship that can be cryptographically verified.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classVerifiableCredential.Companion
-
Field Summary
Fields Modifier and Type Field Description private final List<String>contextprivate final List<String>typeprivate final Stringidprivate final Issuerissuerprivate final CredentialSubjectcredentialSubjectprivate final DateissuanceDateprivate final DateexpirationDateprivate final CredentialStatuscredentialStatusprivate final CredentialSchemacredentialSchemaprivate final List<Map<String, Object>>evidencepublic final static VerifiableCredential.CompanionCompanion
-
Method Summary
Modifier and Type Method Description final List<String>getContext()A list of contexts used to define the semantic meaning of the data contained in the Verifiable Credential. final List<String>getType()The type(s) of the Verifiable Credential. final StringgetId()The unique identifier for the Verifiable Credential. final IssuergetIssuer()The entity (either a string or an object) that issued the credential. final CredentialSubjectgetCredentialSubject()The subject of the credential, containing claims about the entity described by the credential. final DategetIssuanceDate()The date and time when the credential was issued. final DategetExpirationDate()The optional expiration date after which the credential is no longer valid. final CredentialStatusgetCredentialStatus()The credential status information, if applicable (e.g., revoked or suspended). final CredentialSchemagetCredentialSchema()The schema used to validate the data structure of the credential. final List<Map<String, Object>>getEvidence()An array of evidence supporting the claims made in the credential. final Stringsign(BearerDid bearerDid, String verificationMethodId)Signs the Verifiable Credential using the specified Bearer DID and optional verification method. -
-
Method Detail
-
getContext
final List<String> getContext()
A list of contexts used to define the semantic meaning of the data contained in the Verifiable Credential.
-
getIssuer
final Issuer getIssuer()
The entity (either a string or an object) that issued the credential.
-
getCredentialSubject
final CredentialSubject getCredentialSubject()
The subject of the credential, containing claims about the entity described by the credential.
-
getIssuanceDate
final Date getIssuanceDate()
The date and time when the credential was issued.
-
getExpirationDate
final Date getExpirationDate()
The optional expiration date after which the credential is no longer valid.
-
getCredentialStatus
final CredentialStatus getCredentialStatus()
The credential status information, if applicable (e.g., revoked or suspended).
-
getCredentialSchema
final CredentialSchema getCredentialSchema()
The schema used to validate the data structure of the credential.
-
getEvidence
final List<Map<String, Object>> getEvidence()
An array of evidence supporting the claims made in the credential.
-
sign
final String sign(BearerDid bearerDid, String verificationMethodId)
Signs the Verifiable Credential using the specified Bearer DID and optional verification method.
- Parameters:
bearerDid- The DID used to sign the credential.verificationMethodId- Optional identifier of the Verification Method for which to sign with.- Returns:
A string representing the signed JWT, serialized as a compact JWS, of the Verifiable Credential.
-
-
-
-