mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2025-09-08 17:59:43 +02:00
Add test for certifying without ASCII armor
This commit is contained in:
parent
138e275bb6
commit
be460fabab
1 changed files with 39 additions and 0 deletions
|
@ -73,6 +73,45 @@ public class CertifyValidateUserIdTest {
|
||||||
"Alice accepts Bobs user-id after she certified it");
|
"Alice accepts Bobs user-id after she certified it");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ParameterizedTest
|
||||||
|
@MethodSource("provideInstances")
|
||||||
|
public void certifyUserIdUnarmored(SOP sop) throws IOException {
|
||||||
|
byte[] aliceKey = sop.generateKey()
|
||||||
|
.noArmor()
|
||||||
|
.withKeyPassword("sw0rdf1sh")
|
||||||
|
.userId("Alice <alice@pgpainless.org>")
|
||||||
|
.generate()
|
||||||
|
.getBytes();
|
||||||
|
byte[] aliceCert = sop.extractCert()
|
||||||
|
.noArmor()
|
||||||
|
.key(aliceKey)
|
||||||
|
.getBytes();
|
||||||
|
|
||||||
|
byte[] bobKey = sop.generateKey()
|
||||||
|
.noArmor()
|
||||||
|
.userId("Bob <bob@pgpainless.org>")
|
||||||
|
.generate()
|
||||||
|
.getBytes();
|
||||||
|
byte[] bobCert = sop.extractCert()
|
||||||
|
.noArmor()
|
||||||
|
.key(bobKey)
|
||||||
|
.getBytes();
|
||||||
|
|
||||||
|
byte[] bobCertifiedByAlice = sop.certifyUserId()
|
||||||
|
.noArmor()
|
||||||
|
.userId("Bob <bob@pgpainless.org>")
|
||||||
|
.withKeyPassword("sw0rdf1sh")
|
||||||
|
.keys(aliceKey)
|
||||||
|
.certs(bobCert)
|
||||||
|
.getBytes();
|
||||||
|
|
||||||
|
assertTrue(sop.validateUserId()
|
||||||
|
.userId("Bob <bob@pgpainless.org>")
|
||||||
|
.authorities(aliceCert)
|
||||||
|
.subjects(bobCertifiedByAlice),
|
||||||
|
"Alice accepts Bobs user-id after she certified it");
|
||||||
|
}
|
||||||
|
|
||||||
@ParameterizedTest
|
@ParameterizedTest
|
||||||
@MethodSource("provideInstances")
|
@MethodSource("provideInstances")
|
||||||
public void addPetName(SOP sop) throws IOException {
|
public void addPetName(SOP sop) throws IOException {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue