This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/1.8 by this push:
     new b12daf1  ACCUMULO-4817 Fix bouncycastle deprecation warning
b12daf1 is described below

commit b12daf1c06a64fe3941f82b7d64a1c11c1e663f0
Author: Christopher Tubbs <ctubb...@apache.org>
AuthorDate: Fri Feb 23 16:02:46 2018 -0500

    ACCUMULO-4817 Fix bouncycastle deprecation warning
    
    * Remove use of deprecated bouncycastle library calls
    * Fix empty paragraph javadoc warning
---
 .../org/apache/accumulo/core/client/ClientConfiguration.java   |  1 -
 .../src/main/java/org/apache/accumulo/test/util/CertUtils.java | 10 +++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git 
a/core/src/main/java/org/apache/accumulo/core/client/ClientConfiguration.java 
b/core/src/main/java/org/apache/accumulo/core/client/ClientConfiguration.java
index 51e818e..a8622be 100644
--- 
a/core/src/main/java/org/apache/accumulo/core/client/ClientConfiguration.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/client/ClientConfiguration.java
@@ -242,7 +242,6 @@ public class ClientConfiguration extends 
CompositeConfiguration {
    * <p>
    * A client configuration will then be read from each location using 
<em>PropertiesConfiguration</em> to construct a configuration. That means the 
latest item
    * will be the one in the configuration.
-   * <p>
    *
    * @see PropertiesConfiguration
    * @see File#pathSeparator
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 a49e1cd..6c55b43 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
@@ -59,10 +59,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(keyName, 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(keyName, kp, true, kp.getPublic(), 
kp.getPrivate());
 
     char[] password = keystorePassword.toCharArray();
     KeyStore keystore = KeyStore.getInstance(keystoreType);
@@ -288,7 +288,7 @@ public class CertUtils {
     return gen.generateKeyPair();
   }
 
-  private X509CertificateObject generateCert(String keyName, KeyPair kp, 
boolean isCertAuthority, PublicKey signerPublicKey, PrivateKey signerPrivateKey)
+  private Certificate generateCert(String keyName, KeyPair kp, boolean 
isCertAuthority, PublicKey signerPublicKey, PrivateKey signerPrivateKey)
       throws IOException, CertIOException, OperatorCreationException, 
CertificateException, NoSuchAlgorithmException {
     Calendar startDate = Calendar.getInstance();
     Calendar endDate = Calendar.getInstance();
@@ -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
ctubb...@apache.org.

Reply via email to