Skip to content

Commit fe54f73

Browse files
hanbing0715jkakavas
authored andcommitted
Persist generated public keys unencrypted (#34626)
The changes introduced in cca1a2a mean that we should not encrypt the public keys that might be generated by the key-pair-generator when storing the file, as the code that would consume them assumes that they are not encrypted
1 parent 18e004c commit fe54f73

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

x-pack/license-tools/src/main/java/org/elasticsearch/license/licensor/tools/KeyPairGeneratorTool.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import java.security.SecureRandom;
2222

2323
import static org.elasticsearch.license.CryptUtils.writeEncryptedPrivateKey;
24-
import static org.elasticsearch.license.CryptUtils.writeEncryptedPublicKey;
2524

2625
public class KeyPairGeneratorTool extends LoggingAwareCommand {
2726

@@ -65,7 +64,7 @@ protected void execute(Terminal terminal, OptionSet options) throws Exception {
6564
KeyPair keyPair = keyGen.generateKeyPair();
6665

6766
Files.write(privateKeyPath, writeEncryptedPrivateKey(keyPair.getPrivate()));
68-
Files.write(publicKeyPath, writeEncryptedPublicKey(keyPair.getPublic()));
67+
Files.write(publicKeyPath, keyPair.getPublic().getEncoded());
6968

7069
terminal.println(
7170
Terminal.Verbosity.VERBOSE,

0 commit comments

Comments
 (0)