diff options
author | cfu <cfu@c9f7a03b-bd48-0410-a16d-cbbf54688b0b> | 2010-09-26 21:30:38 +0000 |
---|---|---|
committer | cfu <cfu@c9f7a03b-bd48-0410-a16d-cbbf54688b0b> | 2010-09-26 21:30:38 +0000 |
commit | 30559544cdae556ec0371a09170fada98a3cdc60 (patch) | |
tree | 06cb5aea1cdced785cb3462fbe1e70f92d9b4186 /pki/base/util/src/com | |
parent | 84f0992d60e2075146681afc911a631e137dcdb0 (diff) | |
download | pki-30559544cdae556ec0371a09170fada98a3cdc60.tar.gz pki-30559544cdae556ec0371a09170fada98a3cdc60.tar.xz pki-30559544cdae556ec0371a09170fada98a3cdc60.zip |
Bug 635033 - At installation wizard selecting key types other than CA's signing cert will fail
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/trunk@1319 c9f7a03b-bd48-0410-a16d-cbbf54688b0b
Diffstat (limited to 'pki/base/util/src/com')
-rw-r--r-- | pki/base/util/src/com/netscape/cmsutil/crypto/CryptoUtil.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/pki/base/util/src/com/netscape/cmsutil/crypto/CryptoUtil.java b/pki/base/util/src/com/netscape/cmsutil/crypto/CryptoUtil.java index 177affad2..15aac27b7 100644 --- a/pki/base/util/src/com/netscape/cmsutil/crypto/CryptoUtil.java +++ b/pki/base/util/src/com/netscape/cmsutil/crypto/CryptoUtil.java @@ -160,6 +160,7 @@ public class CryptoUtil { NoSuchAlgorithmException, TokenException { CryptoToken t = getTokenByName(token); + KeyPairAlgorithm alg = KeyPairAlgorithm.EC; KeyPairGenerator g = t.getKeyPairGenerator(alg); @@ -532,7 +533,7 @@ public class CryptoUtil { CertificateException, InvalidKeyException { // set default; use the other call with "alg" to set algorithm - String alg = "SHA1withRSA"; + String alg = "SHA256withRSA"; try { return createX509CertInfo (x509key, serialno, issuername, subjname, notBefore, notAfter, alg); } catch (NoSuchAlgorithmException ex) { @@ -583,7 +584,7 @@ public class CryptoUtil { CertificateException { // set default; use the other call with "alg" to specify algorithm - String alg = "SHA1withEC"; + String alg = "SHA256withEC"; return signECCCert(privateKey, certInfo, alg); } @@ -670,9 +671,9 @@ public class CryptoUtil { InvalidKeyException, IOException, CertificateException, SignatureException { // give default - String alg = "SHA1withRSA"; + String alg = "SHA256withRSA"; if (isECCKey(pubk)) { - alg = "SHA1withEC"; + alg = "SHA256withEC"; } return createCertificationRequest(subjectName, pubk, prik, alg); } @@ -707,9 +708,9 @@ public class CryptoUtil { PublicKey pubk = keyPair.getPublic(); X509Key key = convertPublicKeyToX509Key(pubk); if (pubk instanceof RSAPublicKey) { - alg = "SHA1withRSA"; + alg = "SHA256withRSA"; } else if (isECCKey(key)) { - alg = "SHA1withEC"; + alg = "SHA256withEC"; } else { // Assert.assert(pubk instanceof DSAPublicKey); alg = "DSA"; |