Add method to decrypt to stream.
[shibboleth/cpp-xmltooling.git] / xmltooling / encryption / Decrypter.h
index 4ae0885..9f4b1e4 100644 (file)
@@ -47,7 +47,7 @@ namespace xmlencryption {
          * 
          * @param credResolver  locked credential resolver to supply decryption keys
          * @param criteria      optional external criteria to use with resolver
-         * @param EKresolver    locates an EncryptedKey pertaining to the EncryptedData
+         * @param EKResolver    locates an EncryptedKey pertaining to the EncryptedData
          */
         Decrypter(
             const xmltooling::CredentialResolver* credResolver=NULL,
@@ -61,7 +61,7 @@ namespace xmlencryption {
         /**
          * Replace the current EncryptedKeyResolver interface, if any, with a new one.
          * 
-         * @param EKresolver  the EncryptedKeyResolver to attach 
+         * @param EKResolver  the EncryptedKeyResolver to attach 
          */
         void setEncryptedKeyResolver(const EncryptedKeyResolver* EKResolver) {
             m_EKResolver=EKResolver;
@@ -113,6 +113,24 @@ namespace xmlencryption {
         xercesc::DOMDocumentFragment* decryptData(const EncryptedData& encryptedData, const XMLCh* recipient=NULL);
         
         /**
+         * Decrypts the supplied information to an output stream.
+         *
+         * @param out           output stream to receive the decrypted data 
+         * @param encryptedData the data to decrypt
+         * @param key           the decryption key to use (it will not be freed internally)
+         */
+        void decryptData(std::ostream& out, const EncryptedData& encryptedData, XSECCryptoKey* key);
+
+        /**
+         * Decrypts the supplied information to an output stream.
+         *
+         * @param out           output stream to receive the decrypted data 
+         * @param encryptedData the data to decrypt
+         * @param recipient     identifier of decrypting entity for use in identifying multi-cast keys
+         */
+        void decryptData(std::ostream& out, const EncryptedData& encryptedData, const XMLCh* recipient=NULL);
+
+        /**
          * Decrypts the supplied information and returns the resulting key.
          * The caller is responsible for deleting the key. The algorithm of the
          * key must be supplied by the caller based on knowledge of the associated