2 * Copyright (c) 2002-2011,2012-2013,2016 Apple Inc. All Rights Reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
25 @header SecIdentityPriv
26 The functions provided in SecIdentityPriv.h implement a convenient way to
27 match private keys with certificates.
30 #ifndef _SECURITY_SECIDENTITYPRIV_H_
31 #define _SECURITY_SECIDENTITYPRIV_H_
33 #include <Security/SecBase.h>
34 #include <Security/SecBasePriv.h>
35 #include <CoreFoundation/CFBase.h>
39 /*! @function SecIdentityCreate
40 @abstract create a new identity object from the provided certificate and its associated private key.
41 @param allocator CFAllocator to allocate the identity object. Pass NULL to use the default allocator.
42 @param certificate A certificate reference.
43 @param privateKey A private key reference.
44 @result An identity reference.
46 SecIdentityRef
SecIdentityCreate(
47 CFAllocatorRef allocator
,
48 SecCertificateRef certificate
,
50 __SEC_MAC_AND_IOS_UNKNOWN
;
51 //__OSX_AVAILABLE_STARTING(__MAC_10_3, __SEC_IPHONE_UNKNOWN);
55 @function ConvertArrayToKeyUsage
56 @abstract Given an array of key usages defined in SecItem.h return the equivalent CSSM_KEYUSE
57 @param usage An CFArrayRef containing CFTypeRefs defined in SecItem.h
65 If the CFArrayRef is NULL then the CSSM_KEYUSAGE will be CSSM_KEYUSE_ANY
66 @result A CSSM_KEYUSE. Derived from the passed in Array
68 CSSM_KEYUSE
ConvertArrayToKeyUsage(CFArrayRef usage
)
69 __SEC_MAC_ONLY_UNKNOWN
;
74 #endif /* _SECURITY_SECIDENTITYPRIV_H_ */