Package org.hyperledger.fabric.gateway
Interface Wallet
-
public interface Wallet
A wallet stores identity information used to connect to a Hyperledger Fabric network. Instances are created using factory methods onWallets
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Identity
get(java.lang.String label)
Get an identity from the wallet.java.util.Set<java.lang.String>
list()
Get the labels of all identities in the wallet.void
put(java.lang.String label, Identity identity)
Put an identity into the wallet.void
remove(java.lang.String label)
Remove an identity from the wallet.
-
-
-
Method Detail
-
put
void put(java.lang.String label, Identity identity) throws java.io.IOException
Put an identity into the wallet.- Parameters:
label
- Label used to identify the identity within the wallet.identity
- Identity to store in the wallet.- Throws:
java.io.IOException
- if an error occurs accessing the backing store.
-
get
Identity get(java.lang.String label) throws java.io.IOException
Get an identity from the wallet. The implementation class of the identity object will vary depending on its type.- Parameters:
label
- Label used to identify the identity within the wallet.- Returns:
- An identity if it exists; otherwise null.
- Throws:
java.io.IOException
- if an error occurs accessing the backing store.
-
list
java.util.Set<java.lang.String> list() throws java.io.IOException
Get the labels of all identities in the wallet.- Returns:
- Identity labels.
- Throws:
java.io.IOException
- if an error occurs accessing the backing store.
-
remove
void remove(java.lang.String label) throws java.io.IOException
Remove an identity from the wallet. If the identity does not exist, this method does nothing.- Parameters:
label
- Label used to identify the identity within the wallet.- Throws:
java.io.IOException
- if an error occurs accessing the backing store.
-
-