use of org.platformlayer.service.nexus.utils.NexusLdapPasswords in project platformlayer by platformlayer.
the class NexusBootstrap method encryptNexusPassword.
private String encryptNexusPassword(String ldapPassword) throws OpsException {
NexusLdapPasswords nexusLdapPasswords = new NexusLdapPasswords();
nexusLdapPasswords.addEscapeCharacters = false;
try {
return nexusLdapPasswords.encrypt(ldapPassword);
} catch (Exception e) {
ExceptionUtils.handleInterrupted(e);
throw new OpsException("Error encrypting password", e);
}
}
use of org.platformlayer.service.nexus.utils.NexusLdapPasswords in project platformlayer by platformlayer.
the class NexusLdapPasswordsTest method testDecryption.
@Test
public void testDecryption() throws Exception {
NexusLdapPasswords passwords = new NexusLdapPasswords();
String plaintext = "adminsecret";
String ciphertext = "CIj2qAUHmLHvrlRXsW9Z2dfsGm0=";
assertStructure(ciphertext);
String decrypted = passwords.decrypt(ciphertext);
assertEquals(plaintext, decrypted);
}
use of org.platformlayer.service.nexus.utils.NexusLdapPasswords in project platformlayer by platformlayer.
the class NexusLdapPasswordsTest method testEncryption.
@Test
public void testEncryption() throws Exception {
NexusLdapPasswords passwords = new NexusLdapPasswords();
String plaintext = "adminsecret";
String ciphertext = passwords.encrypt(plaintext);
System.out.println("ciphertext = " + ciphertext);
assertStructure(ciphertext);
String decrypted = passwords.decrypt(ciphertext);
assertEquals(plaintext, decrypted);
}
Aggregations