Package com.adaptris.security.password
Class Password
java.lang.Object
com.adaptris.security.password.Password
Handles simple encryption and decryption of passwords that may be stored in XML configuration.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Password obfuscation using Microsoft Crypto API which is only available on windows.static final String
Standard password style which is portable across environments.static final String
Standard password style which is portable across environments.static final String
Alternative password style which is portable across environments and machines if the seed file is present. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic PasswordCodec
Create a password implementation of the specified type.protected abstract PasswordCodec
createCodec
(String type) static String
Convenience method to decrypt a password.static String
Convenience method to encode a password.static void
-
Field Details
-
MSCAPI_STYLE
Password obfuscation using Microsoft Crypto API which is only available on windows.Use of this means that the password is encrypted with the current username's private key and certificate.
- See Also:
-
PORTABLE_PASSWORD
Standard password style which is portable across environments.It is not considered especially secure, but is enough to stop casual interrogation
- See Also:
-
PORTABLE_PASSWORD_2
Standard password style which is portable across environments.It uses the Advanced Encryption Standard (AES) algorithm in Galois/Counter Mode (GCM) to perform the encryption. GCM has the benefit of providing authenticity (integrity) in addition to confidentiality.
- See Also:
-
SEEDED_BATCH
Alternative password style which is portable across environments and machines if the seed file is present. Uses a similar password based encryption scheme to the deprecated/removed non-portable PBEWithSHA1AndDESede. This uses the more up-to-date and secure PBEWithHmacSHA256AndAES_128.- See Also:
-
-
Constructor Details
-
Password
public Password()
-
-
Method Details
-
create
Create a password implementation of the specified type.- Parameters:
type
- the type- Returns:
- the password implementation
- Throws:
PasswordException
- wrapping other exceptions.- See Also:
-
createCodec
- Throws:
PasswordException
-
decode
Convenience method to decrypt a password.- Parameters:
encoded
- the encrypted password- Returns:
- the decrypted password
- Throws:
PasswordException
-
encode
Convenience method to encode a password.- Parameters:
plain
- the plain passwordtype
- the type of encryption to use.- Returns:
- the encoded password
- Throws:
PasswordException
- See Also:
-
main
- Throws:
Exception
-