Package com.wesabe.grendel.openpgp

Examples of com.wesabe.grendel.openpgp.KeySet


      assertThat(unlockedKeySet.getUnlockedSubKey().getKeyID()).isEqualTo(0xA3A5D038FF30574EL);
    }
   
    @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");
      }
     
      try {
        newKeySet.unlock("yay".toCharArray());
      } catch (CryptographicException e) {
        e.printStackTrace();
        fail("should not have thrown a CryptographicException but did");
      }
     
View Full Code Here


      final ValidationException e = new ValidationException();
      e.addReason("username is already taken");
      throw e;
    }

    final KeySet keySet = generator.generate(request.getId(), request.getPassword());
    final User user = userDAO.saveOrUpdate(new User(keySet));
   
    request.sanitize();
   
    return Response.created(
View Full Code Here

TOP

Related Classes of com.wesabe.grendel.openpgp.KeySet

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.