Package org.hyperledger.fabric.gateway
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 methodcreateIdentity
and subsequently stored and retrieved in a wallet.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static Wallet.Identity
createIdentity(java.lang.String mspId, java.io.Reader certificate, java.io.Reader privateKey)
Creates an identity suitable for storing in a Wallet.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.java.lang.String
getCertificate()
Get the user's signed certificate.java.lang.String
getMspId()
Get the MSP ID.java.security.PrivateKey
getPrivateKey()
Get the user's private key.
-
-
-
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 identitycertificate
- The public certificate PEMprivateKey
- 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 theReader
interface for ease of reading from a file system or other storage mechanism.- Parameters:
mspId
- The MSPID associated with the identitycertificate
- The public certificate PEMprivateKey
- The private key PEM- Returns:
- the identity
- Throws:
java.io.IOException
- if an I/O error occurs accessing credentials.
-
-