Examples of NexusLdapPasswords


Examples of org.platformlayer.service.nexus.utils.NexusLdapPasswords

public class NexusLdapPasswordsTest {

  @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);
  }
View Full Code Here

Examples of org.platformlayer.service.nexus.utils.NexusLdapPasswords

    assertEquals(8, res[0]);
  }

  @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);
  }
View Full Code Here

Examples of org.platformlayer.service.nexus.utils.NexusLdapPasswords

    target.chown(sonatypeDir, "jetty", "jetty", true, false);
  }

  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);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.