1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-09-10 18:59:39 +02:00

KeyRingInfo: Pass API instance to key constructors

This commit is contained in:
Paul Schaub 2025-08-20 11:31:50 +02:00
parent 75093de961
commit 2ed16e8f52
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
2 changed files with 7 additions and 1 deletions

View file

@ -38,6 +38,11 @@ abstract class KeyException : RuntimeException {
) {
constructor(cert: OpenPGPCertificate, expirationDate: Date) : this(of(cert), expirationDate)
constructor(
componentKey: OpenPGPComponentKey,
expirationDate: Date
) : this(of(componentKey), expirationDate)
}
class RevokedKeyException : KeyException {

View file

@ -35,7 +35,8 @@ class KeyRingInfo(
api: PGPainless = PGPainless.getInstance(),
referenceDate: Date = Date()
) : this(
if (keys is PGPSecretKeyRing) OpenPGPKey(keys) else OpenPGPCertificate(keys),
if (keys is PGPSecretKeyRing) OpenPGPKey(keys, api.implementation)
else OpenPGPCertificate(keys, api.implementation),
api,
referenceDate)