Skip to content

Commit

Permalink
Persist generated public keys unencrypted (#34626)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hanbing0715 authored and jkakavas committed Oct 24, 2018
1 parent 64ecb17 commit fa9f0b4
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.security.SecureRandom;

import static org.elasticsearch.license.CryptUtils.writeEncryptedPrivateKey;
import static org.elasticsearch.license.CryptUtils.writeEncryptedPublicKey;

public class KeyPairGeneratorTool extends LoggingAwareCommand {

Expand Down Expand Up @@ -65,7 +64,7 @@ protected void execute(Terminal terminal, OptionSet options) throws Exception {
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,
Expand Down

0 comments on commit fa9f0b4

Please sign in to comment.