2023-09-06 14:48:15 +02:00
|
|
|
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
|
2021-10-07 15:48:52 +02:00
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2023-09-06 14:48:15 +02:00
|
|
|
package org.pgpainless.decryption_verification
|
2018-06-06 18:46:41 +02:00
|
|
|
|
2023-09-06 14:48:15 +02:00
|
|
|
import org.bouncycastle.openpgp.PGPPublicKeyRing
|
2018-07-31 20:09:16 +02:00
|
|
|
|
2023-09-06 14:48:15 +02:00
|
|
|
fun interface MissingPublicKeyCallback {
|
2018-06-06 18:46:41 +02:00
|
|
|
|
2018-07-25 22:49:02 +02:00
|
|
|
/**
|
2023-10-23 14:24:31 +02:00
|
|
|
* This method gets called if we encounter a signature made by a key which was not provided for
|
|
|
|
* signature verification. If you cannot provide the requested key, it is safe to return null
|
|
|
|
* here. PGPainless will then continue verification with the next signature.
|
2018-07-25 22:49:02 +02:00
|
|
|
*
|
2023-10-23 14:24:31 +02:00
|
|
|
* Note: The key-id might belong to a subkey, so be aware that when looking up the
|
|
|
|
* [PGPPublicKeyRing], you may not only search for the key-id on the key rings primary key!
|
2018-07-25 22:49:02 +02:00
|
|
|
*
|
2023-10-23 14:24:31 +02:00
|
|
|
* It would be super cool to provide the OpenPgp fingerprint here, but unfortunately
|
|
|
|
* one-pass-signatures only contain the key id.
|
2018-07-25 22:49:02 +02:00
|
|
|
*
|
2021-05-29 12:19:12 +02:00
|
|
|
* @param keyId ID of the missing signing (sub)key
|
|
|
|
* @return keyring containing the key or null
|
2022-09-29 13:14:32 +02:00
|
|
|
* @see <a href="https://datatracker.ietf.org/doc/html/rfc4880#section-5.4">RFC</a>
|
2018-07-25 22:49:02 +02:00
|
|
|
*/
|
2023-09-06 14:48:15 +02:00
|
|
|
fun onMissingPublicKeyEncountered(keyId: Long): PGPPublicKeyRing?
|
2023-10-23 14:24:31 +02:00
|
|
|
}
|