Package org.platformlayer.service.nexus.utils

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


    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

    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

Related Classes of org.platformlayer.service.nexus.utils.NexusLdapPasswords

Copyright © 2018 www.massapicom. 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.