]>
git.saurik.com Git - apple/security.git/blob - AppleCSP/AppleCSP/pkcs_7_8.h
669ceb0d569c9f063fcaa8442c79891c7ea8562a
2 * Copyright (c) 2000-2001 Apple Computer, Inc. All Rights Reserved.
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
20 // pkcs_7_8.h - encode/decode key blobs in PKCS7 and
27 #include <Security/cssmtype.h>
28 #include <Security/utilities.h>
29 #include <Security/cssmalloc.h>
36 * Given a symmetric CssmKey in raw format, and its encrypted blob,
37 * cook up a PKCS-7 encoded blob.
40 CSSM_ALGORITHMS alg
, // encryption alg, used by PKCS7
41 CSSM_ENCRYPT_MODE mode
, // ditto
42 const CssmData
&encryptedBlob
,
43 CssmData
&encodedBlob
, // mallocd and RETURNED
44 CssmAllocator
&allocator
);
47 * Given a symmetric key in (encrypted, encoded) PKCS-7 format,
48 * obtain its encrypted key blob.
51 const CssmKey
&wrappedKey
, // for inferring format
52 CssmData
&decodedBlob
, // mallocd and RETURNED
53 CSSM_KEYBLOB_FORMAT
&format
, // RETURNED
54 CssmAllocator
&allocator
);
57 * Given an asymmetric CssmKey in raw format, and its encrypted blob,
58 * cook up a PKCS-8 encoded blob.
61 CSSM_ALGORITHMS alg
, // encryption alg, used by PKCS8
62 CSSM_ENCRYPT_MODE mode
, // ditto
63 const CssmData
&encryptedBlob
,
64 CssmData
&encodedBlob
, // mallocd and RETURNED
65 CssmAllocator
&allocator
);
68 * Given a an asymmetric key in (encrypted, encoded) PKCS-8 format,
69 * obtain its encrypted key blob.
72 const CssmKey
&wrappedKey
, // for inferring format
73 CssmData
&decodedBlob
, // mallocd and RETURNED
74 CSSM_KEYBLOB_FORMAT
&format
, // RETURNED
75 CssmAllocator
&allocator
);
81 #endif /* _PKCS_7_8_H_ */