Commit 39a15ea1 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Use stronger RSA algorithm. JM-1521

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@10959 b35dd754-fafc-0310-a699-88a17e54d16e
parent 46dcb3c5
...@@ -123,7 +123,7 @@ public class CertificateManager { ...@@ -123,7 +123,7 @@ public class CertificateManager {
// Generate public and private keys // Generate public and private keys
KeyPair keyPair = generateKeyPair("RSA", 1024); KeyPair keyPair = generateKeyPair("RSA", 1024);
// Create X509 certificate with keys and specified domain // Create X509 certificate with keys and specified domain
X509Certificate cert = createX509V3Certificate(keyPair, 60, issuerDN, subjectDN, domain, "MD5withRSA"); X509Certificate cert = createX509V3Certificate(keyPair, 60, issuerDN, subjectDN, domain, "SHA1WITHRSAENCRYPTION");
// Store new certificate and private key in the keystore // Store new certificate and private key in the keystore
ksKeys.setKeyEntry(alias, keyPair.getPrivate(), keyPassword.toCharArray(), new X509Certificate[]{cert}); ksKeys.setKeyEntry(alias, keyPair.getPrivate(), keyPassword.toCharArray(), new X509Certificate[]{cert});
// Notify listeners that a new certificate has been created // Notify listeners that a new certificate has been created
...@@ -387,7 +387,7 @@ public class CertificateManager { ...@@ -387,7 +387,7 @@ public class CertificateManager {
PublicKey pubKey = cert.getPublicKey(); PublicKey pubKey = cert.getPublicKey();
String signatureAlgorithm = "DSA".equals(pubKey.getAlgorithm()) ? "SHA1withDSA" : "MD5withRSA"; String signatureAlgorithm = "DSA".equals(pubKey.getAlgorithm()) ? "SHA1withDSA" : "SHA1WITHRSAENCRYPTION";
PKCS10CertificationRequest csr = PKCS10CertificationRequest csr =
new PKCS10CertificationRequest(signatureAlgorithm, xname, pubKey, null, privKey); new PKCS10CertificationRequest(signatureAlgorithm, xname, pubKey, null, privKey);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment