mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-25 12:27:58 +01:00
Add test for back-sig generation
This commit is contained in:
parent
79c8eff940
commit
7f07503064
1 changed files with 22 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue