Interface Wallet.Identity

  • Enclosing interface:
    Wallet

    public static interface Wallet.Identity
    Represents a user's identity that is required to connect to a Fabric network. An instance of identity can be created using the static method createIdentity and subsequently stored and retrieved in a wallet.
    • Method Detail

      • getMspId

        java.lang.String getMspId()
        Get the MSP ID.
        Returns:
        a MSP ID.
      • getCertificate

        java.lang.String getCertificate()
        Get the user's signed certificate.
        Returns:
        a certificate.
      • getPrivateKey

        java.security.PrivateKey getPrivateKey()
        Get the user's private key.
        Returns:
        private key.
      • createIdentity

        static Wallet.Identity createIdentity​(java.lang.String mspId,
                                              java.lang.String certificate,
                                              java.security.PrivateKey privateKey)
        Creates an identity suitable for storing in a Wallet.
        Parameters:
        mspId - The MSPID associated with the identity
        certificate - The public certificate PEM
        privateKey - The private key
        Returns:
        the identity
      • createIdentity

        static Wallet.Identity createIdentity​(java.lang.String mspId,
                                              java.io.Reader certificate,
                                              java.io.Reader privateKey)
                                       throws java.io.IOException
        Creates an identity suitable for storing in a Wallet. The certificate and private key PEMs are supplied using the Reader interface for ease of reading from a file system or other storage mechanism.
        Parameters:
        mspId - The MSPID associated with the identity
        certificate - The public certificate PEM
        privateKey - The private key PEM
        Returns:
        the identity
        Throws:
        java.io.IOException - if an I/O error occurs accessing credentials.