accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmil...@apache.org
Subject [accumulo] branch master updated: ACCUMULO-4703 Upgraded bouncycastle to 1.58
Date Tue, 19 Sep 2017 21:29:05 GMT
This is an automated email from the ASF dual-hosted git repository.

mmiller pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/master by this push:
     new 0028bb4  ACCUMULO-4703 Upgraded bouncycastle to 1.58
0028bb4 is described below

commit 0028bb445bb5820f6fa36eba21f3236833790722
Author: Mike Miller <mmiller@apache.org>
AuthorDate: Tue Sep 19 17:28:20 2017 -0400

    ACCUMULO-4703 Upgraded bouncycastle to 1.58
---
 pom.xml                                                      |  2 +-
 .../main/java/org/apache/accumulo/test/util/CertUtils.java   | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/pom.xml b/pom.xml
index 2b36346..80a06be 100644
--- a/pom.xml
+++ b/pom.xml
@@ -118,7 +118,7 @@
     <apilyzer.ignoreDeprecated>false</apilyzer.ignoreDeprecated>
     <assembly.tarLongFileMode>posix</assembly.tarLongFileMode>
     <!-- bouncycastle version for test dependencies -->
-    <bouncycastle.version>1.54</bouncycastle.version>
+    <bouncycastle.version>1.58</bouncycastle.version>
     <!-- Curator version -->
     <curator.version>2.11.0</curator.version>
     <!-- relative path for Eclipse format; should override in child modules if necessary
-->
diff --git a/test/src/main/java/org/apache/accumulo/test/util/CertUtils.java b/test/src/main/java/org/apache/accumulo/test/util/CertUtils.java
index f2e1178..876a686 100644
--- a/test/src/main/java/org/apache/accumulo/test/util/CertUtils.java
+++ b/test/src/main/java/org/apache/accumulo/test/util/CertUtils.java
@@ -60,10 +60,10 @@ import org.bouncycastle.asn1.x509.Extension;
 import org.bouncycastle.asn1.x509.KeyUsage;
 import org.bouncycastle.cert.CertIOException;
 import org.bouncycastle.cert.X509CertificateHolder;
+import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;
 import org.bouncycastle.cert.jcajce.JcaX509ExtensionUtils;
 import org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder;
 import org.bouncycastle.jce.provider.BouncyCastleProvider;
-import org.bouncycastle.jce.provider.X509CertificateObject;
 import org.bouncycastle.operator.OperatorCreationException;
 import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder;
 import org.slf4j.Logger;
@@ -250,7 +250,7 @@ public class CertUtils {
     PrivateKey signerKey = findPrivateKey(signerKeystore, signerPasswordArray);
 
     KeyPair kp = generateKeyPair();
-    X509CertificateObject cert = generateCert(keyName, kp, false, signerCert.getPublicKey(),
signerKey);
+    Certificate cert = generateCert(kp, false, signerCert.getPublicKey(), signerKey);
 
     char[] password = keystorePassword.toCharArray();
     KeyStore keystore = KeyStore.getInstance(keystoreType);
@@ -270,7 +270,7 @@ public class CertUtils {
 
     KeyPair kp = generateKeyPair();
 
-    X509CertificateObject cert = generateCert(keyName, kp, true, kp.getPublic(), kp.getPrivate());
+    Certificate cert = generateCert(kp, true, kp.getPublic(), kp.getPrivate());
 
     char[] password = keystorePassword.toCharArray();
     KeyStore keystore = KeyStore.getInstance(keystoreType);
@@ -288,8 +288,8 @@ public class CertUtils {
     return gen.generateKeyPair();
   }
 
-  private X509CertificateObject generateCert(String keyName, KeyPair kp, boolean isCertAuthority,
PublicKey signerPublicKey, PrivateKey signerPrivateKey)
-      throws IOException, CertIOException, OperatorCreationException, CertificateException,
NoSuchAlgorithmException {
+  private Certificate generateCert(KeyPair kp, boolean isCertAuthority, PublicKey signerPublicKey,
PrivateKey signerPrivateKey) throws IOException,
+      CertIOException, OperatorCreationException, CertificateException, NoSuchAlgorithmException
{
     Calendar startDate = Calendar.getInstance();
     Calendar endDate = Calendar.getInstance();
     endDate.add(Calendar.YEAR, 100);
@@ -305,7 +305,7 @@ public class CertUtils {
       certGen.addExtension(Extension.keyUsage, true, new KeyUsage(KeyUsage.keyCertSign));
     }
     X509CertificateHolder cert = certGen.build(new JcaContentSignerBuilder(signingAlgorithm).build(signerPrivateKey));
-    return new X509CertificateObject(cert.toASN1Structure());
+    return new JcaX509CertificateConverter().getCertificate(cert);
   }
 
   static Certificate findCert(KeyStore keyStore) throws KeyStoreException {

-- 
To stop receiving notification emails like this one, please contact
['"commits@accumulo.apache.org" <commits@accumulo.apache.org>'].

Mime
View raw message