Skip to content

Commit 951d6a2

Browse files
committed
Add clarifying comments
1 parent 572c815 commit 951d6a2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pg/src/main/java/org/bouncycastle/openpgp/api/OpenPGPCertificate.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3235,6 +3235,7 @@ private Date getBackSigExpirationTime()
32353235
{
32363236
OpenPGPComponentSignature backSig = new OpenPGPComponentSignature(
32373237
embeddedSigs.get(0),
3238+
// Primary Key Binding Signature has issuer and target swapped
32383239
/* issuer= */getSignature().getTargetKeyComponent(),
32393240
/* target= */getSignature().getIssuer());
32403241
return backSig.getExpirationTime();
@@ -3259,7 +3260,7 @@ public boolean verify(PGPContentVerifierBuilderProvider contentVerifierBuilderPr
32593260
OpenPGPPolicy policy)
32603261
throws PGPSignatureException
32613262
{
3262-
signature.verify(contentVerifierBuilderProvider, policy);
3263+
signature.verify(contentVerifierBuilderProvider, policy); // throws if invalid
32633264
return true;
32643265
}
32653266

@@ -3338,6 +3339,7 @@ public Date since()
33383339
{
33393340
if (signature.signature.isHardRevocation())
33403341
{
3342+
// hard revocations are valid retroactively, so we return the beginning of time here
33413343
return new Date(0L);
33423344
}
33433345
return super.since();
@@ -3348,6 +3350,7 @@ public Date until()
33483350
{
33493351
if (signature.signature.isHardRevocation())
33503352
{
3353+
// hard revocations do not expire, so they are effective indefinitely
33513354
return new Date(Long.MAX_VALUE);
33523355
}
33533356
return super.until();

0 commit comments

Comments
 (0)