]> git.saurik.com Git - apple/security.git/blobdiff - sectask/SecTask.h
Security-58286.260.20.tar.gz
[apple/security.git] / sectask / SecTask.h
index e98ff382d60846ce90fa71884d3869c1c915cbd5..93022dff3756fbebf600be94764e7da86b32b276 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008,2012-2013 Apple Inc. All Rights Reserved.
+ * Copyright (c) 2008,2012-2016 Apple Inc. All Rights Reserved.
  * 
  * @APPLE_LICENSE_HEADER_START@
  * 
 #ifndef _SECURITY_SECTASK_H_
 #define _SECURITY_SECTASK_H_
 
+#include <Security/SecBase.h>
+
 #include <CoreFoundation/CoreFoundation.h>
 #include <mach/message.h>
 
-#if defined(__cplusplus)
-extern "C" {
-#endif
+#include <sys/cdefs.h>
+
+#if SEC_OS_OSX
+#include <Security/SecCode.h>
+#endif /* SEC_OS_OSX */
+
+__BEGIN_DECLS
+
+CF_ASSUME_NONNULL_BEGIN
+CF_IMPLICIT_BRIDGING_ENABLED
 
 /*!
     @typedef SecTaskRef
     @abstract CFType used for representing a task
 */
-typedef struct __SecTask *SecTaskRef;
+typedef struct CF_BRIDGED_TYPE(id) __SecTask *SecTaskRef;
 
 /*!
     @function SecTaskGetTypeID
@@ -52,15 +61,18 @@ CFTypeID SecTaskGetTypeID(void);
     @result The newly created SecTask object or NULL on error.  The caller must
     CFRelease the returned object.
 */
-SecTaskRef SecTaskCreateWithAuditToken(CFAllocatorRef allocator, audit_token_t token);
+__nullable
+SecTaskRef SecTaskCreateWithAuditToken(CFAllocatorRef __nullable allocator, audit_token_t token);
 
 /*!
-     @function SecTaskCreateFromSelf
-     @abstract Create a SecTask object for the current task.
-     @result The newly created SecTask object or NULL on error.  The caller must
-     CFRelease the returned object.
- */
-SecTaskRef SecTaskCreateFromSelf(CFAllocatorRef allocator);
+    @function SecTaskCreateFromSelf
+    @abstract Create a SecTask object for the current task.
+    @result The newly created SecTask object or NULL on error.  The caller must
+    CFRelease the returned object.
+#ifndef LEFT
+*/
+__nullable
+SecTaskRef SecTaskCreateFromSelf(CFAllocatorRef __nullable allocator);
 
 /*!
     @function SecTaskCopyValueForEntitlement
@@ -79,6 +91,7 @@ SecTaskRef SecTaskCreateFromSelf(CFAllocatorRef allocator);
     the entitlement is simply not present.  In the latter case, no CFError is
     returned.
 */
+__nullable
 CFTypeRef SecTaskCopyValueForEntitlement(SecTaskRef task, CFStringRef entitlement, CFErrorRef *error);
 
 /*!
@@ -93,6 +106,7 @@ CFTypeRef SecTaskCopyValueForEntitlement(SecTaskRef task, CFStringRef entitlemen
     returned dictionary, the entitlement is not set on the task.  The caller
     must CFRelease the returned value
 */
+__nullable
 CFDictionaryRef SecTaskCopyValuesForEntitlements(SecTaskRef task, CFArrayRef entitlements, CFErrorRef *error);
 
 /*!
@@ -103,10 +117,23 @@ CFDictionaryRef SecTaskCopyValuesForEntitlements(SecTaskRef task, CFArrayRef ent
     the problem.  This argument may be NULL if the caller is not interested in
     detailed errors. The caller must CFRelease the returned value
 */
+__nullable
 CFStringRef SecTaskCopySigningIdentifier(SecTaskRef task, CFErrorRef *error);
 
-#if defined(__cplusplus)
-}
-#endif
+#if SEC_OS_IPHONE
+/*!
+    @function SecTaskGetCodeSignStatus
+    @abstract Return the code sign status flags
+    @param task A previously created SecTask object
+*/
+
+uint32_t SecTaskGetCodeSignStatus(SecTaskRef task);
+#endif /* SEC_OS_IPHONE */
+
+
+CF_IMPLICIT_BRIDGING_DISABLED
+CF_ASSUME_NONNULL_END
+
+__END_DECLS
 
 #endif /* !_SECURITY_SECTASK_H_ */