2 * Copyright (c) 2018 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@
24 #ifndef SecProtocolTypesPriv_h
25 #define SecProtocolTypesPriv_h
27 #include <Security/SecProtocolTypes.h>
31 SEC_ASSUME_NONNULL_BEGIN
34 * @function sec_identity_create_with_certificates_and_external_private_key
37 * Create an ARC-able `sec_identity_t` instance from an array of `SecCertificateRef`
38 * instances and blocks to be invoked for private key opertions. Callers may use this
39 * constructor to build a `sec_identity_t` instance with an external private key.
42 * An array of `SecCertificateRef` instances.
45 * A `sec_protocol_private_key_sign_t` block.
47 * @param decrypt_block
48 * A `sec_protocol_private_key_decrypt_t` block.
50 * @param operation_queue
51 * The `dispatch_queue_t` queue on which each private key operation is invoked.
53 * @return a `sec_identity_t` instance.
55 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
56 SEC_RETURNS_RETAINED _Nullable sec_identity_t
57 sec_identity_create_with_certificates_and_external_private_key(CFArrayRef certificates
,
58 sec_protocol_private_key_sign_t sign_block
,
59 sec_protocol_private_key_decrypt_t decrypt_block
,
60 dispatch_queue_t operation_queue
);
63 * @function sec_identity_copy_private_key_sign_block
66 * Copy a retained reference to the underlying `sec_protocol_private_key_sign_t` used by the identity.
69 * A `sec_identity_t` instance.
71 * @return a `sec_protocol_private_key_sign_t` block, or nil.
73 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
74 SEC_RETURNS_RETAINED _Nullable sec_protocol_private_key_sign_t
75 sec_identity_copy_private_key_sign_block(sec_identity_t identity
);
78 * @function sec_identity_copy_private_key_decrypt_block
81 * Copy a retained reference to the underlying `sec_protocol_private_key_decrypt_t` used by the identity.
84 * A `sec_identity_t` instance.
86 * @return a `sec_protocol_private_key_decrypt_t` block, or nil.
88 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
89 SEC_RETURNS_RETAINED _Nullable sec_protocol_private_key_decrypt_t
90 sec_identity_copy_private_key_decrypt_block(sec_identity_t identity
);
93 * @function sec_identity_copy_private_key_queue
96 * Copy a retained reference to the `dispatch_queue_t` to be used by external private key
100 * A `sec_identity_t` instance.
102 * @return a `dispatch_queue_t` queue, or nil.
104 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
105 SEC_RETURNS_RETAINED _Nullable dispatch_queue_t
106 sec_identity_copy_private_key_queue(sec_identity_t identity
);
109 * @function sec_identity_has_certificates
112 * Determine if the `sec_identity_t` has a list of certificates associated with it.
115 * A `sec_identity_t` instance.
117 * @return True if the identity has certificates associated with it, and false otherwise.
119 API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
121 sec_identity_has_certificates(sec_identity_t identity
);
123 SEC_ASSUME_NONNULL_END
127 #endif // SecProtocolTypesPriv_h