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 createsFileSystemSecurityRealm
instances.- Author:
- Ashpan Raskar
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
encoded
private Charset
hashCharset
private Encoding
hashEncoding
private int
levels
private NameRewriter
nameRewriter
private PrivateKey
privateKey
private Supplier<Provider[]>
providers
private PublicKey
publicKey
private Path
root
private SecretKey
secretKey
-
Constructor Summary
Constructors Constructor Description FileSystemSecurityRealmBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileSystemSecurityRealm
build()
Builds a newFileSystemSecurityRealm
instance based on configuration defined for thisFileSystemSecurityRealmBuilder
instance.FileSystemSecurityRealmBuilder
setEncoded(boolean encoded)
Set whether the identity name should be encoded for the filename in the realm.FileSystemSecurityRealmBuilder
setHashCharset(Charset hashCharset)
Set the character set to be used by the realm.FileSystemSecurityRealmBuilder
setHashEncoding(Encoding hashEncoding)
Set the string format for hashed passwords to be used by the realm.FileSystemSecurityRealmBuilder
setLevels(int levels)
Set the number of levels to be used by the realm.FileSystemSecurityRealmBuilder
setNameRewriter(NameRewriter nameRewriter)
Set the name rewriter to be used by the realm.FileSystemSecurityRealmBuilder
setPrivateKey(PrivateKey privateKey)
Set the PrivateKey to be used by the realm.FileSystemSecurityRealmBuilder
setProviders(Supplier<Provider[]> providers)
Set the providers to be used by the realm.FileSystemSecurityRealmBuilder
setPublicKey(PublicKey publicKey)
Set the PublicKey to be used by the realm.FileSystemSecurityRealmBuilder
setRoot(Path root)
Set the root path to be used by the realm.FileSystemSecurityRealmBuilder
setSecretKey(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 newFileSystemSecurityRealm
instance based on configuration defined for thisFileSystemSecurityRealmBuilder
instance.- Returns:
- the built realm
-
-