mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-09-09 02:09:38 +02:00
Add some missing documentation to ConsumerOptions
This commit is contained in:
parent
1e2e9c2125
commit
8e3ad2c9ef
1 changed files with 16 additions and 0 deletions
|
@ -417,6 +417,7 @@ class ConsumerOptions {
|
|||
* @param certificate certificate
|
||||
*/
|
||||
@JvmOverloads
|
||||
@Deprecated("Pass in an OpenPGPCertificate instead.")
|
||||
fun addCertificate(
|
||||
certificate: PGPPublicKeyRing,
|
||||
implementation: OpenPGPImplementation = PGPainless.getInstance().implementation
|
||||
|
@ -424,6 +425,11 @@ class ConsumerOptions {
|
|||
explicitCertificates.add(OpenPGPCertificate(certificate, implementation))
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a certificate as explicitly provided verification cert.
|
||||
*
|
||||
* @param certificate explicit verification cert
|
||||
*/
|
||||
fun addCertificate(certificate: OpenPGPCertificate) {
|
||||
explicitCertificates.add(certificate)
|
||||
}
|
||||
|
@ -445,14 +451,24 @@ class ConsumerOptions {
|
|||
* @param keyId key id
|
||||
* @return certificate
|
||||
*/
|
||||
@Deprecated("Pass in a KeyIdentifier instead.")
|
||||
fun getCertificate(keyId: Long): OpenPGPCertificate? {
|
||||
return getCertificate(KeyIdentifier(keyId))
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a certificate which contains a component key for the given [identifier]. This
|
||||
* method first checks all explicitly provided verification certs and if no cert is found it
|
||||
* consults the certificate stores.
|
||||
*
|
||||
* @param identifier key identifier
|
||||
* @return certificate or null if no match is found
|
||||
*/
|
||||
fun getCertificate(identifier: KeyIdentifier): OpenPGPCertificate? {
|
||||
return explicitCertificates.firstOrNull { it.getKey(identifier) != null }
|
||||
}
|
||||
|
||||
/** Find a certificate containing the issuer component key for the given [signature]. */
|
||||
fun getCertificate(signature: PGPSignature): OpenPGPCertificate? =
|
||||
explicitCertificates.firstOrNull { it.getSigningKeyFor(signature) != null }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue