X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/d8f41ccd20de16f8ebe2ccc84d47bf1cb2b26bbb..0d4552ce43ff8bf2e8666a9c5c44c3590eb117a8:/sectask/SecTask.h diff --git a/sectask/SecTask.h b/sectask/SecTask.h index e98ff382..c1bf28a0 100644 --- a/sectask/SecTask.h +++ b/sectask/SecTask.h @@ -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@ * @@ -24,18 +24,27 @@ #ifndef _SECURITY_SECTASK_H_ #define _SECURITY_SECTASK_H_ +#include + #include #include -#if defined(__cplusplus) -extern "C" { -#endif +#include + +#if SEC_OS_OSX +#include +#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,22 @@ 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 +/*! + @function SecTaskGetCodeSignStatus + @abstract Return the code sign status flags + @param task A previously created SecTask object +*/ + +uint32_t SecTaskGetCodeSignStatus(SecTaskRef task) + API_AVAILABLE(ios(10.0), watchos(3.0), tvos(10.0), iosmac(11.0)) SPI_AVAILABLE(macos(10.5)); + + +CF_IMPLICIT_BRIDGING_DISABLED +CF_ASSUME_NONNULL_END + +__END_DECLS #endif /* !_SECURITY_SECTASK_H_ */