Package org.netxms.base
Class EncryptedPassword
java.lang.Object
org.netxms.base.EncryptedPassword
Utility class to encrypt and decrypt passwords in same way as nxcencpasswd do.
 Please note that this functionality does not provide any protection for the passwords -
 it's only allows to store passwords in configuration files in a not-immediately-readable form,
 as required by some security standards.
- 
Constructor SummaryConstructors
- 
Method Summary
- 
Constructor Details- 
EncryptedPasswordpublic EncryptedPassword()
 
- 
- 
Method Details- 
encryptpublic static String encrypt(String login, String password) throws NoSuchAlgorithmException, UnsupportedEncodingException Encrypt password for given login.- Parameters:
- login- login name
- password- plain text password
- Returns:
- password obfuscated wiht ICE algorithm
- Throws:
- NoSuchAlgorithmException- if any of required encryption algorithms are not available
- UnsupportedEncodingException- if UTF-8 encoding is not supported
 
- 
decryptpublic static String decrypt(String login, String password) throws NoSuchAlgorithmException, IllegalArgumentException, IOException - Parameters:
- login- login name
- password- ICE-obfuscated password
- Returns:
- clear-text password
- Throws:
- NoSuchAlgorithmException- if any of required encryption algorithms are not available
- IOException- if I/O error occurs
- IllegalArgumentException
 
 
-