Package web5.sdk.vc

Class VerifiableCredential

  • All Implemented Interfaces:

    
    public final class VerifiableCredential
    
                        

    Represents 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.

    • Constructor Detail

    • 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.

      • getId

         final String getId()

        The unique identifier for the Verifiable Credential.

      • getIssuer

         final Issuer getIssuer()

        The entity (either a string or an object) that issued 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.

      • 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.