1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-12-25 04:17:59 +01:00

Add test for back-sig generation

This commit is contained in:
Paul Schaub 2024-02-21 13:38:01 +01:00
parent 79c8eff940
commit 7f07503064
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -102,6 +102,28 @@ class OpenPgpKeyGeneratorTest {
assertEquals("Primary <primary@example.com>", info.primaryUserId) assertEquals("Primary <primary@example.com>", info.primaryUserId)
} }
@Test
fun `adding signing key will add embedded back-signature`() {
val key =
OpenPgpKeyGenerator.buildV4Key()
.setPrimaryKey(KeyType.EDDSA(EdDSACurve._Ed25519))
.addSubkey(KeyType.EDDSA(EdDSACurve._Ed25519)) {
addBindingSignature(
SelfSignatureSubpackets.applyHashed { setKeyFlags(KeyFlag.SIGN_DATA) })
}
.build()
assertFalse(
key.publicKeys
.asSequence()
.last()
.signatures
.next()
.hashedSubPackets
.embeddedSignatures
.isEmpty)
}
@Test @Test
fun testUnopinionatedV4() { fun testUnopinionatedV4() {
// Unopinionated // Unopinionated