2021-10-07 15:48:52 +02:00
|
|
|
// SPDX-FileCopyrightText: 2018 Paul Schaub <vanitasvitae@fsfe.org>
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2018-07-18 18:23:06 +02:00
|
|
|
package org.pgpainless.decryption_verification;
|
2018-06-06 18:46:41 +02:00
|
|
|
|
2018-07-31 20:09:16 +02:00
|
|
|
import javax.annotation.Nonnull;
|
2021-05-29 12:19:12 +02:00
|
|
|
import javax.annotation.Nullable;
|
2018-07-31 20:09:16 +02:00
|
|
|
|
2021-05-29 12:19:12 +02:00
|
|
|
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
2018-07-02 20:46:27 +02:00
|
|
|
|
2018-06-06 18:46:41 +02:00
|
|
|
public interface MissingPublicKeyCallback {
|
|
|
|
|
2018-07-25 22:49:02 +02:00
|
|
|
/**
|
2021-05-29 12:19:12 +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
|
|
|
*
|
2021-05-29 12:19:12 +02:00
|
|
|
* Note: The key-id might belong to a subkey, so be aware that when looking up the {@link PGPPublicKeyRing},
|
|
|
|
* you may not only search for the key-id on the key rings primary key!
|
2018-07-25 22:49:02 +02:00
|
|
|
*
|
2021-05-29 12:19:12 +02:00
|
|
|
* It would be super cool to provide the OpenPgp fingerprint here, but unfortunately one-pass-signatures
|
|
|
|
* only contain the key id (see https://datatracker.ietf.org/doc/html/rfc4880#section-5.4)
|
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
|
2018-07-25 22:49:02 +02:00
|
|
|
*/
|
2021-05-29 12:19:12 +02:00
|
|
|
@Nullable PGPPublicKeyRing onMissingPublicKeyEncountered(@Nonnull Long keyId);
|
2018-06-06 18:46:41 +02:00
|
|
|
|
|
|
|
}
|