Package ej.crypto.mock
Class ExternalKeyStore
- java.lang.Object
-
- ej.crypto.mock.ExternalKeyStore
-
public class ExternalKeyStore extends java.lang.ObjectMock implementation of the External Key Store.It relies on a PKCS12 keystore on the host filesystem.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>aliases()voiddeleteEntry(java.lang.String alias)java.security.cert.CertificategetCertificate(java.lang.String alias)java.security.cert.Certificate[]getCertificateChain(java.lang.String alias)static ExternalKeyStoregetInstance()java.security.KeygetKey(java.lang.String alias, char[] password)booleanisCertificateEntry(java.lang.String alias)booleanisKeyEntry(java.lang.String alias)voidlogin(char[] password)voidsetCertificateEntry(java.lang.String alias, java.security.cert.Certificate certificate)voidsetKeyEntry(java.lang.String alias, byte[] key, java.security.cert.Certificate[] chain)voidsetKeyEntry(java.lang.String alias, java.security.Key key, char[] password, java.security.cert.Certificate[] chain)
-
-
-
Method Detail
-
login
public void login(char[] password) throws java.security.NoSuchAlgorithmException, java.security.cert.CertificateException, java.io.IOException- Throws:
java.security.NoSuchAlgorithmExceptionjava.security.cert.CertificateExceptionjava.io.IOException
-
aliases
public java.util.List<java.lang.String> aliases() throws java.security.KeyStoreException- Throws:
java.security.KeyStoreException
-
getKey
public java.security.Key getKey(java.lang.String alias, char[] password) throws java.security.UnrecoverableKeyException, java.security.KeyStoreException, java.security.NoSuchAlgorithmException- Throws:
java.security.UnrecoverableKeyExceptionjava.security.KeyStoreExceptionjava.security.NoSuchAlgorithmException
-
getCertificate
public java.security.cert.Certificate getCertificate(java.lang.String alias) throws java.security.KeyStoreException- Throws:
java.security.KeyStoreException
-
getCertificateChain
public java.security.cert.Certificate[] getCertificateChain(java.lang.String alias) throws java.security.KeyStoreException- Throws:
java.security.KeyStoreException
-
setKeyEntry
public void setKeyEntry(java.lang.String alias, byte[] key, java.security.cert.Certificate[] chain) throws java.security.KeyStoreException- Throws:
java.security.KeyStoreException
-
setKeyEntry
public void setKeyEntry(java.lang.String alias, java.security.Key key, char[] password, java.security.cert.Certificate[] chain) throws java.security.KeyStoreException- Throws:
java.security.KeyStoreException
-
setCertificateEntry
public void setCertificateEntry(java.lang.String alias, java.security.cert.Certificate certificate) throws java.security.KeyStoreException- Throws:
java.security.KeyStoreException
-
deleteEntry
public void deleteEntry(java.lang.String alias) throws java.security.KeyStoreException- Throws:
java.security.KeyStoreException
-
isKeyEntry
public boolean isKeyEntry(java.lang.String alias) throws java.security.KeyStoreException- Throws:
java.security.KeyStoreException
-
isCertificateEntry
public boolean isCertificateEntry(java.lang.String alias) throws java.security.KeyStoreException- Throws:
java.security.KeyStoreException
-
getInstance
public static ExternalKeyStore getInstance() throws java.security.KeyStoreException
- Throws:
java.security.KeyStoreException
-
-