/*
- * Copyright (c) 2004 Apple Computer, Inc. All Rights Reserved.
+ * Copyright (c) 2004,2008,2010 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
/*!
@header SecCmsEncoder.h
- @copyright 2004 Apple Computer, Inc. All Rights Reserved.
+ @Copyright (c) 2004,2008,2010 Apple Inc. All Rights Reserved.
@availability 10.4 and later
@abstract CMS message encoding
#define _SECURITY_SECCMSENCODER_H_ 1
#include <Security/SecCmsBase.h>
+#include <CoreFoundation/CFData.h>
#if defined(__cplusplus)
/*!
@function
@abstract Set up encoding of a CMS message.
+ @param cmsg The SecCmsMessageRef to be encoded.
@param outputfn callback function for delivery of BER-encoded output will
not be called if NULL.
@param outputarg first argument passed to outputfn when it is called.
- @param dest If non-NULL, pointer to a CSSM_DATA that will hold the
- BER-encoded output.
- @param destpoolp Pool to allocate BER-encoded output in.
+ @param outBer If non-NULL, a CFMutableDataRef to which the
+ BER-encoded output will be appended.
@param pwfn callback function for getting token password for enveloped
data content with a password recipient.
@param pwfn_arg first argument passed to pwfn when it is called.
@param encrypt_key_cb callback function for getting bulk key for encryptedData content.
@param encrypt_key_cb_arg first argument passed to encrypt_key_cb when it is
called.
- @param detached_digestalgs digest algorithms in detached_digests
- @param detached_digests digests from detached content (one for every element
- in detached_digestalgs).
@result On success a pointer to a SecCmsMessage containing the decoded message
is returned. On failure returns NULL. Call PR_GetError() to find out what
went wrong in this case.
extern OSStatus
SecCmsEncoderCreate(SecCmsMessageRef cmsg,
SecCmsContentCallback outputfn, void *outputarg,
- CSSM_DATA_PTR dest, SecArenaPoolRef destpoolp,
+ CFMutableDataRef outBer,
PK11PasswordFunc pwfn, void *pwfn_arg,
SecCmsGetDecryptKeyCallback encrypt_key_cb, void *encrypt_key_cb_arg,
- SECAlgorithmID **detached_digestalgs, CSSM_DATA_PTR *detached_digests,
SecCmsEncoderRef *outEncoder);
/*!
/*!
@function
@abstract BER Encode a CMS message.
+ @param cmsg The SecCmsMessageRef to be encoded.
+ @param input The inner content of the message.
+ @param outBer A CFMutableDataRef to which the
+ BER-encoded output will be appended.
@discussion BER Encode a CMS message, with input being the plaintext message and outBer being the output, stored in arena's pool.
*/
extern OSStatus
-SecCmsMessageEncode(SecCmsMessageRef cmsg, const CSSM_DATA *input, SecArenaPoolRef arena,
- CSSM_DATA_PTR outBer);
+SecCmsMessageEncode(SecCmsMessageRef cmsg, const SecAsn1Item *input,
+ CFMutableDataRef outBer);
+
#if defined(__cplusplus)
}