mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-25 12:27:58 +01:00
Add documentation to PGPSignatureExtensions
This commit is contained in:
parent
c759367680
commit
9f0d8f15fa
1 changed files with 23 additions and 0 deletions
|
@ -9,15 +9,38 @@ import org.pgpainless.key.OpenPgpFingerprint
|
||||||
import org.pgpainless.signature.SignatureUtils
|
import org.pgpainless.signature.SignatureUtils
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the value of the KeyExpirationDate subpacket, or null, if the signature does not carry
|
||||||
|
* such a subpacket.
|
||||||
|
*/
|
||||||
fun PGPSignature.getKeyExpirationDate(keyCreationDate: Date): Date? =
|
fun PGPSignature.getKeyExpirationDate(keyCreationDate: Date): Date? =
|
||||||
SignatureUtils.getKeyExpirationDate(keyCreationDate, this)
|
SignatureUtils.getKeyExpirationDate(keyCreationDate, this)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the value of the signature ExpirationTime subpacket, or null, if the signature
|
||||||
|
* does not carry such a subpacket.
|
||||||
|
*/
|
||||||
fun PGPSignature.getSignatureExpirationDate(): Date? =
|
fun PGPSignature.getSignatureExpirationDate(): Date? =
|
||||||
SignatureUtils.getSignatureExpirationDate(this)
|
SignatureUtils.getSignatureExpirationDate(this)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return true, if the signature is expired at the given reference time.
|
||||||
|
*/
|
||||||
fun PGPSignature.isExpired(referenceTime: Date = Date()) =
|
fun PGPSignature.isExpired(referenceTime: Date = Date()) =
|
||||||
SignatureUtils.isSignatureExpired(this, referenceTime)
|
SignatureUtils.isSignatureExpired(this, referenceTime)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the key-ID of the issuer, determined by examining the IssuerKeyId and IssuerFingerprint
|
||||||
|
* subpackets of the signature.
|
||||||
|
*/
|
||||||
fun PGPSignature.getIssuerKeyId() = SignatureUtils.determineIssuerKeyId(this)
|
fun PGPSignature.getIssuerKeyId() = SignatureUtils.determineIssuerKeyId(this)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return true, if the signature was likely issued by the key with the given fingerprint.
|
||||||
|
*/
|
||||||
fun PGPSignature.wasIssuedBy(fingerprint: OpenPgpFingerprint) = SignatureUtils.wasIssuedBy(fingerprint, this)
|
fun PGPSignature.wasIssuedBy(fingerprint: OpenPgpFingerprint) = SignatureUtils.wasIssuedBy(fingerprint, this)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return true, if this signature is a hard revocation.
|
||||||
|
*/
|
||||||
|
fun PGPSignature.isHardRevocation() = SignatureUtils.isHardRevocation(this)
|
||||||
|
|
Loading…
Reference in a new issue