cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1520312 - in /cxf/trunk/services/xkms/xkms-x509-handlers/src: main/java/org/apache/cxf/xkms/x509/repo/file/ test/java/org/apache/cxf/xkms/x509/repo/file/ test/resources/store1/
Date Thu, 05 Sep 2013 13:59:47 GMT
Author: coheigea
Date: Thu Sep  5 13:59:46 2013
New Revision: 1520312

URL: http://svn.apache.org/r1520312
Log:
[CXF-5250] - Too long the cer file name generated by XKMS service

Added:
    cxf/trunk/services/xkms/xkms-x509-handlers/src/test/resources/store1/CN-www.issuer.com_L-CGN_ST-NRW_C-DE_O-Issuer-11688544847478700689.cer
      - copied, changed from r1520298, cxf/trunk/services/xkms/xkms-x509-handlers/src/test/resources/store1/CN-www.issuer.com_L-CGN_ST-NRW_C-DE_O-Issuer-11688544847478700689-CN-www.issuer.com_L-CGN_ST-NRW_C-DE_O-Issuer.cer
Removed:
    cxf/trunk/services/xkms/xkms-x509-handlers/src/test/resources/store1/CN-www.issuer.com_L-CGN_ST-NRW_C-DE_O-Issuer-11688544847478700689-CN-www.issuer.com_L-CGN_ST-NRW_C-DE_O-Issuer.cer
Modified:
    cxf/trunk/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/repo/file/FileCertificateRepo.java
    cxf/trunk/services/xkms/xkms-x509-handlers/src/test/java/org/apache/cxf/xkms/x509/repo/file/FileCertificateRepoTest.java

Modified: cxf/trunk/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/repo/file/FileCertificateRepo.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/repo/file/FileCertificateRepo.java?rev=1520312&r1=1520311&r2=1520312&view=diff
==============================================================================
--- cxf/trunk/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/repo/file/FileCertificateRepo.java
(original)
+++ cxf/trunk/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/repo/file/FileCertificateRepo.java
Thu Sep  5 13:59:46 2013
@@ -82,7 +82,7 @@ public class FileCertificateRepo impleme
         }
         try {
             File certFile = new File(storageDir + "/" + category,
-                                     getRelativePathForSubjectDn(id.getIdentifier(), cert));
+                                     getRelativePathForSubjectDn(cert));
             certFile.getParentFile().mkdirs();
             FileOutputStream fos = new FileOutputStream(certFile);
             BufferedOutputStream bos = new BufferedOutputStream(fos);
@@ -107,12 +107,11 @@ public class FileCertificateRepo impleme
         return result;
     }
 
-    public String getRelativePathForSubjectDn(String subjectDn, X509Certificate cert)
+    public String getRelativePathForSubjectDn(X509Certificate cert)
         throws URISyntaxException {
         BigInteger serialNumber = cert.getSerialNumber();
         String issuer = cert.getIssuerX500Principal().getName();
-        String path = convertDnForFileSystem(subjectDn) + "-" + serialNumber.toString() +
"-"
-                      + convertDnForFileSystem(issuer) + ".cer";
+        String path = convertDnForFileSystem(issuer) + "-" + serialNumber.toString() + ".cer";
         Pattern p = Pattern.compile("[a-zA-Z_0-9-_]");
         if (p.matcher(path).find()) {
             return path;

Modified: cxf/trunk/services/xkms/xkms-x509-handlers/src/test/java/org/apache/cxf/xkms/x509/repo/file/FileCertificateRepoTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/xkms/xkms-x509-handlers/src/test/java/org/apache/cxf/xkms/x509/repo/file/FileCertificateRepoTest.java?rev=1520312&r1=1520311&r2=1520312&view=diff
==============================================================================
--- cxf/trunk/services/xkms/xkms-x509-handlers/src/test/java/org/apache/cxf/xkms/x509/repo/file/FileCertificateRepoTest.java
(original)
+++ cxf/trunk/services/xkms/xkms-x509-handlers/src/test/java/org/apache/cxf/xkms/x509/repo/file/FileCertificateRepoTest.java
Thu Sep  5 13:59:46 2013
@@ -39,8 +39,8 @@ import org.junit.Test;
 
 public class FileCertificateRepoTest {
     private static final String EXAMPLE_SUBJECT_DN = "CN=www.issuer.com, L=CGN, ST=NRW, C=DE,
O=Issuer";
-    private static final String EXPECTED_CERT_FILE_NAME = "CN-www.issuer.com_L-CGN_ST-NRW_C-DE_O-Issuer-"
-                                + "11688544847478700689-CN-www.issuer.com_L-CGN_ST-NRW_C-DE_O-Issuer.cer";
+    private static final String EXPECTED_CERT_FILE_NAME = 
+        "CN-www.issuer.com_L-CGN_ST-NRW_C-DE_O-Issuer-11688544847478700689.cer";
 
     @Test
     public void testSaveAndFind() throws CertificateException, IOException {

Copied: cxf/trunk/services/xkms/xkms-x509-handlers/src/test/resources/store1/CN-www.issuer.com_L-CGN_ST-NRW_C-DE_O-Issuer-11688544847478700689.cer
(from r1520298, cxf/trunk/services/xkms/xkms-x509-handlers/src/test/resources/store1/CN-www.issuer.com_L-CGN_ST-NRW_C-DE_O-Issuer-11688544847478700689-CN-www.issuer.com_L-CGN_ST-NRW_C-DE_O-Issuer.cer)
URL: http://svn.apache.org/viewvc/cxf/trunk/services/xkms/xkms-x509-handlers/src/test/resources/store1/CN-www.issuer.com_L-CGN_ST-NRW_C-DE_O-Issuer-11688544847478700689.cer?p2=cxf/trunk/services/xkms/xkms-x509-handlers/src/test/resources/store1/CN-www.issuer.com_L-CGN_ST-NRW_C-DE_O-Issuer-11688544847478700689.cer&p1=cxf/trunk/services/xkms/xkms-x509-handlers/src/test/resources/store1/CN-www.issuer.com_L-CGN_ST-NRW_C-DE_O-Issuer-11688544847478700689-CN-www.issuer.com_L-CGN_ST-NRW_C-DE_O-Issuer.cer&r1=1520298&r2=1520312&rev=1520312&view=diff
==============================================================================
    (empty)



Mime
View raw message