Refactor extraction of certificate details.
[shibboleth/xmltooling.git] / xmltooling / security / X509Credential.h
index 764d82f..387dc72 100644 (file)
@@ -26,7 +26,6 @@
 #include <xmltooling/security/Credential.h>
 #include <xmltooling/security/XSECCryptoX509CRL.h>
 
-#include <vector>
 #include <xsec/enc/XSECCryptoX509.hpp>
 
 namespace xmltooling {
@@ -42,9 +41,12 @@ namespace xmltooling {
     public:
         virtual ~X509Credential() {}
 
+        /**
+         * Bitmask constants for limiting resolution process inside a CredentialResolver. 
+         */
         enum ResolveTypes {
-            RESOLVE_CERTS = 2,
-            RESOLVE_CRLS = 4
+            RESOLVE_CERTS = 4,
+            RESOLVE_CRLS = 8
         };
 
         /**
@@ -61,6 +63,32 @@ namespace xmltooling {
          * @return CRL associated with the credential
          */
         virtual XSECCryptoX509CRL* getCRL() const=0;
+
+        /**
+         * Gets the subject name of the first certificate in the chain.
+         *
+         * @return the Subject DN
+         */
+        virtual const char* getSubjectName() const=0;
+
+        /**
+         * Gets the issuer name of the first certificate in the chain.
+         *
+         * @return the Issuer DN
+         */
+        virtual const char* getIssuerName() const=0;
+
+        /**
+         * Gets the serial number of the first certificate in the chain.
+         *
+         * @return the serial number
+         */
+        virtual int getSerialNumber() const=0;
+
+        /**
+         * Extracts properties like issuer and subject from the first certificate in the chain.
+         */
+        virtual void extract()=0;
     };
 };