]> git.saurik.com Git - apple/security.git/blobdiff - OSX/libsecurity_smime/lib/SecCMS.h
Security-57740.51.3.tar.gz
[apple/security.git] / OSX / libsecurity_smime / lib / SecCMS.h
index cb88a9bac0649a88f30b71cce696dc43d52c786c..52ca2d729cc4d46e7761c238b975c0330367a3f4 100644 (file)
@@ -43,6 +43,10 @@ extern const void * kSecCMSHashingAlgorithmSHA256;
 extern const void * kSecCMSHashingAlgorithmSHA384;
 extern const void * kSecCMSHashingAlgorithmSHA512;
 
+extern const void * kSecCMSBulkEncryptionAlgorithm;
+extern const void * kSecCMSEncryptionAlgorithmDESCBC;
+extern const void * kSecCMSEncryptionAlgorithmAESCBC;
+
 /* Return an array of certificates contained in message, if message is of the
  type SignedData and has no signers, return NULL otherwise.   Not that if
  the message is properly formed but has no certificates an empty array will
@@ -107,4 +111,30 @@ OSStatus SecCMSCreateSignedData(SecIdentityRef identity, CFDataRef data,
                                 CFDictionaryRef parameters, CFDictionaryRef signed_attributes,
                                 CFMutableDataRef signed_data);
 
+/*!
+ @function SecCMSCreateEnvelopedData
+ @abstract create a enveloped cms blob for recipients
+ @param recipient_or_cfarray_thereof SecCertificateRef for each recipient
+ @param params CFDictionaryRef with encryption parameters
+ @param data Data to be encrypted
+ @param enveloped_data (output) return enveloped message.
+ @result A result code.  See "Security Error Codes" (SecBase.h).
+ errSecParam garbage in, garbage out.
+ */
+OSStatus SecCMSCreateEnvelopedData(CFTypeRef recipient_or_cfarray_thereof,
+                                   CFDictionaryRef params, CFDataRef data, CFMutableDataRef enveloped_data);
+
+
+/*!
+ @function SecCMSDecryptEnvelopedData
+ @abstract open an enveloped cms blob. expects recipients identity in keychain.
+ @param message Eveloped message
+ @param data (output) return decrypted message.
+ @param recipient (output/optional) return addressed recipient
+ @result A result code.  See "Security Error Codes" (SecBase.h).
+ errSecParam garbage in, garbage out.
+ */
+OSStatus SecCMSDecryptEnvelopedData(CFDataRef message,
+                                    CFMutableDataRef data, SecCertificateRef *recipient);
+
 #endif