1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-12-23 03:17:58 +01:00

Replace OpenPgpV4Fingerprint with OpenPgpFingerprint in examples

This commit is contained in:
Paul Schaub 2021-10-29 20:08:11 +02:00
parent 3a9473ad6c
commit 2d364d0939
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
2 changed files with 5 additions and 4 deletions

View file

@ -26,7 +26,7 @@ import org.pgpainless.PGPainless;
import org.pgpainless.algorithm.EncryptionPurpose; import org.pgpainless.algorithm.EncryptionPurpose;
import org.pgpainless.algorithm.KeyFlag; import org.pgpainless.algorithm.KeyFlag;
import org.pgpainless.exception.WrongPassphraseException; import org.pgpainless.exception.WrongPassphraseException;
import org.pgpainless.key.OpenPgpV4Fingerprint; import org.pgpainless.key.OpenPgpFingerprint;
import org.pgpainless.key.generation.KeySpec; import org.pgpainless.key.generation.KeySpec;
import org.pgpainless.key.generation.type.KeyType; import org.pgpainless.key.generation.type.KeyType;
import org.pgpainless.key.generation.type.ecc.EllipticCurve; import org.pgpainless.key.generation.type.ecc.EllipticCurve;
@ -227,7 +227,7 @@ public class ModifyKeys {
secretKey = PGPainless.modifyKeyRing(secretKey) secretKey = PGPainless.modifyKeyRing(secretKey)
.setExpirationDate( .setExpirationDate(
new OpenPgpV4Fingerprint(secretKey.getPublicKey(encryptionSubkeyId)), OpenPgpFingerprint.of(secretKey.getPublicKey(encryptionSubkeyId)),
expirationDate, expirationDate,
protector protector
) )

View file

@ -14,6 +14,7 @@ import org.bouncycastle.openpgp.PGPPublicKeyRingCollection;
import org.bouncycastle.openpgp.PGPSecretKeyRing; import org.bouncycastle.openpgp.PGPSecretKeyRing;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.pgpainless.PGPainless; import org.pgpainless.PGPainless;
import org.pgpainless.key.OpenPgpFingerprint;
import org.pgpainless.key.OpenPgpV4Fingerprint; import org.pgpainless.key.OpenPgpV4Fingerprint;
import org.pgpainless.key.info.KeyRingInfo; import org.pgpainless.key.info.KeyRingInfo;
@ -47,7 +48,7 @@ public class ReadKeys {
KeyRingInfo keyInfo = new KeyRingInfo(publicKey); KeyRingInfo keyInfo = new KeyRingInfo(publicKey);
OpenPgpV4Fingerprint fingerprint = new OpenPgpV4Fingerprint("EB85 BB5F A33A 75E1 5E94 4E63 F231 550C 4F47 E38E"); OpenPgpFingerprint fingerprint = new OpenPgpV4Fingerprint("EB85 BB5F A33A 75E1 5E94 4E63 F231 550C 4F47 E38E");
assertEquals(fingerprint, keyInfo.getFingerprint()); assertEquals(fingerprint, keyInfo.getFingerprint());
assertEquals("Alice Lovelace <alice@openpgp.example>", keyInfo.getPrimaryUserId()); assertEquals("Alice Lovelace <alice@openpgp.example>", keyInfo.getPrimaryUserId());
} }
@ -83,7 +84,7 @@ public class ReadKeys {
KeyRingInfo keyInfo = new KeyRingInfo(secretKey); KeyRingInfo keyInfo = new KeyRingInfo(secretKey);
OpenPgpV4Fingerprint fingerprint = new OpenPgpV4Fingerprint("EB85 BB5F A33A 75E1 5E94 4E63 F231 550C 4F47 E38E"); OpenPgpFingerprint fingerprint = new OpenPgpV4Fingerprint("EB85 BB5F A33A 75E1 5E94 4E63 F231 550C 4F47 E38E");
assertEquals(fingerprint, keyInfo.getFingerprint()); assertEquals(fingerprint, keyInfo.getFingerprint());
assertEquals("Alice Lovelace <alice@openpgp.example>", keyInfo.getPrimaryUserId()); assertEquals("Alice Lovelace <alice@openpgp.example>", keyInfo.getPrimaryUserId());
} }