Package org.wildfly.security.keystore
Class LdapKeyStoreSpi
- java.lang.Object
-
- java.security.KeyStoreSpi
-
- org.wildfly.security.keystore.LdapKeyStoreSpi
-
class LdapKeyStoreSpi extends KeyStoreSpi
A LDAP backedKeyStore
implementation.- Author:
- Jan Kalina
-
-
Field Summary
Fields Modifier and Type Field Description private String
aliasAttribute
private Object
binaryAttributesBackup
private String
certificateAttribute
private String
certificateChainAttribute
private String
certificateChainEncoding
private String
certificateType
private String
CREATE_TIMESTAMP_ATTRIBUTE
private Attributes
createAttributes
private LdapName
createPath
private String
createRdn
private org.wildfly.common.function.ExceptionSupplier<DirContext,NamingException>
dirContextSupplier
private String
ENV_BINARY_ATTRIBUTES
private String
filterAlias
private String
filterCertificate
private String
filterIterate
private String
keyAttribute
private String
keyType
private String
MODIFY_TIMESTAMP_ATTRIBUTE
private String
searchPath
private int
searchScope
private int
searchTimeLimit
-
Constructor Summary
Constructors Constructor Description LdapKeyStoreSpi(org.wildfly.common.function.ExceptionSupplier<DirContext,NamingException> dirContextSupplier, String searchPath, int searchScope, int searchTimeLimit, String filterAlias, String filterCertificate, String filterIterate, LdapName createPath, String createRdn, Attributes createAttributes, String aliasAttribute, String certificateAttribute, String certificateType, String certificateChainAttribute, String certificateChainEncoding, String keyAttribute, String keyType)
-
Method Summary
-
Methods inherited from class java.security.KeyStoreSpi
engineEntryInstanceOf, engineGetEntry, engineLoad, engineProbe, engineSetEntry, engineStore
-
-
-
-
Field Detail
-
ENV_BINARY_ATTRIBUTES
private final String ENV_BINARY_ATTRIBUTES
- See Also:
- Constant Field Values
-
CREATE_TIMESTAMP_ATTRIBUTE
private final String CREATE_TIMESTAMP_ATTRIBUTE
- See Also:
- Constant Field Values
-
MODIFY_TIMESTAMP_ATTRIBUTE
private final String MODIFY_TIMESTAMP_ATTRIBUTE
- See Also:
- Constant Field Values
-
dirContextSupplier
private final org.wildfly.common.function.ExceptionSupplier<DirContext,NamingException> dirContextSupplier
-
searchPath
private final String searchPath
-
searchScope
private final int searchScope
-
searchTimeLimit
private final int searchTimeLimit
-
filterAlias
private final String filterAlias
-
filterCertificate
private final String filterCertificate
-
filterIterate
private final String filterIterate
-
createPath
private final LdapName createPath
-
createRdn
private final String createRdn
-
createAttributes
private final Attributes createAttributes
-
aliasAttribute
private final String aliasAttribute
-
certificateAttribute
private final String certificateAttribute
-
certificateType
private final String certificateType
-
certificateChainAttribute
private final String certificateChainAttribute
-
certificateChainEncoding
private final String certificateChainEncoding
-
keyAttribute
private final String keyAttribute
-
keyType
private final String keyType
-
binaryAttributesBackup
private Object binaryAttributesBackup
-
-
Constructor Detail
-
LdapKeyStoreSpi
LdapKeyStoreSpi(org.wildfly.common.function.ExceptionSupplier<DirContext,NamingException> dirContextSupplier, String searchPath, int searchScope, int searchTimeLimit, String filterAlias, String filterCertificate, String filterIterate, LdapName createPath, String createRdn, Attributes createAttributes, String aliasAttribute, String certificateAttribute, String certificateType, String certificateChainAttribute, String certificateChainEncoding, String keyAttribute, String keyType)
-
-
Method Detail
-
obtainDirContext
private DirContext obtainDirContext()
-
returnDirContext
private void returnDirContext(DirContext context)
-
createSearchControl
private SearchControls createSearchControl(String[] returningAttributes)
-
searchAlias
private SearchResult searchAlias(DirContext dirContext, String alias, byte[] cert, String[] returningAttributes) throws NamingException
- Throws:
NamingException
-
obtainAliasOrCertificateAttributes
private Attributes obtainAliasOrCertificateAttributes(String alias, byte[] cert, String[] attributes)
-
engineGetCertificate
public Certificate engineGetCertificate(String alias)
- Specified by:
engineGetCertificate
in classKeyStoreSpi
-
engineGetCertificateChain
public Certificate[] engineGetCertificateChain(String alias)
- Specified by:
engineGetCertificateChain
in classKeyStoreSpi
-
engineGetKey
public Key engineGetKey(String alias, char[] password) throws NoSuchAlgorithmException, UnrecoverableKeyException
- Specified by:
engineGetKey
in classKeyStoreSpi
- Throws:
NoSuchAlgorithmException
UnrecoverableKeyException
-
engineGetCreationDate
public Date engineGetCreationDate(String alias)
- Specified by:
engineGetCreationDate
in classKeyStoreSpi
-
storeAttributes
private void storeAttributes(String alias, List<ModificationItem> items) throws KeyStoreException
- Throws:
KeyStoreException
-
engineSetCertificateEntry
public void engineSetCertificateEntry(String alias, Certificate cert) throws KeyStoreException
- Specified by:
engineSetCertificateEntry
in classKeyStoreSpi
- Throws:
KeyStoreException
-
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[] keystoreBytes, Certificate[] chain) throws KeyStoreException
- Specified by:
engineSetKeyEntry
in classKeyStoreSpi
- Throws:
KeyStoreException
-
engineDeleteEntry
public void engineDeleteEntry(String alias) throws KeyStoreException
- Specified by:
engineDeleteEntry
in classKeyStoreSpi
- Throws:
KeyStoreException
-
engineContainsAlias
public boolean engineContainsAlias(String alias)
- Specified by:
engineContainsAlias
in classKeyStoreSpi
-
engineAliases
public Enumeration<String> engineAliases()
- Specified by:
engineAliases
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
-
engineLoad
public void engineLoad(InputStream stream, char[] password) throws IOException, NoSuchAlgorithmException, CertificateException
- Specified by:
engineLoad
in classKeyStoreSpi
- Throws:
IOException
NoSuchAlgorithmException
CertificateException
-
engineStore
public void engineStore(OutputStream stream, char[] password) throws IOException, NoSuchAlgorithmException, CertificateException
- Specified by:
engineStore
in classKeyStoreSpi
- Throws:
IOException
NoSuchAlgorithmException
CertificateException
-
-