Package org.wildfly.security.keystore
Class LdapKeyStore.Builder
java.lang.Object
org.wildfly.security.keystore.LdapKeyStore.Builder
- Enclosing class:
- LdapKeyStore
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build a LDAP keystore.setAliasAttribute(String aliasAttribute) Set the name of the attribute in LDAP that holds the alias of keystore item.setCertificateAttribute(String certificateAttribute) Set the name of the attribute in LDAP that holds the encoded certificate.setCertificateChainAttribute(String certificateChainAttribute) Set the name of the attribute in LDAP that holds the encoded certificate chain.setCertificateChainEncoding(String certificateChainEncoding) Set the encoding of certificate chain, which is stored in certificateChainAttribute.setCertificateType(String certificateType) Set the type of certificate, which is stored in certificateAttribute and certificateChainAttribute.setCreateAttributes(Attributes createAttributes) Set the attributes of newly created LDAP entries and their values.setCreatePath(LdapName createPath) Set the name of the context (DN, distinguish name), where will be LDAP entries of new keystore items created.setCreateRdn(String createRdn) Set the name of the attribute in LDAP, that will be used as RDN - last part of path of new entries.setDirContextSupplier(ExceptionSupplier<DirContext, NamingException> dirContextSupplier) Set theDirContextsupplier, which will be used to obtain DirContext to perform operation overKeyStore.setFilterAlias(String filterAlias) Set the LDAP filter used to search keystore item by alias.setFilterCertificate(String filterCertificate) Set the LDAP filter used to search keystore item by certificate.setFilterIterate(String filterIterate) Set the LDAP filter used to search all keystore items.setKeyAttribute(String keyAttribute) Set the name of the attribute in LDAP that holds the private key.setKeyType(String keyType) Set type of keystores, into which is encased every private key before storing into keyAttribute.setSearchPath(String searchPath) Set the name of the context (DN, distinguish name) to be used when executing queries.setSearchRecursive(boolean recursive) Set if queries are searching the entire subtree (true) or only one level search is used (false).setSearchScope(int searchScope) Set if queries are searching the entire subtree (true) or only one level search is used (false).setSearchTimeLimit(int searchTimeLimit) Set the time limit of LDAP search in milliseconds.
-
Method Details
-
build
Build a LDAP keystore.- Returns:
- the LDAP keystore
-
setDirContextSupplier
public LdapKeyStore.Builder setDirContextSupplier(ExceptionSupplier<DirContext, NamingException> dirContextSupplier) Set theDirContextsupplier, which will be used to obtain DirContext to perform operation overKeyStore.- Parameters:
dirContextSupplier-- Returns:
- this builder
-
setSearchPath
Set the name of the context (DN, distinguish name) to be used when executing queries.- Parameters:
searchPath- the name of the context to search- Returns:
- this builder
-
setSearchScope
Set if queries are searching the entire subtree (true) or only one level search is used (false). Default value: SUBTREE_SCOPE- Returns:
- this builder
-
setSearchRecursive
Set if queries are searching the entire subtree (true) or only one level search is used (false). Default value: true- Returns:
- this builder
-
setSearchTimeLimit
Set the time limit of LDAP search in milliseconds.- Parameters:
searchTimeLimit- the limit in milliseconds. Defaults to 10000 milliseconds.- Returns:
- this builder
-
setFilterAlias
Set the LDAP filter used to search keystore item by alias. If not specified "(alias-attribute={0})" is used.- Parameters:
filterAlias- the LDAP filter, substring "{0}" will by replaced by searched alias- Returns:
- this builder
-
setFilterCertificate
Set the LDAP filter used to search keystore item by certificate. If not specified "(certificate-attribute={0})" is used.- Parameters:
filterCertificate- the LDAP filter, substring "{0}" will by replaced by encoded searched certificate- Returns:
- this builder
-
setFilterIterate
Set the LDAP filter used to search all keystore items. If not specified "(alias-attribute=*)" is used.- Parameters:
filterIterate- the LDAP filter- Returns:
- this builder
-
setCreatePath
Set the name of the context (DN, distinguish name), where will be LDAP entries of new keystore items created.- Parameters:
createPath- the name of the context, where to create- Returns:
- this builder
-
setCreateRdn
Set the name of the attribute in LDAP, that will be used as RDN - last part of path of new entries. This attribute can be different from aliasAttribute, but its value will be alias too for newly created entries.- Parameters:
createRdn- the name of attribute which will be used as RDN- Returns:
- this builder
-
setCreateAttributes
Set the attributes of newly created LDAP entries and their values.- Parameters:
createAttributes- the attributes and their initial values- Returns:
- this builder
-
setAliasAttribute
Set the name of the attribute in LDAP that holds the alias of keystore item.- Parameters:
aliasAttribute- the name of attribute that holds the alias- Returns:
- this builder
-
setCertificateAttribute
Set the name of the attribute in LDAP that holds the encoded certificate.- Parameters:
certificateAttribute- the name of attribute that holds the encoded certificate- Returns:
- this builder
-
setCertificateType
Set the type of certificate, which is stored in certificateAttribute and certificateChainAttribute. This type is used for decoding certificate and certificate chain from LDAP attribute value.- Parameters:
certificateType- the name of attribute that holds the encoded certificate- Returns:
- this builder
- See Also:
-
setCertificateChainAttribute
Set the name of the attribute in LDAP that holds the encoded certificate chain.- Parameters:
certificateChainAttribute- the name of attribute that holds the encoded certificate chain- Returns:
- this builder
-
setCertificateChainEncoding
Set the encoding of certificate chain, which is stored in certificateChainAttribute. This encoding is used for encoding certificate chain into the LDAP attribute value.- Parameters:
certificateChainEncoding- the name of the encoding to use- Returns:
- this builder
- See Also:
-
setKeyAttribute
Set the name of the attribute in LDAP that holds the private key. Private key is stored encased in KeyStore, encrypted by password of keystore item.- Parameters:
keyAttribute- the name of attribute that holds the private key- Returns:
- this builder
-
setKeyType
Set type of keystores, into which is encased every private key before storing into keyAttribute.- Parameters:
keyType- the type of keystore- Returns:
- this builder
- See Also:
-