mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-09-09 18:29:39 +02:00
Add javadoc
This commit is contained in:
parent
22a1f54a9b
commit
446b8eaaca
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.
|
* 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
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue