You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2018/10/04 23:15:49 UTC

[GitHub] rhtyd closed pull request #2875: CertUtils: export private key to pem format correctly

rhtyd closed pull request #2875: CertUtils: export private key to pem format correctly
URL: https://github.com/apache/cloudstack/pull/2875
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/utils/src/main/java/org/apache/cloudstack/utils/security/CertUtils.java b/utils/src/main/java/org/apache/cloudstack/utils/security/CertUtils.java
index aea65a7df6f..d357d6d0528 100644
--- a/utils/src/main/java/org/apache/cloudstack/utils/security/CertUtils.java
+++ b/utils/src/main/java/org/apache/cloudstack/utils/security/CertUtils.java
@@ -75,8 +75,6 @@
 
 import com.google.common.base.Strings;
 
-//import org.bouncycastle.x509.extension.SubjectKeyIdentifierStructure;
-
 public class CertUtils {
 
     private static final Logger LOG = Logger.getLogger(CertUtils.class);
@@ -132,7 +130,7 @@ public static PrivateKey pemToPrivateKey(final String pem) throws InvalidKeySpec
     }
 
     public static String privateKeyToPem(final PrivateKey key) throws IOException {
-        final PemObject pemObject = new PemObject("RSA PRIVATE KEY", key.getEncoded());
+        final PemObject pemObject = new PemObject("PRIVATE KEY", key.getEncoded());
         final StringWriter sw = new StringWriter();
         try (final PemWriter pw = new PemWriter(sw)) {
             pw.writeObject(pemObject);


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services