Class VerifiablePresentation

  • All Implemented Interfaces:

    
    public final class VerifiablePresentation
    
                        

    VerifiablePresentation is a tamper-evident presentation encoded in such a way that authorship of the data can be trusted after a process of cryptographic verification. W3C Verifiable Credentials Data Model.

    It provides functionalities to sign, verify, and create presentations, offering a concise API to work with JWT representations of verifiable presentations and ensuring that the signatures and claims within those JWTs can be validated.

    • Constructor Detail

    • Method Detail

      • getVpDataModel

         final VerifiablePresentation getVpDataModel()

        The vpDataModel instance representing the core data model of a verifiable presentation.

      • sign

        @JvmOverloads() final String sign(BearerDid bearerDid, String assertionMethodId)

        Sign a verifiable presentation using a specified decentralized identifier (bearerDid) with the private key that pairs with the public key identified by assertionMethodId.

        If the assertionMethodId is null, the function will attempt to use the first available verification method from the bearerDid. The result is a String in a JWT format.

        Parameters:
        bearerDid - The BearerDid used to sign the credential.
        assertionMethodId - An optional identifier for the assertion method that will be used for verification of the produced signature.
        Returns:

        The JWT representing the signed verifiable credential.

        Example:

        val signedVp = verifiablePresentation.sign(myDid)
      • sign

        @JvmOverloads() final String sign(BearerDid bearerDid)

        Sign a verifiable presentation using a specified decentralized identifier (bearerDid) with the private key that pairs with the public key identified by assertionMethodId.

        If the assertionMethodId is null, the function will attempt to use the first available verification method from the bearerDid. The result is a String in a JWT format.

        Parameters:
        bearerDid - The BearerDid used to sign the credential.
        Returns:

        The JWT representing the signed verifiable credential.

        Example:

        val signedVp = verifiablePresentation.sign(myDid)
      • toString

         String toString()

        Converts the current object to its JSON representation.

        Returns:

        The JSON representation of the object.