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

Add javadoc

This commit is contained in:
Paul Schaub 2025-02-26 16:29:59 +01:00
parent 22a1f54a9b
commit 446b8eaaca
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
2 changed files with 13 additions and 2 deletions

View file

@ -15,7 +15,13 @@ import org.bouncycastle.openpgp.api.OpenPGPKey.OpenPGPPrivateKey
* as the component keys fingerprint. * as the component keys fingerprint.
*/ */
class SubkeyIdentifier( class SubkeyIdentifier(
/**
* Fingerprint of the certificate.
*/
val certificateFingerprint: OpenPgpFingerprint, val certificateFingerprint: OpenPgpFingerprint,
/**
* Fingerprint of the target component key.
*/
val componentKeyFingerprint: OpenPgpFingerprint val componentKeyFingerprint: OpenPgpFingerprint
) { ) {
@ -124,8 +130,13 @@ class SubkeyIdentifier(
/** Key-ID of the primary key of the certificate the component key belongs to. */ /** Key-ID of the primary key of the certificate the component key belongs to. */
@Deprecated("Use of key-ids is discouraged.") val primaryKeyId = certificateIdentifier.keyId @Deprecated("Use of key-ids is discouraged.") val primaryKeyId = certificateIdentifier.keyId
/** True, if the component key is the primary key. */
val isPrimaryKey = certificateIdentifier.matches(componentKeyIdentifier) val isPrimaryKey = certificateIdentifier.matches(componentKeyIdentifier)
/**
* Return true, if the provided [fingerprint] matches either the [certificateFingerprint]
* or [componentKeyFingerprint].
*/
fun matches(fingerprint: OpenPgpFingerprint) = fun matches(fingerprint: OpenPgpFingerprint) =
certificateFingerprint == fingerprint || componentKeyFingerprint == fingerprint certificateFingerprint == fingerprint || componentKeyFingerprint == fingerprint

View file

@ -24,8 +24,8 @@ class VerificationHelper {
fun mapVerification(sigVerification: SignatureVerification): Verification = fun mapVerification(sigVerification: SignatureVerification): Verification =
Verification( Verification(
sigVerification.signature.creationTime, sigVerification.signature.creationTime,
sigVerification.signingKey.subkeyFingerprint.toString(), sigVerification.signingKey.componentKeyFingerprint.toString(),
sigVerification.signingKey.primaryKeyFingerprint.toString(), sigVerification.signingKey.certificateFingerprint.toString(),
getMode(sigVerification.signature), getMode(sigVerification.signature),
null) null)