From b30f0fd76a91b1d740072b248a7d7d2d4897b0f9 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Thu, 24 Jul 2025 11:49:38 +0200 Subject: [PATCH] Add overridden @Deprecated annotations --- .../CachingBcPublicKeyDataDecryptorFactory.kt | 1 + .../decryption_verification/HardwareSecurity.kt | 1 + .../signature/subpackets/SignatureSubpackets.kt | 8 ++++++++ 3 files changed, 10 insertions(+) diff --git a/pgpainless-core/src/main/kotlin/org/pgpainless/decryption_verification/CachingBcPublicKeyDataDecryptorFactory.kt b/pgpainless-core/src/main/kotlin/org/pgpainless/decryption_verification/CachingBcPublicKeyDataDecryptorFactory.kt index 9bafa6da..1da0a42d 100644 --- a/pgpainless-core/src/main/kotlin/org/pgpainless/decryption_verification/CachingBcPublicKeyDataDecryptorFactory.kt +++ b/pgpainless-core/src/main/kotlin/org/pgpainless/decryption_verification/CachingBcPublicKeyDataDecryptorFactory.kt @@ -46,6 +46,7 @@ class CachingBcPublicKeyDataDecryptorFactory( return decryptorFactory.createDataDecryptor(p0, p1) } + @Deprecated("Deprecated in Java") override fun recoverSessionData( keyAlgorithm: Int, secKeyData: Array, diff --git a/pgpainless-core/src/main/kotlin/org/pgpainless/decryption_verification/HardwareSecurity.kt b/pgpainless-core/src/main/kotlin/org/pgpainless/decryption_verification/HardwareSecurity.kt index b6e2bd17..27f53bc6 100644 --- a/pgpainless-core/src/main/kotlin/org/pgpainless/decryption_verification/HardwareSecurity.kt +++ b/pgpainless-core/src/main/kotlin/org/pgpainless/decryption_verification/HardwareSecurity.kt @@ -102,6 +102,7 @@ class HardwareSecurity { return factory.createDataDecryptor(seipd, sessionKey) } + @Deprecated("Deprecated in Java") override fun recoverSessionData( keyAlgorithm: Int, secKeyData: Array, diff --git a/pgpainless-core/src/main/kotlin/org/pgpainless/signature/subpackets/SignatureSubpackets.kt b/pgpainless-core/src/main/kotlin/org/pgpainless/signature/subpackets/SignatureSubpackets.kt index 2a5ea016..28f9ee82 100644 --- a/pgpainless-core/src/main/kotlin/org/pgpainless/signature/subpackets/SignatureSubpackets.kt +++ b/pgpainless-core/src/main/kotlin/org/pgpainless/signature/subpackets/SignatureSubpackets.kt @@ -292,15 +292,18 @@ class SignatureSubpackets( } } + @Deprecated("Use of this subpacket is discouraged.") override fun addRevocationKey(revocationKey: PGPPublicKey): SignatureSubpackets = apply { addRevocationKey(true, revocationKey) } + @Deprecated("Use of this subpacket is discouraged.") override fun addRevocationKey( isCritical: Boolean, revocationKey: PGPPublicKey ): SignatureSubpackets = apply { addRevocationKey(isCritical, false, revocationKey) } + @Deprecated("Use of this subpacket is discouraged.") override fun addRevocationKey( isCritical: Boolean, isSensitive: Boolean, @@ -311,10 +314,12 @@ class SignatureSubpackets( RevocationKey(isCritical, clazz, revocationKey.algorithm, revocationKey.fingerprint)) } + @Deprecated("Use of this subpacket is discouraged.") override fun addRevocationKey(revocationKey: RevocationKey): SignatureSubpackets = apply { subpacketsGenerator.addCustomSubpacket(revocationKey) } + @Deprecated("Use of this subpacket is discouraged.") override fun clearRevocationKeys(): SignatureSubpackets = apply { subpacketsGenerator.removePacketsOfType(SignatureSubpacketTags.REVOCATION_KEY) } @@ -450,15 +455,18 @@ class SignatureSubpackets( } } + @Deprecated("Usage of subpacket is discouraged") override fun setSignerUserId(userId: CharSequence): SignatureSubpackets = apply { setSignerUserId(false, userId) } + @Deprecated("Usage of subpacket is discouraged") override fun setSignerUserId(isCritical: Boolean, userId: CharSequence): SignatureSubpackets = apply { setSignerUserId(SignerUserID(isCritical, userId.toString())) } + @Deprecated("Usage of subpacket is discouraged") override fun setSignerUserId(signerUserID: SignerUserID?): SignatureSubpackets = apply { subpacketsGenerator.removePacketsOfType(SignatureSubpacketTags.SIGNER_USER_ID) signerUserID?.let { subpacketsGenerator.setSignerUserID(it.isCritical, it.rawID) }