mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-09-12 03:39:39 +02:00
Integrate RevocationState into KeyRingInfo class
This commit is contained in:
parent
c73905d179
commit
0cc884523c
2 changed files with 24 additions and 2 deletions
|
@ -49,6 +49,7 @@ import org.pgpainless.key.generation.type.eddsa.EdDSACurve;
|
|||
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||
import org.pgpainless.key.protection.UnprotectedKeysProtector;
|
||||
import org.pgpainless.key.util.KeyRingUtils;
|
||||
import org.pgpainless.key.util.RevocationAttributes;
|
||||
import org.pgpainless.key.util.UserId;
|
||||
import org.pgpainless.util.DateUtil;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
|
@ -105,7 +106,12 @@ public class KeyRingInfoTest {
|
|||
assertNull(sInfo.getRevocationDate());
|
||||
assertNull(pInfo.getRevocationDate());
|
||||
Date revocationDate = DateUtil.now();
|
||||
PGPSecretKeyRing revoked = PGPainless.modifyKeyRing(secretKeys).revoke(new UnprotectedKeysProtector()).done();
|
||||
PGPSecretKeyRing revoked = PGPainless.modifyKeyRing(secretKeys).revoke(
|
||||
new UnprotectedKeysProtector(),
|
||||
RevocationAttributes.createKeyRevocation()
|
||||
.withReason(RevocationAttributes.Reason.KEY_RETIRED)
|
||||
.withoutDescription()
|
||||
).done();
|
||||
KeyRingInfo rInfo = PGPainless.inspectKeyRing(revoked);
|
||||
assertNotNull(rInfo.getRevocationDate());
|
||||
assertEquals(revocationDate.getTime(), rInfo.getRevocationDate().getTime(), 5);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue