1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-09-09 10:19:39 +02:00

Port KeyWithUnknownSecretKeyEncryptionMethodTest

This commit is contained in:
Paul Schaub 2025-04-03 12:49:24 +02:00
parent 8aaa042087
commit 7281ce530a
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -31,13 +31,11 @@ DhxJVTgA/1WaFrKdP3AgL0Ffdooc5XXbjQsj0uHo6FZSHRI4pchMAQCyJnKQ3RvW
@Test
@Disabled("Disabled since BC 1.77 chokes on the test key")
fun testExtractCertificate() {
val key = PGPainless.readKeyRing().secretKeyRing(KEY)!!
val cert = PGPainless.extractCertificate(key)
val key = PGPainless.getInstance().readKey().parseKey(KEY)!!
val cert = key.toCertificate()
assertNotNull(cert)
// Each secret key got its public key component extracted
assertEquals(
key.secretKeys.asSequence().map { it.keyID }.toSet(),
cert.publicKeys.asSequence().map { it.keyID }.toSet())
assertEquals(key.secretKeys.keys.toSet(), cert.publicKeys.keys.toSet())
}
}