added get_data() method
authorAndreas Steffen <andreas.steffen@strongswan.org>
Thu, 11 Oct 2007 14:38:46 +0000 (14:38 -0000)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Thu, 11 Oct 2007 14:38:46 +0000 (14:38 -0000)
src/libstrongswan/crypto/pkcs7.c
src/libstrongswan/crypto/pkcs7.h

index 5c9550a..7fbc1e3 100644 (file)
@@ -611,6 +611,14 @@ failed:
 }
 
 /**
+ * Implements pkcs7_t.get_data
+ */
+static chunk_t get_data(private_pkcs7_t *this)
+{
+       return this->data;
+}
+
+/**
  * Implements pkcs7_t.destroy
  */
 static void destroy(private_pkcs7_t *this)
@@ -681,6 +689,7 @@ pkcs7_t *pkcs7_create_from_chunk(chunk_t chunk, u_int level)
        this->public.parse_data = (bool (*) (pkcs7_t*))parse_data;
        this->public.parse_signedData = (bool (*) (pkcs7_t*,x509_t*))parse_signedData;
        this->public.parse_envelopedData = (bool (*) (pkcs7_t*,chunk_t,rsa_private_key_t*))parse_envelopedData;
+       this->public.get_data = (chunk_t (*) (pkcs7_t*))get_data;
        this->public.destroy = (void (*) (pkcs7_t*))destroy;
 
        if (!parse_contentInfo(chunk, level, this))
index 705e8e3..c8473c5 100644 (file)
@@ -97,8 +97,16 @@ struct pkcs7_t {
        bool (*parse_envelopedData) (pkcs7_t *this, chunk_t serialNumber, rsa_private_key_t *key);
 
        /**
+        * @brief Returns the parsed data object
+        *
+        * @param this                  calling object
+        * @return                              chunk containing the data object
+        */
+       chunk_t (*get_data) (pkcs7_t *this);
+
+       /**
         * @brief Destroys the contentInfo object.
-        * 
+        *
         * @param this                  PKCS#7 contentInfo object to destroy
         */
        void (*destroy) (pkcs7_t *this);