use of co.krypt.krypton.pgp.publickey.CertifiedPublicKey in project krypton-android by kryptco.
the class PGPublicKeySelfCertificationTest method keySigning_succeeds.
@Test
public void keySigning_succeeds() throws Exception {
for (KeyType keyType : new KeyType[] { KeyType.RSA, KeyType.Ed25519 }) {
SSHKeyPairI kp1 = KeyManager.loadOrGenerateKeyPair(InstrumentationRegistry.getTargetContext(), keyType, "test");
PGPPublicKey pubkey = new PGPPublicKey(kp1, Collections.singletonList(new UserID("Kevin King", "kevin@krypt.co")));
CertifiedPublicKey parsedPubkey = CertifiedPublicKey.parse(new DataInputStream(new ByteArrayInputStream(pubkey.serializedBytes())));
Assert.assertTrue(pubkey.signedIdentities.size() == parsedPubkey.identities.size());
Assert.assertFalse(pubkey.signedIdentities.get(0).signature.attributes.attributes.unhashedSubpackets.issuer.header.type.critical);
}
}
Aggregations