@ApiAudience.Public @ApiStability.Unstable public class JavaKeyStore extends java.lang.Object implements KeyStore
Modifier and Type | Field and Description |
---|---|
protected java.security.Provider |
bcProvider |
protected java.security.KeyStore |
delegate |
protected org.slf4j.Logger |
logger |
Constructor and Description |
---|
JavaKeyStore(java.security.KeyStore delegate)
Create a keystore which uses
KeyStore . |
JavaKeyStore(java.lang.String type)
Create a keystore which uses
KeyStore . |
JavaKeyStore(java.lang.String type,
java.io.InputStream inputStream,
char[] password)
Create a keystore which uses
KeyStore . |
JavaKeyStore(java.lang.String type,
java.security.Provider provider)
Create a keystore which uses
KeyStore . |
JavaKeyStore(java.lang.String type,
java.security.Provider provider,
java.io.InputStream inputStream,
char[] password)
Create a keystore which uses
KeyStore . |
Modifier and Type | Method and Description |
---|---|
protected AergoKey |
convertPrivateKey(java.security.Key privateKey) |
EncryptedPrivateKey |
export(Authentication authentication,
java.lang.String password)
Export an private key encrypted.
|
protected java.security.cert.Certificate |
generateCertificate(AergoKey key) |
protected boolean |
isExists(Authentication authentication) |
java.util.List<Identity> |
listIdentities()
Get all the stored identities.
|
Signer |
load(Authentication authentication)
Load signer with
authentication . |
protected java.security.Key |
loadRawKey(Authentication authentication) |
void |
remove(Authentication authentication)
Remove an
AergoKey corresponding to authentication . |
void |
save(Authentication authentication,
AergoKey key)
Store an
AergoKey to the keystore. |
void |
store(java.lang.String path,
char[] password)
Store keystore to the
path with password . |
protected final org.slf4j.Logger logger
protected final java.security.Provider bcProvider
protected volatile java.security.KeyStore delegate
public JavaKeyStore(java.security.KeyStore delegate)
KeyStore
.delegate
- a java keystoreKeyStoreException
- on keystore errorpublic JavaKeyStore(java.lang.String type)
KeyStore
.type
- a keystore type see KeyStore.getInstance(String)
KeyStoreException
- on keystore errorpublic JavaKeyStore(java.lang.String type, java.security.Provider provider)
KeyStore
.type
- a keystore type see
KeyStore.getInstance(String, java.security.Provider)
provider
- a keystore providerKeyStoreException
- on keystore errorpublic JavaKeyStore(java.lang.String type, java.io.InputStream inputStream, char[] password)
KeyStore
.type
- a keystore type see KeyStore.getInstance(String)
inputStream
- an input stream for keystorepassword
- a keystore passwordKeyStoreException
- on keystore errorpublic JavaKeyStore(java.lang.String type, java.security.Provider provider, java.io.InputStream inputStream, char[] password)
KeyStore
.type
- a keystore type see
KeyStore.getInstance(String, java.security.Provider)
provider
- a keystore providerinputStream
- an input stream for keystorepassword
- a keystore passwordKeyStoreException
- on keystore errorpublic void save(Authentication authentication, AergoKey key)
KeyStore
AergoKey
to the keystore.protected java.security.cert.Certificate generateCertificate(AergoKey key) throws org.bouncycastle.operator.OperatorCreationException, java.security.cert.CertificateException
org.bouncycastle.operator.OperatorCreationException
java.security.cert.CertificateException
public Signer load(Authentication authentication)
KeyStore
authentication
.public void remove(Authentication authentication)
KeyStore
AergoKey
corresponding to authentication
.public EncryptedPrivateKey export(Authentication authentication, java.lang.String password)
KeyStore
public java.util.List<Identity> listIdentities()
KeyStore
listIdentities
in interface KeyStore
public void store(java.lang.String path, char[] password)
KeyStore
path
with password
.protected boolean isExists(Authentication authentication) throws java.security.KeyStoreException, java.security.NoSuchAlgorithmException
java.security.KeyStoreException
java.security.NoSuchAlgorithmException
protected java.security.Key loadRawKey(Authentication authentication) throws java.security.UnrecoverableKeyException, java.security.KeyStoreException, java.security.NoSuchAlgorithmException
java.security.UnrecoverableKeyException
java.security.KeyStoreException
java.security.NoSuchAlgorithmException
protected AergoKey convertPrivateKey(java.security.Key privateKey) throws java.lang.Exception
java.lang.Exception