public interface PBEConfig
Common interface for config classes applicable to
StandardPBEByteEncryptor
,
StandardPBEStringEncryptor
,
StandardPBEBigIntegerEncryptor
or
StandardPBEBigDecimalEncryptor
objects.
This interface lets the user create new PBEConfig classes which retrieve values for this parameters from different (and maybe more secure) sources (remote servers, LDAP, other databases...), and do this transparently for the encryptor object.
The config objects passed to an encryptor will only be queried once for each configuration parameter, and this will happen during the initialization of the encryptor object.
For a default implementation, see SimplePBEConfig
.
Modifier and Type | Method and Description |
---|---|
String |
getAlgorithm()
Returns the algorithm to be used for encryption, like
PBEWithMD5AndDES.
|
Integer |
getKeyObtentionIterations()
Returns the number of hashing iterations applied to obtain the
encryption key.
|
String |
getPassword()
Returns the password to be used.
|
Integer |
getPoolSize()
Get the size of the pool of encryptors to be created.
|
Provider |
getProvider()
Returns the java.security.Provider implementation object
to be used by the encryptor for obtaining the encryption algorithm.
|
String |
getProviderName()
Returns the name of the java.security.Provider implementation
to be used by the encryptor for obtaining the encryption algorithm.
|
SaltGenerator |
getSaltGenerator()
Returns a
SaltGenerator implementation to be used by the
encryptor. |
String getAlgorithm()
Returns the algorithm to be used for encryption, like PBEWithMD5AndDES.
This algorithm has to be supported by the specified JCE provider (or the default one if no provider has been specified) and, if the provider supports it, you can also specify mode and padding for it, like ALGORITHM/MODE/PADDING.
String getPassword()
Returns the password to be used.
There is no default value for password, so not setting
this parameter either from a
PBEConfig
object or from
a call to setPassword will result in an
EncryptionInitializationException being thrown during initialization.
Integer getKeyObtentionIterations()
Returns the number of hashing iterations applied to obtain the encryption key.
This mechanism is explained in PKCS #5: Password-Based Cryptography Standard.
SaltGenerator getSaltGenerator()
Returns a SaltGenerator
implementation to be used by the
encryptor.
If this method returns null, the encryptor will ignore the config object when deciding the salt generator to be used.
String getProviderName()
Returns the name of the java.security.Provider implementation to be used by the encryptor for obtaining the encryption algorithm. This provider must have been registered beforehand.
If this method returns null, the encryptor will ignore this parameter when deciding the name of the security provider to be used.
If this method does not return null, and neither does getProvider()
,
providerName will be ignored, and the provider object returned
by getProvider() will be used.
Provider getProvider()
Returns the java.security.Provider implementation object to be used by the encryptor for obtaining the encryption algorithm.
If this method returns null, the encryptor will ignore this parameter when deciding the security provider object to be used.
If this method does not return null, and neither does getProviderName()
,
providerName will be ignored, and the provider object returned
by getProvider() will be used.
The provider returned by this method does not need to be registered beforehand, and its use will not result in its being registered.
Integer getPoolSize()
Get the size of the pool of encryptors to be created.
This parameter will be ignored if used with a non-pooled encryptor.
Copyright © 2016 JBoss by Red Hat. All rights reserved.