Author: orudyy
Date: Thu Nov 26 14:25:30 2015
New Revision: 1716678

URL: http://svn.apache.org/viewvc?rev=1716678&view=rev
Log:
QPID-6906 : Allow for better management of ManagedPeerCertificateTrustStores
------------------------------------------------------------------------
Merged from trunk with command:
svn merge -c r1716277 https://svn.apache.org/repos/asf/qpid/java/trunk

Added:
    
qpid/java/branches/6.0.x/broker-core/src/main/java/org/apache/qpid/server/security/CertificateDetails.java
      - copied unchanged from r1716277, 
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/CertificateDetails.java
    
qpid/java/branches/6.0.x/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStoreImpl.java
      - copied unchanged from r1716277, 
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStoreImpl.java
    
qpid/java/branches/6.0.x/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/managedcertificatestore/
      - copied from r1716277, 
qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/store/managedcertificatestore/
    
qpid/java/branches/6.0.x/broker-plugins/management-http/src/main/java/resources/store/managedcertificatestore/
      - copied from r1716277, 
qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/store/managedcertificatestore/
Removed:
    
qpid/java/branches/6.0.x/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustsStoreImpl.java
Modified:
    qpid/java/branches/6.0.x/   (props changed)
    
qpid/java/branches/6.0.x/broker-core/src/main/java/org/apache/qpid/server/model/AttributeValueConverter.java
    
qpid/java/branches/6.0.x/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStore.java

Propchange: qpid/java/branches/6.0.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Nov 26 14:25:30 2015
@@ -9,5 +9,5 @@
 /qpid/branches/java-broker-vhost-refactor/java:1493674-1494547
 /qpid/branches/java-network-refactor/qpid/java:805429-821809
 /qpid/branches/qpid-2935/qpid/java:1061302-1072333
-/qpid/java/trunk:1715445-1715447,1715586,1715940,1716086-1716087,1716127-1716128,1716141,1716153,1716155,1716194,1716204,1716209,1716227
+/qpid/java/trunk:1715445-1715447,1715586,1715940,1716086-1716087,1716127-1716128,1716141,1716153,1716155,1716194,1716204,1716209,1716227,1716277
 /qpid/trunk/qpid:796646-796653

Modified: 
qpid/java/branches/6.0.x/broker-core/src/main/java/org/apache/qpid/server/model/AttributeValueConverter.java
URL: 
http://svn.apache.org/viewvc/qpid/java/branches/6.0.x/broker-core/src/main/java/org/apache/qpid/server/model/AttributeValueConverter.java?rev=1716678&r1=1716677&r2=1716678&view=diff
==============================================================================
--- 
qpid/java/branches/6.0.x/broker-core/src/main/java/org/apache/qpid/server/model/AttributeValueConverter.java
 (original)
+++ 
qpid/java/branches/6.0.x/broker-core/src/main/java/org/apache/qpid/server/model/AttributeValueConverter.java
 Thu Nov 26 14:25:30 2015
@@ -128,10 +128,11 @@ abstract class AttributeValueConverter<T
     };
 
 
-
-
     static final AttributeValueConverter<Certificate> CERTIFICATE_CONVERTER = 
new AttributeValueConverter<Certificate>()
     {
+        private static final String BEGIN_CERTIFICATE = "-----BEGIN 
CERTIFICATE-----\n";
+        private static final String END_CERTIFICATE = "\n-----END 
CERTIFICATE-----";
+
         private final CertificateFactory _certFactory;
 
         {
@@ -164,7 +165,17 @@ abstract class AttributeValueConverter<T
             }
             else if(value instanceof String)
             {
-                return 
convert(BINARY_CONVERTER.convert(AbstractConfiguredObject.interpolate(object, 
(String) value),object),object);
+                String strValue = AbstractConfiguredObject.interpolate(object, 
(String) value);
+                if(strValue.contains(BEGIN_CERTIFICATE))
+                {
+                    strValue = 
strValue.substring(strValue.indexOf(BEGIN_CERTIFICATE) + 
BEGIN_CERTIFICATE.length());
+                    if(strValue.contains(END_CERTIFICATE))
+                    {
+                        strValue = 
strValue.substring(0,strValue.indexOf(END_CERTIFICATE));
+                    }
+                    strValue = strValue.replaceAll("\\s","");
+                }
+                return convert(BINARY_CONVERTER.convert(strValue, 
object),object);
             }
             else if(value == null)
             {

Modified: 
qpid/java/branches/6.0.x/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStore.java
URL: 
http://svn.apache.org/viewvc/qpid/java/branches/6.0.x/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStore.java?rev=1716678&r1=1716677&r2=1716678&view=diff
==============================================================================
--- 
qpid/java/branches/6.0.x/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStore.java
 (original)
+++ 
qpid/java/branches/6.0.x/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStore.java
 Thu Nov 26 14:25:30 2015
@@ -23,8 +23,11 @@ package org.apache.qpid.server.security;
 import java.security.cert.Certificate;
 import java.util.List;
 
+import org.apache.qpid.server.model.DerivedAttribute;
 import org.apache.qpid.server.model.ManagedAttribute;
 import org.apache.qpid.server.model.ManagedObject;
+import org.apache.qpid.server.model.ManagedOperation;
+import org.apache.qpid.server.model.Param;
 import org.apache.qpid.server.model.TrustStore;
 
 @ManagedObject( category = false, type = 
ManagedPeerCertificateTrustStore.TYPE_NAME)
@@ -40,7 +43,12 @@ public interface ManagedPeerCertificateT
     @ManagedAttribute( oversize = true, defaultValue = "[]" )
     List<Certificate> getStoredCertificates();
 
-    void addCertificate(Certificate cert);
+    @ManagedOperation
+    void addCertificate(@Param(name="certificate") Certificate certificate);
 
+    @DerivedAttribute
+    List<CertificateDetails> getCertificateDetails();
 
+    @ManagedOperation
+    void removeCertificates(@Param(name="certificates") 
List<CertificateDetails> certificates);
 }



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

Reply via email to