1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-12-08 21:31:08 +01:00

Tests: Avoid usage of now deprecated functionality

This commit is contained in:
Paul Schaub 2025-03-08 10:56:55 +01:00
parent 32afabf878
commit 30d20ec516
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
14 changed files with 119 additions and 101 deletions

View file

@ -54,7 +54,7 @@ public final class GnuPGDummyKeyUtil {
int mode = s2K.getProtectionMode();
// TODO: Is GNU_DUMMY_S2K appropriate?
if (type == S2K.GNU_DUMMY_S2K && mode == S2K.GNU_PROTECTION_MODE_DIVERT_TO_CARD) {
SubkeyIdentifier hardwareBackedKey = new SubkeyIdentifier(secretKeys, secretKey.getKeyID());
SubkeyIdentifier hardwareBackedKey = new SubkeyIdentifier(secretKeys, secretKey.getKeyIdentifier());
hardwareBackedKeys.add(hardwareBackedKey);
}
}

View file

@ -10,6 +10,8 @@ import org.bouncycastle.bcpg.KeyIdentifier
import org.bouncycastle.openpgp.PGPKeyRing
import org.bouncycastle.openpgp.PGPPublicKey
import org.bouncycastle.openpgp.PGPSecretKey
import org.bouncycastle.openpgp.api.OpenPGPCertificate
import org.bouncycastle.openpgp.api.OpenPGPCertificate.OpenPGPComponentKey
class OpenPgpV4Fingerprint : OpenPgpFingerprint {
@ -17,6 +19,10 @@ class OpenPgpV4Fingerprint : OpenPgpFingerprint {
constructor(bytes: ByteArray) : super(bytes)
constructor(key: OpenPGPCertificate) : super(key.fingerprint)
constructor(key: OpenPGPComponentKey) : super(key.pgpPublicKey)
constructor(key: PGPPublicKey) : super(key)
constructor(key: PGPSecretKey) : super(key)

View file

@ -31,10 +31,12 @@ interface SecretKeyPassphraseProvider {
* @param keyId if of the secret key
* @return passphrase or null, if no passphrase record has been found.
*/
@Deprecated("Pass in a KeyIdentifier instead.")
fun getPassphraseFor(keyId: Long): Passphrase? = getPassphraseFor(KeyIdentifier(keyId))
fun getPassphraseFor(keyIdentifier: KeyIdentifier): Passphrase?
@Deprecated("Pass in a KeyIdentifier instead.")
fun hasPassphrase(keyId: Long): Boolean = hasPassphrase(KeyIdentifier(keyId))
fun hasPassphrase(keyIdentifier: KeyIdentifier): Boolean