Package com.wesabe.grendel.openpgp

Examples of com.wesabe.grendel.openpgp.KeySet.unlock()


    @Test
    public void itCanRelockTheKeySetWithADifferentPassphrase() throws Exception {
      final KeySet newKeySet = unlockedKeySet.relock("test".toCharArray(), "yay".toCharArray(), new SecureRandom());
     
      try {
        newKeySet.unlock("test".toCharArray());
        fail("should have thrown a CryptographicException but didn't");
      } catch (CryptographicException e) {
        assertThat(e.getMessage()).isEqualTo("incorrect passphrase");
      }
     
View Full Code Here


      } catch (CryptographicException e) {
        assertThat(e.getMessage()).isEqualTo("incorrect passphrase");
      }
     
      try {
        newKeySet.unlock("yay".toCharArray());
      } catch (CryptographicException e) {
        e.printStackTrace();
        fail("should not have thrown a CryptographicException but did");
      }
     
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.