Examples of encrypt()


Examples of org.apache.juddi.v3.client.cryptor.AES128Cryptor.encrypt()

  public void testAES128Cryptor()
  {
            System.out.println("testAES128Cryptor");
    try {
      Cryptor auth = new AES128Cryptor();
                        String encrypt = auth.encrypt("test");
                        Assert.assertNotNull(encrypt);
                        Assert.assertNotSame(encrypt, "test");
                        String test=auth.decrypt(encrypt);
                        Assert.assertEquals(test, "test");
    } catch (Exception e) {
View Full Code Here

Examples of org.apache.juddi.v3.client.cryptor.AES256Cryptor.encrypt()

  public void testAES256Cryptor()
  {
                System.out.println("testAES256Cryptor");
    try {
      Cryptor auth = new AES256Cryptor();
                        String encrypt = auth.encrypt("test");
                        Assert.assertNotNull(encrypt);
                        Assert.assertNotSame(encrypt, "test");
                        String test=auth.decrypt(encrypt);
                        Assert.assertEquals(test, "test");
                }
View Full Code Here

Examples of org.apache.juddi.v3.client.cryptor.Cryptor.encrypt()

   *
   */
  private String encrypt(String str) throws FatalErrorException {
    try {
      Cryptor cryptor = (Cryptor) CryptorFactory.getCryptor();
      return cryptor.encrypt(str);
    } catch (InvalidKeyException e) {
      logger.error("Invalid Key Exception in crypting the password", e);
      throw new FatalErrorException(new ErrorMessage(
          "errors.auth.cryptor.InvalidKey", e.getMessage()));
    } catch (NoSuchPaddingException e) {
View Full Code Here

Examples of org.apache.juddi.v3.client.cryptor.DefaultCryptor.encrypt()

  public void testDefaultCryptor()
  {
            System.out.println("testDefaultCryptor");
    try {
      Cryptor auth = new DefaultCryptor();
                        String encrypt = auth.encrypt("test");
                        Assert.assertNotNull(encrypt);
                        Assert.assertNotSame(encrypt, "test");
                        String test=auth.decrypt(encrypt);
                        Assert.assertEquals(test, "test");
    } catch (Exception e) {
View Full Code Here

Examples of org.apache.juddi.v3.client.cryptor.TripleDESCrytor.encrypt()

  public void testTripleDESCryptor()
  {
            System.out.println("testTripleDESCryptor");
    try {
      Cryptor auth = new TripleDESCrytor();
                        String encrypt = auth.encrypt("test");
                        Assert.assertNotNull(encrypt);
                        Assert.assertNotSame(encrypt, "test");
                        String test=auth.decrypt(encrypt);
                        Assert.assertEquals(test, "test");
    } catch (Exception e) {
View Full Code Here

Examples of org.apache.openejb.cipher.PasswordCipher.encrypt()

                System.out.println(cipher.decrypt(encryptdPassword));

            } else { // if option neither encrypt/decrypt is specified, we assume
                // it is encrypt.
                final String plainPassword = (String) line.getArgList().get(0);
                System.out.println(new String(cipher.encrypt(plainPassword)));
            }

        } catch (final RuntimeException e) {
            System.out.println("Could not load password cipher implementation class. Check your classpath.");
View Full Code Here

Examples of org.apache.openejb.cipher.PlainTextPasswordCipher.encrypt()

    private static final String PLAIN_PWD = "david";

    public void testPlainCodec() {
        final PasswordCipher cipher = new PlainTextPasswordCipher();
        assertEquals(PLAIN_PWD, new String(cipher.encrypt(PLAIN_PWD)));
        assertEquals(PLAIN_PWD, cipher.decrypt(PLAIN_PWD.toCharArray()));
    }

    public void testStaticDesCodec() {
        final PasswordCipher cipher = new StaticDESPasswordCipher();
View Full Code Here

Examples of org.apache.openejb.cipher.StaticDESPasswordCipher.encrypt()

        assertEquals(PLAIN_PWD, cipher.decrypt(PLAIN_PWD.toCharArray()));
    }

    public void testStaticDesCodec() {
        final PasswordCipher cipher = new StaticDESPasswordCipher();
        final char[] tmp = cipher.encrypt(PLAIN_PWD);
        assertEquals(PLAIN_PWD, cipher.decrypt(tmp));
    }

    public void testGetDataSourcePlugin() throws Exception {
        // all current known plugins
View Full Code Here

Examples of org.apache.openejb.resource.jdbc.PasswordCipher.encrypt()

                System.out.println(cipher.decrypt(encryptdPassword));

            } else { // if option neither encrypt/decrypt is specified, we assume
                     // it is encrypt.
                String plainPassword = (String) line.getArgList().get(0);
                System.out.println(new String(cipher.encrypt(plainPassword)));
            }

        } catch (SQLException e) {
            System.out.println("Could not load password cipher implementation class. Check your classpath.");
View Full Code Here

Examples of org.apache.openejb.resource.jdbc.cipher.PasswordCipher.encrypt()

                System.out.println(cipher.decrypt(encryptdPassword));

            } else { // if option neither encrypt/decrypt is specified, we assume
                     // it is encrypt.
                String plainPassword = (String) line.getArgList().get(0);
                System.out.println(new String(cipher.encrypt(plainPassword)));
            }

        } catch (SQLException e) {
            System.out.println("Could not load password cipher implementation class. Check your classpath.");
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.