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");
}