Skip to content

Commit

Permalink
KAFKA-18374 Remove EncryptingPasswordEncoder, CipherParamsEncoder, Gc…
Browse files Browse the repository at this point in the history
…mParamsEncoder, IvParamsEncoder, and the unused static variables in PasswordEncoder (#18355)

Reviewers: TengYao Chi <kitingiao@gmail.com>, TaiJuWu <tjwu1217@gmail.com>, Christo Lolov <lolovc@amazon.com>, PoAn Yang <payang@apache.org>, Chia-Ping Tsai <chia7712@gmail.com>
  • Loading branch information
mingdaoy authored Jan 6, 2025
1 parent 3d1febf commit 23e77ed
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 301 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,8 @@
import org.apache.kafka.common.config.types.Password;

import java.security.GeneralSecurityException;
import java.util.Base64;

public interface PasswordEncoder {

String KEY_FACTORY_ALGORITHM = "keyFactoryAlgorithm";
String CIPHER_ALGORITHM = "cipherAlgorithm";
String INITIALIZATION_VECTOR = "initializationVector";
String KEY_LENGTH = "keyLength";
String SALT = "salt";
String ITERATIONS = "iterations";
String ENCRYPTED_PASSWORD = "encryptedPassword";
String PASSWORD_LENGTH = "passwordLength";

/**
* A password encoder that does not modify the given password. This is used in KRaft mode only.
*/
Expand All @@ -48,22 +37,6 @@ public Password decode(String encodedPassword) {
}
};

static byte[] base64Decode(String encoded) {
return Base64.getDecoder().decode(encoded);
}

static String base64Encode(byte[] bytes) {
return Base64.getEncoder().encodeToString(bytes);
}

static EncryptingPasswordEncoder encrypting(Password secret,
String keyFactoryAlgorithm,
String cipherAlgorithm,
int keyLength,
int iterations) {
return new EncryptingPasswordEncoder(secret, keyFactoryAlgorithm, cipherAlgorithm, keyLength, iterations);
}

String encode(Password password) throws GeneralSecurityException;
Password decode(String encodedPassword) throws GeneralSecurityException;
}

0 comments on commit 23e77ed

Please sign in to comment.