Package org.wildfly.security.auth.realm
Class FileSystemSecurityRealmBuilder
- java.lang.Object
-
- org.wildfly.security.auth.realm.FileSystemSecurityRealmBuilder
-
public class FileSystemSecurityRealmBuilder extends Object
A builder class that createsFileSystemSecurityRealminstances.- Author:
- Ashpan Raskar
-
-
Field Summary
Fields Modifier and Type Field Description private booleanencodedprivate CharsethashCharsetprivate EncodinghashEncodingprivate intlevelsprivate NameRewriternameRewriterprivate PrivateKeyprivateKeyprivate Supplier<Provider[]>providersprivate PublicKeypublicKeyprivate Pathrootprivate SecretKeysecretKey
-
Constructor Summary
Constructors Constructor Description FileSystemSecurityRealmBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileSystemSecurityRealmbuild()Builds a newFileSystemSecurityRealminstance based on configuration defined for thisFileSystemSecurityRealmBuilderinstance.FileSystemSecurityRealmBuildersetEncoded(boolean encoded)Set whether the identity name should be encoded for the filename in the realm.FileSystemSecurityRealmBuildersetHashCharset(Charset hashCharset)Set the character set to be used by the realm.FileSystemSecurityRealmBuildersetHashEncoding(Encoding hashEncoding)Set the string format for hashed passwords to be used by the realm.FileSystemSecurityRealmBuildersetLevels(int levels)Set the number of levels to be used by the realm.FileSystemSecurityRealmBuildersetNameRewriter(NameRewriter nameRewriter)Set the name rewriter to be used by the realm.FileSystemSecurityRealmBuildersetPrivateKey(PrivateKey privateKey)Set the PrivateKey to be used by the realm.FileSystemSecurityRealmBuildersetProviders(Supplier<Provider[]> providers)Set the providers to be used by the realm.FileSystemSecurityRealmBuildersetPublicKey(PublicKey publicKey)Set the PublicKey to be used by the realm.FileSystemSecurityRealmBuildersetRoot(Path root)Set the root path to be used by the realm.FileSystemSecurityRealmBuildersetSecretKey(SecretKey secretKey)Set the SecretKey to be used by the realm.
-
-
-
Field Detail
-
root
private Path root
-
nameRewriter
private NameRewriter nameRewriter
-
levels
private int levels
-
encoded
private boolean encoded
-
hashCharset
private Charset hashCharset
-
hashEncoding
private Encoding hashEncoding
-
secretKey
private SecretKey secretKey
-
privateKey
private PrivateKey privateKey
-
publicKey
private PublicKey publicKey
-
-
Method Detail
-
setRoot
public FileSystemSecurityRealmBuilder setRoot(Path root)
Set the root path to be used by the realm.- Parameters:
root- the root path of the identity store (must not benull)- Returns:
- this builder.enc
-
setNameRewriter
public FileSystemSecurityRealmBuilder setNameRewriter(NameRewriter nameRewriter)
Set the name rewriter to be used by the realm.- Parameters:
nameRewriter- the name rewriter to apply to looked up names (must not benull)- Returns:
- this builder.
-
setLevels
public FileSystemSecurityRealmBuilder setLevels(int levels)
Set the number of levels to be used by the realm.- Parameters:
levels- the number of levels of directory hashing to apply- Returns:
- this builder.
-
setEncoded
public FileSystemSecurityRealmBuilder setEncoded(boolean encoded)
Set whether the identity name should be encoded for the filename in the realm.- Parameters:
encoded- whether identity names should be BASE32 encoded before using as filename (only applies if the security realm is unencrypted)- Returns:
- this builder.
-
setHashCharset
public FileSystemSecurityRealmBuilder setHashCharset(Charset hashCharset)
Set the character set to be used by the realm.- Parameters:
hashCharset- the character set to use when converting password strings to a byte array. Uses UTF-8 by default. (must not benull)- Returns:
- this builder.
-
setHashEncoding
public FileSystemSecurityRealmBuilder setHashEncoding(Encoding hashEncoding)
Set the string format for hashed passwords to be used by the realm.- Parameters:
hashEncoding- the string format for the hashed passwords. Uses Base64 by default. (must not benull)- Returns:
- this builder.
-
setSecretKey
public FileSystemSecurityRealmBuilder setSecretKey(SecretKey secretKey)
Set the SecretKey to be used by the realm.- Parameters:
secretKey- the symmetric SecretKey used to encrypt and decrypt the Security Realm (must not benull)- Returns:
- this builder.
-
setProviders
public FileSystemSecurityRealmBuilder setProviders(Supplier<Provider[]> providers)
Set the providers to be used by the realm.- Parameters:
providers- the provider to be used (must not benull)- Returns:
- this builder.
-
setPrivateKey
public FileSystemSecurityRealmBuilder setPrivateKey(PrivateKey privateKey)
Set the PrivateKey to be used by the realm.- Parameters:
privateKey- the asymmetric PrivateKey used to sign the identity files used for file integrity (must not benull)- Returns:
- this builder.
-
setPublicKey
public FileSystemSecurityRealmBuilder setPublicKey(PublicKey publicKey)
Set the PublicKey to be used by the realm.- Parameters:
publicKey- the asymmetric PublicKey used to verify the identity files used for file integrity (must not benull)- Returns:
- this builder.
-
build
public FileSystemSecurityRealm build()
Builds a newFileSystemSecurityRealminstance based on configuration defined for thisFileSystemSecurityRealmBuilderinstance.- Returns:
- the built realm
-
-