mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-25 12:27:58 +01:00
More tests
This commit is contained in:
parent
95bd9532bd
commit
4afc30c462
1 changed files with 25 additions and 0 deletions
|
@ -414,4 +414,29 @@ class OpenPgpKeyGeneratorTest {
|
||||||
.setPrimaryKey(KeyType.EDDSA(EdDSACurve._Ed25519))
|
.setPrimaryKey(KeyType.EDDSA(EdDSACurve._Ed25519))
|
||||||
.addSubkey(KeyType.XDH(XDHSpec._X25519)) { addBindingSignature(bindingTime = t0) }
|
.addSubkey(KeyType.XDH(XDHSpec._X25519)) { addBindingSignature(bindingTime = t0) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `opinionated add subkey with weak binding signature hash algorithm fails`() {
|
||||||
|
val policy = Policy()
|
||||||
|
|
||||||
|
assertThrows<IllegalArgumentException> {
|
||||||
|
OpenPgpKeyGenerator.buildV4Key(policy)
|
||||||
|
.setPrimaryKey(KeyType.EDDSA(EdDSACurve._Ed25519))
|
||||||
|
.addSubkey(KeyType.XDH(XDHSpec._X25519)) {
|
||||||
|
addBindingSignature(hashAlgorithm = HashAlgorithm.SHA1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `unopinionated add subkey with weak binding signature hash algorithm is okay`() {
|
||||||
|
val policy = Policy()
|
||||||
|
|
||||||
|
OpenPgpKeyGenerator.buildV4Key(policy)
|
||||||
|
.setPrimaryKey(KeyType.EDDSA(EdDSACurve._Ed25519))
|
||||||
|
.unopinionated()
|
||||||
|
.addSubkey(KeyType.XDH(XDHSpec._X25519)) {
|
||||||
|
addBindingSignature(hashAlgorithm = HashAlgorithm.SHA1)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue