1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-12-25 12:27:58 +01:00

Introduce ImplementationFactory.getPGPV4KeyPair()

Preparation for v6
This commit is contained in:
Paul Schaub 2024-01-06 01:29:34 +01:00
parent cbbd980554
commit 831e2497ed
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
3 changed files with 12 additions and 3 deletions

View file

@ -86,7 +86,7 @@ class BcImplementationFactory : ImplementationFactory() {
override fun getPGPDataEncryptorBuilder(symmetricKeyAlgorithm: Int): PGPDataEncryptorBuilder = override fun getPGPDataEncryptorBuilder(symmetricKeyAlgorithm: Int): PGPDataEncryptorBuilder =
BcPGPDataEncryptorBuilder(symmetricKeyAlgorithm) BcPGPDataEncryptorBuilder(symmetricKeyAlgorithm)
override fun getPGPKeyPair( override fun getPGPV4KeyPair(
publicKeyAlgorithm: PublicKeyAlgorithm, publicKeyAlgorithm: PublicKeyAlgorithm,
keyPair: KeyPair, keyPair: KeyPair,
creationDate: Date creationDate: Date

View file

@ -100,7 +100,16 @@ abstract class ImplementationFactory {
abstract fun getPGPDataEncryptorBuilder(symmetricKeyAlgorithm: Int): PGPDataEncryptorBuilder abstract fun getPGPDataEncryptorBuilder(symmetricKeyAlgorithm: Int): PGPDataEncryptorBuilder
@Throws(PGPException::class) @Throws(PGPException::class)
abstract fun getPGPKeyPair( @Deprecated("Replace with versioned getter method, such as getPGPV4KeyPair()",
replaceWith = ReplaceWith("getPGPV4KeyPair"))
fun getPGPKeyPair(
publicKeyAlgorithm: PublicKeyAlgorithm,
keyPair: KeyPair,
creationDate: Date
): PGPKeyPair = getPGPV4KeyPair(publicKeyAlgorithm, keyPair, creationDate)
@Throws(PGPException::class)
abstract fun getPGPV4KeyPair(
publicKeyAlgorithm: PublicKeyAlgorithm, publicKeyAlgorithm: PublicKeyAlgorithm,
keyPair: KeyPair, keyPair: KeyPair,
creationDate: Date creationDate: Date

View file

@ -101,7 +101,7 @@ class JceImplementationFactory : ImplementationFactory() {
override fun getPGPDataEncryptorBuilder(symmetricKeyAlgorithm: Int): PGPDataEncryptorBuilder = override fun getPGPDataEncryptorBuilder(symmetricKeyAlgorithm: Int): PGPDataEncryptorBuilder =
JcePGPDataEncryptorBuilder(symmetricKeyAlgorithm).setProvider(ProviderFactory.provider) JcePGPDataEncryptorBuilder(symmetricKeyAlgorithm).setProvider(ProviderFactory.provider)
override fun getPGPKeyPair( override fun getPGPV4KeyPair(
publicKeyAlgorithm: PublicKeyAlgorithm, publicKeyAlgorithm: PublicKeyAlgorithm,
keyPair: KeyPair, keyPair: KeyPair,
creationDate: Date creationDate: Date