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

pifta pushed a commit to branch HDDS-7391-ca-cert-rot
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/HDDS-7391-ca-cert-rot by this 
push:
     new defa383dcd HDDS-8587. Prepare CertificateClient to store more than one 
rootCA certificate (#4717)
defa383dcd is described below

commit defa383dcd8ab5d07a29ebbf450eba0bd2bbaa60
Author: Galsza <[email protected]>
AuthorDate: Tue Jun 6 18:18:23 2023 +0200

    HDDS-8587. Prepare CertificateClient to store more than one rootCA 
certificate (#4717)
---
 .../client/TestDefaultCertificateClient.java          | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git 
a/hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/security/x509/certificate/client/TestDefaultCertificateClient.java
 
b/hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/security/x509/certificate/client/TestDefaultCertificateClient.java
index e5a09530cf..5049d2d59e 100644
--- 
a/hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/security/x509/certificate/client/TestDefaultCertificateClient.java
+++ 
b/hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/security/x509/certificate/client/TestDefaultCertificateClient.java
@@ -336,6 +336,25 @@ public class TestDefaultCertificateClient {
         .toString()));
   }
 
+  @Test
+  public void testStoreMultipleRootCACertificate() throws Exception {
+    KeyPair keyPair = keyGenerator.generateKey();
+    X509Certificate cert1 = generateX509Cert(keyPair);
+    X509Certificate cert2 = generateX509Cert(keyPair);
+    X509Certificate cert3 = generateX509Cert(keyPair);
+
+    dnCertClient.storeCertificate(getPEMEncodedString(cert1), CAType.ROOT);
+    dnCertClient.storeCertificate(getPEMEncodedString(cert2), CAType.ROOT);
+    dnCertClient.storeCertificate(getPEMEncodedString(cert3), CAType.ROOT);
+
+    assertEquals(cert1, dnCertClient.getCertificate(cert1.getSerialNumber()
+        .toString()));
+    assertEquals(cert2, dnCertClient.getCertificate(cert2.getSerialNumber()
+        .toString()));
+    assertEquals(cert3, dnCertClient.getCertificate(cert3.getSerialNumber()
+        .toString()));
+  }
+
   @Test
   public void testInitCertAndKeypairValidationFailures() throws Exception {
     GenericTestUtils.LogCapturer dnClientLog = GenericTestUtils.LogCapturer


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to