Persist generated public keys unencrypted
The changes introduced in 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
@@ -21,7 +21,6 @@ import java.security.KeyPairGenerator;
import java.security.SecureRandom;
import static org.elasticsearch.license.CryptUtils.writeEncryptedPrivateKey;
-import static org.elasticsearch.license.CryptUtils.writeEncryptedPublicKey;
public class KeyPairGeneratorTool extends LoggingAwareCommand {
@@ -65,7 +64,7 @@ public class KeyPairGeneratorTool extends LoggingAwareCommand {
KeyPair keyPair = keyGen.generateKeyPair();
Files.write(privateKeyPath, writeEncryptedPrivateKey(keyPair.getPrivate()));
- Files.write(publicKeyPath, writeEncryptedPublicKey(keyPair.getPublic()));
+ Files.write(publicKeyPath, keyPair.getPublic().getEncoded());
terminal.println(
Terminal.Verbosity.VERBOSE,
