Package org.wildfly.security.keystore
Class PasswordKeyStoreSpi
- java.lang.Object
-
- java.security.KeyStoreSpi
-
- org.wildfly.security.keystore.PasswordKeyStoreSpi
-
public final class PasswordKeyStoreSpi extends KeyStoreSpi
A password file formattedKeyStore
implementation.- Author:
- David M. Lloyd
-
-
Field Summary
Fields Modifier and Type Field Description private AtomicReference<HashMap<String,PasswordEntry>>
pwRef
-
Constructor Summary
Constructors Constructor Description PasswordKeyStoreSpi()
-
Method Summary
-
Methods inherited from class java.security.KeyStoreSpi
engineLoad, engineProbe, engineStore
-
-
-
-
Field Detail
-
pwRef
private final AtomicReference<HashMap<String,PasswordEntry>> pwRef
-
-
Method Detail
-
engineGetKey
public Key engineGetKey(String alias, char[] password) throws NoSuchAlgorithmException, UnrecoverableKeyException
- Specified by:
engineGetKey
in classKeyStoreSpi
- Throws:
NoSuchAlgorithmException
UnrecoverableKeyException
-
engineGetEntry
public KeyStore.Entry engineGetEntry(String alias, KeyStore.ProtectionParameter protParam) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableEntryException
- Overrides:
engineGetEntry
in classKeyStoreSpi
- Throws:
KeyStoreException
NoSuchAlgorithmException
UnrecoverableEntryException
-
engineSetEntry
public void engineSetEntry(String alias, KeyStore.Entry entry, KeyStore.ProtectionParameter protParam) throws KeyStoreException
- Overrides:
engineSetEntry
in classKeyStoreSpi
- Throws:
KeyStoreException
-
engineEntryInstanceOf
public boolean engineEntryInstanceOf(String alias, Class<? extends KeyStore.Entry> entryClass)
- Overrides:
engineEntryInstanceOf
in classKeyStoreSpi
-
engineGetCertificateChain
public Certificate[] engineGetCertificateChain(String alias)
- Specified by:
engineGetCertificateChain
in classKeyStoreSpi
-
engineGetCertificate
public Certificate engineGetCertificate(String alias)
- Specified by:
engineGetCertificate
in classKeyStoreSpi
-
engineGetCreationDate
public Date engineGetCreationDate(String alias)
- Specified by:
engineGetCreationDate
in classKeyStoreSpi
-
engineSetKeyEntry
public void engineSetKeyEntry(String alias, Key key, char[] password, Certificate[] chain) throws KeyStoreException
- Specified by:
engineSetKeyEntry
in classKeyStoreSpi
- Throws:
KeyStoreException
-
engineSetKeyEntry
public void engineSetKeyEntry(String alias, byte[] key, Certificate[] chain) throws KeyStoreException
- Specified by:
engineSetKeyEntry
in classKeyStoreSpi
- Throws:
KeyStoreException
-
engineSetCertificateEntry
public void engineSetCertificateEntry(String alias, Certificate cert) throws KeyStoreException
- Specified by:
engineSetCertificateEntry
in classKeyStoreSpi
- Throws:
KeyStoreException
-
engineDeleteEntry
public void engineDeleteEntry(String alias) throws KeyStoreException
- Specified by:
engineDeleteEntry
in classKeyStoreSpi
- Throws:
KeyStoreException
-
engineAliases
public Enumeration<String> engineAliases()
- Specified by:
engineAliases
in classKeyStoreSpi
-
engineContainsAlias
public boolean engineContainsAlias(String alias)
- Specified by:
engineContainsAlias
in classKeyStoreSpi
-
engineSize
public int engineSize()
- Specified by:
engineSize
in classKeyStoreSpi
-
engineIsKeyEntry
public boolean engineIsKeyEntry(String alias)
- Specified by:
engineIsKeyEntry
in classKeyStoreSpi
-
engineIsCertificateEntry
public boolean engineIsCertificateEntry(String alias)
- Specified by:
engineIsCertificateEntry
in classKeyStoreSpi
-
engineGetCertificateAlias
public String engineGetCertificateAlias(Certificate cert)
- Specified by:
engineGetCertificateAlias
in classKeyStoreSpi
-
engineStore
public void engineStore(OutputStream stream, char[] password) throws IOException, NoSuchAlgorithmException, CertificateException
- Specified by:
engineStore
in classKeyStoreSpi
- Throws:
IOException
NoSuchAlgorithmException
CertificateException
-
forceReadCP
private static int forceReadCP(Reader r) throws IOException
- Throws:
IOException
-
readCP
private static int readCP(Reader r) throws IOException
- Throws:
IOException
-
engineLoad
public void engineLoad(InputStream stream, char[] password) throws IOException, NoSuchAlgorithmException, CertificateException
- Specified by:
engineLoad
in classKeyStoreSpi
- Throws:
IOException
NoSuchAlgorithmException
CertificateException
-
-