mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-09-09 02:09:38 +02:00
Add javadoc
This commit is contained in:
parent
b8bdb5bbe5
commit
b9ee09a774
2 changed files with 13 additions and 2 deletions
|
@ -15,7 +15,13 @@ import org.bouncycastle.openpgp.api.OpenPGPKey.OpenPGPPrivateKey
|
|||
* as the component keys fingerprint.
|
||||
*/
|
||||
class SubkeyIdentifier(
|
||||
/**
|
||||
* Fingerprint of the certificate.
|
||||
*/
|
||||
val certificateFingerprint: OpenPgpFingerprint,
|
||||
/**
|
||||
* Fingerprint of the target component key.
|
||||
*/
|
||||
val componentKeyFingerprint: OpenPgpFingerprint
|
||||
) {
|
||||
|
||||
|
@ -124,8 +130,13 @@ class SubkeyIdentifier(
|
|||
/** 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
|
||||
|
||||
/** True, if the component key is the primary key. */
|
||||
val isPrimaryKey = certificateIdentifier.matches(componentKeyIdentifier)
|
||||
|
||||
/**
|
||||
* Return true, if the provided [fingerprint] matches either the [certificateFingerprint]
|
||||
* or [componentKeyFingerprint].
|
||||
*/
|
||||
fun matches(fingerprint: OpenPgpFingerprint) =
|
||||
certificateFingerprint == fingerprint || componentKeyFingerprint == fingerprint
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@ class VerificationHelper {
|
|||
fun mapVerification(sigVerification: SignatureVerification): Verification =
|
||||
Verification(
|
||||
sigVerification.signature.creationTime,
|
||||
sigVerification.signingKey.subkeyFingerprint.toString(),
|
||||
sigVerification.signingKey.primaryKeyFingerprint.toString(),
|
||||
sigVerification.signingKey.componentKeyFingerprint.toString(),
|
||||
sigVerification.signingKey.certificateFingerprint.toString(),
|
||||
getMode(sigVerification.signature),
|
||||
null)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue