Unnamed: 0
int64 0
0
| repo_id
stringlengths 5
186
| file_path
stringlengths 15
223
| content
stringlengths 1
32.8M
⌀ |
---|---|---|---|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/cssmaci.h | /*
* Copyright (c) 1999-2001,2004,2011,2014 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*
* cssmaci.h -- Sevice Provider Interface for Access Control Module
*/
#ifndef _CSSMACI_H_
#define _CSSMACI_H_ 1
#include <Security/cssmtype.h>
#ifdef __cplusplus
extern "C" {
#endif
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_spi_ac_funcs {
CSSM_RETURN (CSSMACI *AuthCompute)
(CSSM_AC_HANDLE ACHandle,
const CSSM_TUPLEGROUP *BaseAuthorizations,
const CSSM_TUPLEGROUP *Credentials,
uint32 NumberOfRequestors,
const CSSM_LIST *Requestors,
const CSSM_LIST *RequestedAuthorizationPeriod,
const CSSM_LIST *RequestedAuthorization,
CSSM_TUPLEGROUP_PTR AuthorizationResult);
CSSM_RETURN (CSSMACI *PassThrough)
(CSSM_AC_HANDLE ACHandle,
CSSM_TP_HANDLE TPHandle,
CSSM_CL_HANDLE CLHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_DL_DB_LIST *DBList,
uint32 PassThroughId,
const void *InputParams,
void **OutputParams);
} CSSM_SPI_AC_FUNCS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_SPI_AC_FUNCS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
#pragma clang diagnostic pop
#ifdef __cplusplus
}
#endif
#endif /* _CSSMACI_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecCustomTransform.h | /*
* Copyright (c) 2010-2011,2014 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _SEC_CUSTOM_TRANSFORM_H__
#define _SEC_CUSTOM_TRANSFORM_H__
#include <Security/SecTransform.h>
// Blocks are required for custom transforms
#ifdef __BLOCKS__
CF_EXTERN_C_BEGIN
CF_ASSUME_NONNULL_BEGIN
CF_IMPLICIT_BRIDGING_ENABLED
/*!
@header
Custom transforms are an API that provides the ability to easily create new
transforms. The essential functions of a transform are created in a
collection of blocks. These blocks override the standard behavior of the
base transform; a custom transform with no overrides is a null transform
that merely passes through a data flow.
A new transform type is created when calling the SecTransformRegister
function which registers the name of the new transform and sets up its
overrides. The SecTransformCreate function creates a new instance of a
registered custom transform.
A sample custom transform is provided here, along with a basic test program.
This transform creates a Caesar cipher transform, one that simply adds a
value to every byte of the plaintext.
-----cut here-----
<pre>
@textblock
//
// CaesarXform.c
//
// Copyright (c) 2010-2011,2014 Apple Inc. All Rights Reserved.
//
//
#include <Security/SecCustomTransform.h>
#include <Security/SecTransform.h>
// This is the unique name for the custom transform type.
const CFStringRef kCaesarCipher = CFSTR("com.apple.caesarcipher");
// Name of the "key" attribute.
const CFStringRef kKeyAttributeName = CFSTR("key");
// Shortcut to return a CFError.
CFErrorRef invalid_input_error(void)
{
return CFErrorCreate(kCFAllocatorDefault, kSecTransformErrorDomain,
kSecTransformErrorInvalidInput, NULL);
}
// =========================================================================
// Implementation of the Transform instance
// =========================================================================
static SecTransformInstanceBlock CaesarImplementation(CFStringRef name,
SecTransformRef newTransform,
SecTransformImplementationRef ref)
{
SecTransformInstanceBlock instanceBlock =
^{
CFErrorRef result = NULL;
// Every time a new instance of this custom transform class is
// created, this block is called. This behavior means that any
// block variables created in this block act like instance
// variables for the new custom transform instance.
__block int _key = 0;
result = SecTransformSetAttributeAction(ref,
kSecTransformActionAttributeNotification,
kKeyAttributeName,
^(SecTransformAttributeRef name, CFTypeRef d)
{
CFNumberGetValue((CFNumberRef)d, kCFNumberIntType, &_key);
return d;
});
if (result)
return result;
// Create an override that will be called to process the input
// data into the output data
result = SecTransformSetDataAction(ref,
kSecTransformActionProcessData,
^(CFTypeRef d)
{
if (NULL == d) // End of stream?
return (CFTypeRef) NULL; // Just return a null.
char *dataPtr = (char *)CFDataGetBytePtr((CFDataRef)d);
CFIndex dataLength = CFDataGetLength((CFDataRef)d);
// Do the processing in memory. There are better ways to do
// this but for showing how custom transforms work this is fine.
char *buffer = (char *)malloc(dataLength);
if (NULL == buffer)
return (CFTypeRef) invalid_input_error(); // Return a CFErrorRef
// Do the work of the caesar cipher (Rot(n))
CFIndex i;
for (i = 0; i < dataLength; i++)
buffer[i] = dataPtr[i] + _key;
return (CFTypeRef)CFDataCreateWithBytesNoCopy(NULL, (UInt8 *)buffer,
dataLength, kCFAllocatorMalloc);
});
return result;
};
return Block_copy(instanceBlock);
}
SecTransformRef CaesarTransformCreate(CFIndex k, CFErrorRef* error)
{
SecTransformRef caesarCipher;
__block Boolean result = 1;
static dispatch_once_t registeredOK = 0;
dispatch_once(®isteredOK,
^{
result = SecTransformRegister(kCaesarCipher, &CaesarImplementation, error);
});
if (!result)
return NULL;
caesarCipher = SecTransformCreate(kCaesarCipher, error);
if (NULL != caesarCipher)
{
CFNumberRef keyNumber = CFNumberCreate(kCFAllocatorDefault,
kCFNumberIntType, &k);
SecTransformSetAttribute(caesarCipher, kKeyAttributeName,
keyNumber, error);
CFRelease(keyNumber);
}
return caesarCipher;
}
// The second function shows how to use custom transform defined in the
// previous function
// =========================================================================
// Use a custom ROT-N (caesar cipher) transform
// =========================================================================
CFDataRef TestCaesar(CFDataRef theData, int rotNumber)
{
CFDataRef result = NULL;
CFErrorRef error = NULL;
if (NULL == theData)
return result;
// Create an instance of the custom transform
SecTransformRef caesarCipher = CaesarTransformCreate(rotNumber, &error);
if (NULL == caesarCipher || NULL != error)
return result;
// Set the data to be transformed as the input to the custom transform
SecTransformSetAttribute(caesarCipher,
kSecTransformInputAttributeName, theData, &error);
if (NULL != error)
{
CFRelease(caesarCipher);
return result;
}
// Execute the transform synchronously
result = (CFDataRef)SecTransformExecute(caesarCipher, &error);
CFRelease(caesarCipher);
return result;
}
#include <CoreFoundation/CoreFoundation.h>
int main (int argc, const char *argv[])
{
CFDataRef testData, testResult;
UInt8 bytes[26];
int i;
// Create some test data, a string from A-Z
for (i = 0; i < sizeof(bytes); i++)
bytes[i] = 'A' + i;
testData = CFDataCreate(kCFAllocatorDefault, bytes, sizeof(bytes));
CFRetain(testData);
CFShow(testData);
// Encrypt the test data
testResult = TestCaesar(testData, 3);
CFShow(testResult);
CFRelease(testData);
CFRelease(testResult);
return 0;
}
@/textblock
</pre>
*/
/**************** Custom Transform attribute metadata ****************/
/*!
@enum Custom Transform Attribute Metadata
@discussion
Within a transform, each of its attributes is a collection of
"metadata attributes", of which name and current value are two. The
value is directly visible from outside; the other metadata
attributes direct the behavior of the transform and
its function within its group. Each attribute may be tailored by setting its metadata.
@const kSecTransformMetaAttributeValue
The actual value of the attribute. The attribute value has a default
value of NULL.
@const kSecTransformMetaAttributeName
The name of the attribute. Attribute name is read only and may
not be used with the SecTransformSetAttributeBlock block.
@const kSecTransformMetaAttributeRef
A direct reference to an attribute's value. This reference allows
for direct access to an attribute without having to look up the
attribute by name. If a transform commonly uses an attribute, using
a reference speeds up the use of that attribute. Attribute
references are not visible or valid from outside of the particular
transform instance.
@const kSecTransformMetaAttributeRequired
Specifies if an attribute must have a non NULL value set or have an
incoming connection before the transform starts to execute. This
metadata has a default value of true for the input attribute, but
false for all other attributes.
@const kSecTransformMetaAttributeRequiresOutboundConnection
Specifies if an attribute must have an outbound connection. This
metadata has a default value of true for the output attribute but is
false for all other attributes.
@const kSecTransformMetaAttributeDeferred
Determines if the AttributeSetNotification notification or the
ProcessData blocks are deferred until SecExecuteTransform is called.
This metadata value has a default value of true for the input
attribute but is false for all other attributes.
@const kSecTransformMetaAttributeStream
Specifies if the attribute should expect a series of values ending
with a NULL to specify the end of the data stream. This metadata has
a default value of true for the input and output attributes, but is
false for all other attributes.
@const kSecTransformMetaAttributeCanCycle
A Transform group is a directed graph which is typically acyclic.
Some transforms need to work with cycles. For example, a transform
that emits a header and trailer around the data of another transform
must create a cycle. If this metadata set to true, no error is
returned if a cycle is detected for this attribute.
@const kSecTransformMetaAttributeExternalize
Specifies if this attribute should be written out when creating the
external representation of this transform. This metadata has a
default value of true.
@const kSecTransformMetaAttributeHasOutboundConnections
This metadata value is true if the attribute has an outbound
connection. This metadata is read only.
@const kSecTransformMetaAttributeHasInboundConnection
This metadata value is true if the attribute has an inbound
connection. This metadata is read only.
*/
typedef CF_ENUM(CFIndex, SecTransformMetaAttributeType)
{
kSecTransformMetaAttributeValue,
kSecTransformMetaAttributeName,
kSecTransformMetaAttributeRef,
kSecTransformMetaAttributeRequired,
kSecTransformMetaAttributeRequiresOutboundConnection,
kSecTransformMetaAttributeDeferred,
kSecTransformMetaAttributeStream,
kSecTransformMetaAttributeCanCycle,
kSecTransformMetaAttributeExternalize,
kSecTransformMetaAttributeHasOutboundConnections,
kSecTransformMetaAttributeHasInboundConnection
};
/*!
@typedef SecTransformAttributeRef
@abstract A direct reference to an attribute. Using an attribute
reference speeds up using an attribute's value by removing
the need to look
it up by name.
*/
typedef CFTypeRef SecTransformAttributeRef;
/*!
@typedef SecTransformStringOrAttributeRef
@abstract This type signifies that either a CFStringRef or
a SecTransformAttributeRef may be used.
*/
typedef CFTypeRef SecTransformStringOrAttributeRef;
/*!
@typedef SecTransformActionBlock
@abstract A block that overrides the default behavior of a
custom transform.
@result If this block is used to overide the
kSecTransformActionExternalizeExtraData action then the
block should return a CFDictinaryRef of the custom
items to be exported. For all of other actions the
block should return NULL. If an error occurs for
any action, the block should return a CFErrorRef.
@discussion A SecTransformTransformActionBlock block is used to
override
the default behavior of a custom transform. This block is
associated with the SecTransformOverrideTransformAction
block.
The behaviors that can be overridden are:
kSecTransformActionCanExecute
Determine if the transform has all of the data
needed to run.
kSecTransformActionStartingExecution
Called just before running ProcessData.
kSecTransformActionFinalize
Called just before deleting the custom transform.
kSecTransformActionExternalizeExtraData
Called to allow for writing out custom data
to be exported.
Example:
<pre>
@textblock
SecTransformImplementationRef ref;
CFErrorRef error = NULL;
error = SecTransformSetTransformAction(ref, kSecTransformActionStartingExecution,
^{
// This is where the work to initialize any data needed
// before running
CFErrorRef result = DoMyInitialization();
return result;
});
SecTransformTransformActionBlock actionBlock =
^{
// This is where the work to clean up any existing data
// before running
CFErrorRef result = DoMyFinalization();
return result;
};
error = SecTransformSetTransformAction(ref, kSecTransformActionFinalize,
actionBlock);
@/textblock
</pre>
*/
typedef CFTypeRef __nullable (^SecTransformActionBlock)(void);
/*!
@typedef SecTransformAttributeActionBlock
@abstract A block used to override the default attribute handling
for when an attribute is set.
@param attribute The attribute whose default is being overridden or NULL
if this is a generic notification override
@param value Proposed new value for the attribute.
@result The new value of the attribute if successful. If an
error occurred then a CFErrorRef is returned. If a transform
needs to have a CFErrorRef as the value of an attribute,
then the CFErrorRef needs to be placed into a container such
as a CFArrayRef, CFDictionaryRef etc.
@discussion See the example program in this header for more details.
*/
typedef CFTypeRef __nullable (^SecTransformAttributeActionBlock)(
SecTransformAttributeRef attribute,
CFTypeRef value);
/*!
@typedef SecTransformDataBlock
@abstract A block used to override the default data handling
for a transform.
@param data The data to be processed. When this block is used
to to implement the kSecTransformActionProcessData action,
the data is the input data that is to be processed into the
output data. When this block is used to implement the
kSecTransformActionInternalizeExtraData action, the data is
a CFDictionaryRef that contains the data that needs to be
imported.
@result When this block is used to implment the
kSecTransformActionProcessData action, the value returned
is to be the data that will be passed to the output
attribute. If an error occured while processing the input
data then the block should return a CFErrorRef.
When this block is used to implement the
kSecTransformActionInternalizeExtraData action then this block
should return NULL or a CFErrorRef if an error occurred.
@discussion See the example program for more details.
*/
typedef CFTypeRef __nullable (^SecTransformDataBlock)(CFTypeRef data);
/*!
@typedef SecTransformInstanceBlock
@abstract This is the block that is returned from an
implementation of a CreateTransform function.
@result A CFErrorRef if an error occurred or NULL.
@discussion The instance block that is returned from the
developers CreateTransform function, defines
the behavior of a custom attribute. Please
see the example at the head of this file.
*/
typedef CFErrorRef __nullable (^SecTransformInstanceBlock)(void);
/*!
@typedef SecTransformImplementationRef
@abstract The SecTransformImplementationRef is a pointer to a block
that implements an instance of a transform.
*/
typedef const struct OpaqueSecTransformImplementation* SecTransformImplementationRef;
/*!
@function SecTransformSetAttributeAction
@abstract Be notified when a attribute is set. The supplied block is
called when the attribute is set. This can be done for a
specific named attribute or all attributes.
@param ref A SecTransformImplementationRef that is bound to an instance
of a custom transform.
@param action The behavior to be set. This can be one of the following
actions:
kSecTransformActionAttributeNotification - add a block that
is called when an attribute is set. If the name is NULL,
then the supplied block is called for all set attributes
except for ones that have a specific block as a handler.
For example, if there is a handler for the attribute "foo"
and for all attributes, the "foo" handler is called when the
"foo" attribute is set, but all other attribute sets will
call the NULL handler.
The kSecTransformActionProcessData action is a special case
of a SecTransformSetAttributeAction action. If this is
called on the input attribute then it will overwrite any
kSecTransformActionProcessData that was set.
kSecTransformActionAttributeValidation Add a block that is
called to validate the input to an attribute.
@param attribute
The name of the attribute that will be handled. An attribute
reference may also be given here. A NULL name indicates that
the supplied action is for all attributes.
@param newAction
A SecTransformAttributeActionBlock which implements the
behavior.
@result A CFErrorRef if an error occured NULL otherwise.
@discussion This function may be called multiple times for either a
named attribute or for all attributes when the attribute
parameter is NULL. Each time the API is called it overwrites
what was there previously.
*/
CF_EXPORT __nullable
CFErrorRef SecTransformSetAttributeAction(SecTransformImplementationRef ref,
CFStringRef action,
SecTransformStringOrAttributeRef __nullable attribute,
SecTransformAttributeActionBlock newAction);
/*!
@function SecTransformSetDataAction
@abstract Change the way a custom transform will do data processing.
When the action parameter is kSecTransformActionProcessData
The newAction block will change the way that input data is
processed to become the output data. When the action
parameter is kSecTransformActionInternalizeExtraData it will
change the way a custom transform reads in data to be
imported into the transform.
@param ref A SecTransformImplementationRef that is bound to an instance
of a custom transform.
@param action The action being overridden. This value should be one of the
following:
kSecTransformActionProcessData
Change the way that input data is processed into the
output data. The default behavior is to simply copy
the input data to the output attribute.
The kSecTransformActionProcessData action is really
a special case of a SecTransformSetAttributeAction
action. If you call this method with
kSecTransformActionProcessData it would overwrite
any kSecTransformActionAttributeNotification action
that was set proviously
kSecTransformActionInternalizeExtraData
Change the way that custom externalized data is
imported into the transform. The default behavior
is to do nothing.
@param newAction
A SecTransformDataBlock which implements the behavior.
If the action parameter is kSecTransformActionProcessData then
this block will be called to process the input data into the
output data.
if the action parameter is kSecTransformActionInternalizeExtraData then
this block will called to input custom data into the transform.
@result A CFErrorRef is an error occured NULL otherwise.
@discussion This API may be called multiple times. Each time the API is called
it overwrites what was there previously.
*/
CF_EXPORT __nullable
CFErrorRef SecTransformSetDataAction(SecTransformImplementationRef ref,
CFStringRef action,
SecTransformDataBlock newAction);
/*
@function SecTransformSetTransformAction
@abstract Change the way that transform deals with transform lifecycle
behaviors.
@param ref A SecTransformImplementationRef that is bound to an instance
of a custom transform. It provides the neccessary context
for making the call to modify a custom transform.
@param action Defines what behavior will be changed. The possible values
are:
kSecTransformActionCanExecute
A CanExecute block is called before the transform
starts to execute. Returning NULL indicates that the
transform has all necessary parameters set up to be
able to execute. If there is a condition that
prevents this transform from executing, return a
CFError. The default behavior is to return NULL.
kSecTransformActionStartingExecution
A StartingExecution block is called as a transform
starts execution but before any input is delivered.
Transform-specific initialization can be performed
in this block.
kSecTransformActionFinalize
A Finalize block is called before a transform is
released. Any final cleanup can be performed in this
block.
kSecTransformActionExternalizeExtraData
An ExternalizeExtraData block is called before a
transform is externalized. If there is any extra
work that the transform needs to do (e.g. copy data
from local variables to attributes) it can be
performed in this block.
@param newAction
A SecTransformTransformActionBlock which implements the behavior.
@result A CFErrorRef if an error occured NULL otherwise.
*/
CF_EXPORT __nullable
CFErrorRef SecTransformSetTransformAction(SecTransformImplementationRef ref,
CFStringRef action,
SecTransformActionBlock newAction);
/*!
@function SecTranformCustomGetAttribute
@abstract Allow a custom transform to get an attribute value
@param ref A SecTransformImplementationRef that is bound to an instance
of a custom transform.
@param attribute
The name or the attribute handle of the attribute whose
value is to be retrieved.
@param type The type of data to be retrieved for the attribute. See the
discussion on SecTransformMetaAttributeType for details.
@result The value of the attribute.
*/
CF_EXPORT __nullable
CFTypeRef SecTranformCustomGetAttribute(SecTransformImplementationRef ref,
SecTransformStringOrAttributeRef attribute,
SecTransformMetaAttributeType type) AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8;
/*!
@function SecTransformCustomGetAttribute
@abstract Allow a custom transform to get an attribute value
@param ref A SecTransformImplementationRef that is bound to an instance
of a custom transform.
@param attribute
The name or the attribute handle of the attribute whose
value is to be retrieved.
@param type The type of data to be retrieved for the attribute. See the
discussion on SecTransformMetaAttributeType for details.
@result The value of the attribute.
*/
CF_EXPORT __nullable
CFTypeRef SecTransformCustomGetAttribute(SecTransformImplementationRef ref,
SecTransformStringOrAttributeRef attribute,
SecTransformMetaAttributeType type) __asm__("_SecTranformCustomGetAttribute");
/*!
@function SecTransformCustomSetAttribute
@abstract Allow a custom transform to set an attribute value
@param ref A SecTransformImplementationRef that is bound to an instance
of a custom transform.
@param attribute
The name or the attribute handle of the attribute whose
value is to be set.
@param type The type of data to be retrieved for the attribute. See the
discussion on SecTransformMetaAttributeType for details.
@param value The new value for the attribute
@result A CFErrorRef if an error occured , NULL otherwise.
@discussion Unlike the SecTransformSetAttribute API this API can set
attribute values while a transform is executing. These
values are limited to the custom transform instance that
is bound to the ref parameter.
*/
CF_EXPORT __nullable
CFTypeRef SecTransformCustomSetAttribute(SecTransformImplementationRef ref,
SecTransformStringOrAttributeRef attribute,
SecTransformMetaAttributeType type,
CFTypeRef __nullable value);
/*!
@function SecTransformPushbackAttribute
@abstract Allows for putting a single value back for a specific
attribute. This will stop the flow of data into the
specified attribute until any attribute is changed for the
transform instance bound to the ref parameter.
@param ref A SecTransformImplementationRef that is bound to an instance
of a custom transform.
@param attribute
The name or the attribute handle of the attribute whose
value is to be pushed back.
@param value The value being pushed back.
@result A CFErrorRef if an error occured , NULL otherwise.
*/
CF_EXPORT __nullable
CFTypeRef SecTransformPushbackAttribute(SecTransformImplementationRef ref,
SecTransformStringOrAttributeRef attribute,
CFTypeRef value);
/*!
@typedef SecTransformCreateFP
@abstract A function pointer to a function that will create a
new instance of a custom transform.
@param name The name of the new custom transform. This name MUST be
unique.
@param newTransform
The newly created transform Ref.
@param ref A reference that is bound to an instance of a custom
transform.
@result A SecTransformInstanceBlock that is used to create a new
instance of a custom transform.
@discussion The CreateTransform function creates a new transform. The
SecTransformInstanceBlock that is returned from this
function provides the implementation of all of the overrides
necessary to create the custom transform. This returned
SecTransformInstanceBlock is also where the "instance"
variables for the custom transform may be defined. See the
example in the header section of this file for more detail.
*/
typedef SecTransformInstanceBlock __nonnull (*SecTransformCreateFP)(CFStringRef name,
SecTransformRef newTransform,
SecTransformImplementationRef ref);
/************** custom Transform transform override actions **************/
/*!
@constant kSecTransformActionCanExecute
Overrides the standard behavior that checks to see if all of the
required attributes either have been set or are connected to
another transform. When overriding the default behavior the
developer can decided what the necessary data is to have for a
transform to be considered 'ready to run'. Returning NULL means
that the transform is ready to be run. If the transform is NOT
ready to run then the override should return a CFErrorRef
stipulating the error.
*/
CF_EXPORT const CFStringRef kSecTransformActionCanExecute;
/*!
@constant kSecTransformActionStartingExecution
Overrides the standard behavior that occurs just before starting
execution of a custom transform. This is typically overridden
to allow for initialization. This is used with the
SecTransformOverrideTransformAction block.
*/
CF_EXPORT const CFStringRef kSecTransformActionStartingExecution;
/*!
@constant kSecTransformActionFinalize
Overrides the standard behavior that occurs just before deleting
a custom transform. This is typically overridden to allow for
memory clean up of a custom transform. This is used with the
SecTransformOverrideTransformAction block.
*/
CF_EXPORT const CFStringRef kSecTransformActionFinalize;
/*!
@constant kSecTransformActionExternalizeExtraData
Allows for adding to the data that is stored using an override
to the kSecTransformActionExternalizeExtraData block. The output
of this override is a dictionary that contains the custom
externalized data. A common use of this override is to write out
a version number of a custom transform.
*/
CF_EXPORT const CFStringRef kSecTransformActionExternalizeExtraData;
/*!
@constant kSecTransformActionProcessData
Overrides the standard data processing for an attribute. This is
almost exclusively used for processing the input attribute as
the return value of their block sets the output attribute. This
is used with the SecTransformOverrideAttributeAction block.
*/
CF_EXPORT const CFStringRef kSecTransformActionProcessData;
/*!
@constant kSecTransformActionInternalizeExtraData
Overrides the standard processing that occurs when externalized
data is used to create a transform. This is closely tied to the
kSecTransformActionExternalizeExtraData override. The 'normal'
attributes are read into the new transform and then this is
called to read in the items that were written out using
kSecTransformActionExternalizeExtraData override. A common use
of this override would be to read in the version number of the
externalized custom transform.
*/
CF_EXPORT const CFStringRef kSecTransformActionInternalizeExtraData;
/*!
@constant SecTransformActionAttributeNotification
Allows a block to be called when an attribute is set. This
allows for caching the value as a block variable in the instance
block or transmogrifying the data to be set. This action is
where a custom transform would be able to do processing outside
of processing input to output as process data does. One the
data has been processed the action block can call
SecTransformCustomSetAttribute to update and other attribute.
*/
CF_EXPORT const CFStringRef kSecTransformActionAttributeNotification;
/*!
@constant kSecTransformActionAttributeValidation
Allows a block to be called to validate the new value for an
attribute. The default is no validation and any CFTypeRef can
be used as the new value. The block should return NULL if the
value is ok to set on the attribute or a CFErrorRef otherwise.
*/
CF_EXPORT const CFStringRef kSecTransformActionAttributeValidation;
/*!
@function SecTransformRegister
@abstract Register a new custom transform so that it may be used to
process data
@param uniqueName
A unique name for this custom transform. It is recommended
that a reverse DNS name be used for the name of your custom
transform
@param createTransformFunction
A SecTransformCreateFP function pointer. The function must
return a SecTransformInstanceBlock block that block_copy has
been called on before returning the block. Failure to call
block_copy will cause undefined behavior.
@param error This pointer is set if an error occurred. This value
may be NULL if you do not want an error returned.
@result True if the custom transform was registered false otherwise
*/
CF_EXPORT
Boolean SecTransformRegister(CFStringRef uniqueName,
SecTransformCreateFP createTransformFunction,
CFErrorRef* error)
__OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_NA);
/*!
@function SecTransformCreate
@abstract Creates a transform computation object.
@param name The type of transform to create, must have been registered
by SecTransformRegister, or be a system pre-defined
transform type.
@param error A pointer to a CFErrorRef. This pointer is set if an error
occurred. This value may be NULL if you do not want an
error returned.
@result A pointer to a SecTransformRef object. This object must be
released with CFRelease when you are done with it. This
function returns NULL if an error occurred.
*/
CF_EXPORT __nullable
SecTransformRef SecTransformCreate(CFStringRef name, CFErrorRef *error)
__OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_NA);
/*!
@Function SecTransformNoData
@abstract Returns back A CFTypeRef from inside a processData
override that says that while no data is being returned
the transform is still active and awaiting data.
@result A 'special' value that allows that specifies that the
transform is still active and awaiting data.
@discussion The standard behavior for the ProcessData override is that
it will receive a CFDataRef and it processes that data and
returns a CFDataRef that contains the processed data. When
there is no more data to process the ProcessData override
block is called one last time with a NULL CFDataRef. The
ProcessData block should/must return the NULL CFDataRef to
complete the processing. This model does not work well for
some transforms. For example a digest transform needs to see
ALL of the data that is being digested before it can send
out the digest value.
If a ProcessData block has no data to return, it can return
SecTransformNoData(), which informs the transform system
that there is no data to pass on to the next transform.
*/
CF_EXPORT
CFTypeRef SecTransformNoData(void);
CF_IMPLICIT_BRIDGING_DISABLED
CF_ASSUME_NONNULL_END
CF_EXTERN_C_END
#endif // __BLOCKS__
#endif // _SEC_CUSTOM_TRANSFORM_H__
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecAccessControl.h | /*
* Copyright (c) 2014 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
@header SecAccessControl
SecAccessControl defines access rights for items.
*/
#ifndef _SECURITY_SECACCESSCONTROL_H_
#define _SECURITY_SECACCESSCONTROL_H_
#include <Security/SecBase.h>
#include <CoreFoundation/CFError.h>
#include <sys/cdefs.h>
__BEGIN_DECLS
CF_ASSUME_NONNULL_BEGIN
CF_IMPLICIT_BRIDGING_ENABLED
/*!
@function SecAccessControlGetTypeID
@abstract Returns the type identifier of SecAccessControl instances.
@result The CFTypeID of SecAccessControl instances.
*/
CFTypeID SecAccessControlGetTypeID(void)
__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);
/*!
@typedef SecAccessControlCreateFlags
@constant kSecAccessControlUserPresence
User presence policy using biometry or Passcode. Biometry does not have to be available or enrolled. Item is still
accessible by Touch ID even if fingers are added or removed. Item is still accessible by Face ID if user is re-enrolled.
@constant kSecAccessControlBiometryAny
Constraint: Touch ID (any finger) or Face ID. Touch ID or Face ID must be available. With Touch ID
at least one finger must be enrolled. With Face ID user has to be enrolled. Item is still accessible by Touch ID even
if fingers are added or removed. Item is still accessible by Face ID if user is re-enrolled.
@constant kSecAccessControlTouchIDAny
Deprecated, please use kSecAccessControlBiometryAny instead.
@constant kSecAccessControlBiometryCurrentSet
Constraint: Touch ID from the set of currently enrolled fingers. Touch ID must be available and at least one finger must
be enrolled. When fingers are added or removed, the item is invalidated. When Face ID is re-enrolled this item is invalidated.
@constant kSecAccessControlTouchIDCurrentSet
Deprecated, please use kSecAccessControlBiometryCurrentSet instead.
@constant kSecAccessControlDevicePasscode
Constraint: Device passcode
@constant kSecAccessControlWatch
Constraint: Watch
@constant kSecAccessControlOr
Constraint logic operation: when using more than one constraint, at least one of them must be satisfied.
@constant kSecAccessControlAnd
Constraint logic operation: when using more than one constraint, all must be satisfied.
@constant kSecAccessControlPrivateKeyUsage
Create access control for private key operations (i.e. sign operation)
@constant kSecAccessControlApplicationPassword
Security: Application provided password for data encryption key generation. This is not a constraint but additional item
encryption mechanism.
*/
typedef CF_OPTIONS(CFOptionFlags, SecAccessControlCreateFlags) {
kSecAccessControlUserPresence = 1u << 0,
kSecAccessControlBiometryAny API_AVAILABLE(macos(10.13.4), ios(11.3)) = 1u << 1,
kSecAccessControlTouchIDAny API_DEPRECATED_WITH_REPLACEMENT("kSecAccessControlBiometryAny", macos(10.12.1, 10.13.4), ios(9.0, 11.3)) = 1u << 1,
kSecAccessControlBiometryCurrentSet API_AVAILABLE(macos(10.13.4), ios(11.3)) = 1u << 3,
kSecAccessControlTouchIDCurrentSet API_DEPRECATED_WITH_REPLACEMENT("kSecAccessControlBiometryCurrentSet", macos(10.12.1, 10.13.4), ios(9.0, 11.3)) = 1u << 3,
kSecAccessControlDevicePasscode API_AVAILABLE(macos(10.11), ios(9.0)) = 1u << 4,
kSecAccessControlWatch API_AVAILABLE(macos(10.15), ios(NA), macCatalyst(13.0)) = 1u << 5,
kSecAccessControlOr API_AVAILABLE(macos(10.12.1), ios(9.0)) = 1u << 14,
kSecAccessControlAnd API_AVAILABLE(macos(10.12.1), ios(9.0)) = 1u << 15,
kSecAccessControlPrivateKeyUsage API_AVAILABLE(macos(10.12.1), ios(9.0)) = 1u << 30,
kSecAccessControlApplicationPassword API_AVAILABLE(macos(10.12.1), ios(9.0)) = 1u << 31,
} __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);
/*!
@function SecAccessControlCreateWithFlags
@abstract Creates new access control object based on protection type and additional flags.
@discussion Created access control object should be used as a value for kSecAttrAccessControl attribute in SecItemAdd,
SecItemUpdate or SecKeyGeneratePair functions. Accessing keychain items or performing operations on keys which are
protected by access control objects can block the execution because of UI which can appear to satisfy the access control
conditions, therefore it is recommended to either move those potentially blocking operations out of the main
application thread or use combination of kSecUseAuthenticationContext and kSecUseAuthenticationUI attributes to control
where the UI interaction can appear.
@param allocator Allocator to be used by this instance.
@param protection Protection class to be used for the item. One of kSecAttrAccessible constants.
@param flags If no flags are set then all operations are allowed.
@param error Additional error information filled in case of failure.
@result Newly created access control object.
*/
__nullable
SecAccessControlRef SecAccessControlCreateWithFlags(CFAllocatorRef __nullable allocator, CFTypeRef protection,
SecAccessControlCreateFlags flags, CFErrorRef *error)
API_AVAILABLE(macos(10.10), ios(8.0));
CF_IMPLICIT_BRIDGING_DISABLED
CF_ASSUME_NONNULL_END
__END_DECLS
#endif // _SECURITY_SECACCESSCONTROL_H_
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecSignVerifyTransform.h | #ifndef __TRANSFORM_SIGN_VERIFY__
#define __TRANSFORM_SIGN_VERIFY__
/*
* Copyright (c) 2010-2011 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#include <Security/SecTransform.h>
#include <Security/SecBase.h>
#ifdef __cplusplus
extern "C" {
#endif
CF_ASSUME_NONNULL_BEGIN
CF_IMPLICIT_BRIDGING_ENABLED
extern const CFStringRef kSecKeyAttributeName, kSecSignatureAttributeName, kSecInputIsAttributeName;
// WARNING: kSecInputIsRaw is frequently cryptographically unsafe (for example if you don't blind a DSA or ECDSA signature you give away the key very quickly), please only use it if you really know the math.
extern const CFStringRef kSecInputIsPlainText, kSecInputIsDigest, kSecInputIsRaw;
// Supported optional attributes: kSecDigestTypeAttribute (kSecDigestMD2, kSecDigestMD4, kSecDigestMD5, kSecDigestSHA1, kSecDigestSHA2), kSecDigestLengthAttribute
/*!
@function SecSignTransformCreate
@abstract Creates a sign computation object.
@param key A SecKey with the private key used for signing.
@param error A pointer to a CFErrorRef. This pointer will be set
if an error occurred. This value may be NULL if you
do not want an error returned.
@result A pointer to a SecTransformRef object. This object must
be released with CFRelease when you are done with
it. This function will return NULL if an error
occurred.
@discussion This function creates a transform which computes a
cryptographic signature. The InputIS defaults to kSecInputIsPlainText,
and the DigestType and DigestLength default to something appropriate for
the type of key you have supplied.
*/
__nullable
SecTransformRef SecSignTransformCreate(SecKeyRef key,
CFErrorRef* error
)
__OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_NA);
/*!
@function SecVerifyTransformCreate
@abstract Creates a verify computation object.
@param key A SecKey with the public key used for signing.
@param signature A CFDataRef with the signature. This value may be
NULL, and you may connect a transform to kSecTransformSignatureAttributeName
to supply it from another signature.
@param error A pointer to a CFErrorRef. This pointer will be set
if an error occurred. This value may be NULL if you
do not want an error returned.
@result A pointer to a SecTransformRef object. This object must
be released with CFRelease when you are done with
it. This function will return NULL if an error
occurred.
@discussion This function creates a transform which verifies a
cryptographic signature. The InputIS defaults to kSecInputIsPlainText,
and the DigestType and DigestLength default to something appropriate for
the type of key you have supplied.
*/
__nullable
SecTransformRef SecVerifyTransformCreate(SecKeyRef key,
CFDataRef __nullable signature,
CFErrorRef* error
)
__OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_NA);
CF_IMPLICIT_BRIDGING_DISABLED
CF_ASSUME_NONNULL_END
#ifdef __cplusplus
};
#endif
#endif
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/cssmdli.h | /*
* Copyright (c) 1999-2001,2004,2011,2014 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*
* cssmdli.h -- Service Provider Interface for Data Store Modules
*/
#ifndef _CSSMDLI_H_
#define _CSSMDLI_H_ 1
#include <Security/cssmtype.h>
#ifdef __cplusplus
extern "C" {
#endif
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_spi_dl_funcs {
CSSM_RETURN (CSSMDLI *DbOpen)
(CSSM_DL_HANDLE DLHandle,
const char *DbName,
const CSSM_NET_ADDRESS *DbLocation,
CSSM_DB_ACCESS_TYPE AccessRequest,
const CSSM_ACCESS_CREDENTIALS *AccessCred,
const void *OpenParameters,
CSSM_DB_HANDLE *DbHandle);
CSSM_RETURN (CSSMDLI *DbClose)
(CSSM_DL_DB_HANDLE DLDBHandle);
CSSM_RETURN (CSSMDLI *DbCreate)
(CSSM_DL_HANDLE DLHandle,
const char *DbName,
const CSSM_NET_ADDRESS *DbLocation,
const CSSM_DBINFO *DBInfo,
CSSM_DB_ACCESS_TYPE AccessRequest,
const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry,
const void *OpenParameters,
CSSM_DB_HANDLE *DbHandle);
CSSM_RETURN (CSSMDLI *DbDelete)
(CSSM_DL_HANDLE DLHandle,
const char *DbName,
const CSSM_NET_ADDRESS *DbLocation,
const CSSM_ACCESS_CREDENTIALS *AccessCred);
CSSM_RETURN (CSSMDLI *CreateRelation)
(CSSM_DL_DB_HANDLE DLDBHandle,
CSSM_DB_RECORDTYPE RelationID,
const char *RelationName,
uint32 NumberOfAttributes,
const CSSM_DB_SCHEMA_ATTRIBUTE_INFO *pAttributeInfo,
uint32 NumberOfIndexes,
const CSSM_DB_SCHEMA_INDEX_INFO *pIndexInfo);
CSSM_RETURN (CSSMDLI *DestroyRelation)
(CSSM_DL_DB_HANDLE DLDBHandle,
CSSM_DB_RECORDTYPE RelationID);
CSSM_RETURN (CSSMDLI *Authenticate)
(CSSM_DL_DB_HANDLE DLDBHandle,
CSSM_DB_ACCESS_TYPE AccessRequest,
const CSSM_ACCESS_CREDENTIALS *AccessCred);
CSSM_RETURN (CSSMDLI *GetDbAcl)
(CSSM_DL_DB_HANDLE DLDBHandle,
const CSSM_STRING *SelectionTag,
uint32 *NumberOfAclInfos,
CSSM_ACL_ENTRY_INFO_PTR *AclInfos);
CSSM_RETURN (CSSMDLI *ChangeDbAcl)
(CSSM_DL_DB_HANDLE DLDBHandle,
const CSSM_ACCESS_CREDENTIALS *AccessCred,
const CSSM_ACL_EDIT *AclEdit);
CSSM_RETURN (CSSMDLI *GetDbOwner)
(CSSM_DL_DB_HANDLE DLDBHandle,
CSSM_ACL_OWNER_PROTOTYPE_PTR Owner);
CSSM_RETURN (CSSMDLI *ChangeDbOwner)
(CSSM_DL_DB_HANDLE DLDBHandle,
const CSSM_ACCESS_CREDENTIALS *AccessCred,
const CSSM_ACL_OWNER_PROTOTYPE *NewOwner);
CSSM_RETURN (CSSMDLI *GetDbNames)
(CSSM_DL_HANDLE DLHandle,
CSSM_NAME_LIST_PTR *NameList);
CSSM_RETURN (CSSMDLI *GetDbNameFromHandle)
(CSSM_DL_DB_HANDLE DLDBHandle,
char **DbName);
CSSM_RETURN (CSSMDLI *FreeNameList)
(CSSM_DL_HANDLE DLHandle,
CSSM_NAME_LIST_PTR NameList);
CSSM_RETURN (CSSMDLI *DataInsert)
(CSSM_DL_DB_HANDLE DLDBHandle,
CSSM_DB_RECORDTYPE RecordType,
const CSSM_DB_RECORD_ATTRIBUTE_DATA *Attributes,
const CSSM_DATA *Data,
CSSM_DB_UNIQUE_RECORD_PTR *UniqueId);
CSSM_RETURN (CSSMDLI *DataDelete)
(CSSM_DL_DB_HANDLE DLDBHandle,
const CSSM_DB_UNIQUE_RECORD *UniqueRecordIdentifier);
CSSM_RETURN (CSSMDLI *DataModify)
(CSSM_DL_DB_HANDLE DLDBHandle,
CSSM_DB_RECORDTYPE RecordType,
CSSM_DB_UNIQUE_RECORD_PTR UniqueRecordIdentifier,
const CSSM_DB_RECORD_ATTRIBUTE_DATA *AttributesToBeModified,
const CSSM_DATA *DataToBeModified,
CSSM_DB_MODIFY_MODE ModifyMode);
CSSM_RETURN (CSSMDLI *DataGetFirst)
(CSSM_DL_DB_HANDLE DLDBHandle,
const CSSM_QUERY *Query,
CSSM_HANDLE_PTR ResultsHandle,
CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
CSSM_DATA_PTR Data,
CSSM_DB_UNIQUE_RECORD_PTR *UniqueId);
CSSM_RETURN (CSSMDLI *DataGetNext)
(CSSM_DL_DB_HANDLE DLDBHandle,
CSSM_HANDLE ResultsHandle,
CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
CSSM_DATA_PTR Data,
CSSM_DB_UNIQUE_RECORD_PTR *UniqueId);
CSSM_RETURN (CSSMDLI *DataAbortQuery)
(CSSM_DL_DB_HANDLE DLDBHandle,
CSSM_HANDLE ResultsHandle);
CSSM_RETURN (CSSMDLI *DataGetFromUniqueRecordId)
(CSSM_DL_DB_HANDLE DLDBHandle,
const CSSM_DB_UNIQUE_RECORD *UniqueRecord,
CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
CSSM_DATA_PTR Data);
CSSM_RETURN (CSSMDLI *FreeUniqueRecord)
(CSSM_DL_DB_HANDLE DLDBHandle,
CSSM_DB_UNIQUE_RECORD_PTR UniqueRecord);
CSSM_RETURN (CSSMDLI *PassThrough)
(CSSM_DL_DB_HANDLE DLDBHandle,
uint32 PassThroughId,
const void *InputParams,
void **OutputParams);
} CSSM_SPI_DL_FUNCS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_SPI_DL_FUNCS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
#pragma clang diagnostic pop
#ifdef __cplusplus
}
#endif
#endif /* _CSSMDLI_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecCertificateOIDs.h | /*
* Copyright (c) 2002-2012 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
@header SecCertificateOIDs
These constants are used to access entries in the dictionary returned by
SecCertificateCopyValues, which are the parsed field from a certificate.
*/
#ifndef _SECURITY_SECCERTIFICATEOIDS_H_
#define _SECURITY_SECCERTIFICATEOIDS_H_
#include <CoreFoundation/CFBase.h>
#include <Availability.h>
#include <AvailabilityMacros.h>
#if defined(__cplusplus)
extern "C" {
#endif
CF_ASSUME_NONNULL_BEGIN
extern const CFStringRef kSecOIDADC_CERT_POLICY __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDAPPLE_CERT_POLICY __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDAPPLE_EKU_CODE_SIGNING __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDAPPLE_EKU_CODE_SIGNING_DEV __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDAPPLE_EKU_ICHAT_ENCRYPTION __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDAPPLE_EKU_ICHAT_SIGNING __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDAPPLE_EKU_RESOURCE_SIGNING __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDAPPLE_EKU_SYSTEM_IDENTITY __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDAPPLE_EXTENSION __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDAPPLE_EXTENSION_ADC_APPLE_SIGNING __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDAPPLE_EXTENSION_ADC_DEV_SIGNING __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDAPPLE_EXTENSION_APPLE_SIGNING __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDAPPLE_EXTENSION_CODE_SIGNING __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDAPPLE_EXTENSION_INTERMEDIATE_MARKER __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDAPPLE_EXTENSION_WWDR_INTERMEDIATE __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDAPPLE_EXTENSION_ITMS_INTERMEDIATE __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDAPPLE_EXTENSION_AAI_INTERMEDIATE __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDAPPLE_EXTENSION_APPLEID_INTERMEDIATE __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDAuthorityInfoAccess __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDAuthorityKeyIdentifier __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDBasicConstraints __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDBiometricInfo __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDCSSMKeyStruct __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDCertIssuer __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDCertificatePolicies __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDClientAuth __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDCollectiveStateProvinceName __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDCollectiveStreetAddress __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDCommonName __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDCountryName __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDCrlDistributionPoints __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDCrlNumber __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDCrlReason __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDDOTMAC_CERT_EMAIL_ENCRYPT __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDDOTMAC_CERT_EMAIL_SIGN __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDDOTMAC_CERT_EXTENSION __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDDOTMAC_CERT_IDENTITY __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDDOTMAC_CERT_POLICY __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDDeltaCrlIndicator __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDDescription __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDEKU_IPSec __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDEmailAddress __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDEmailProtection __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDExtendedKeyUsage __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDExtendedKeyUsageAny __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDExtendedUseCodeSigning __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDGivenName __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDHoldInstructionCode __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDInvalidityDate __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDIssuerAltName __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDIssuingDistributionPoint __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDIssuingDistributionPoints __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDKERBv5_PKINIT_KP_CLIENT_AUTH __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDKERBv5_PKINIT_KP_KDC __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDKeyUsage __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDLocalityName __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDMS_NTPrincipalName __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDMicrosoftSGC __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDNameConstraints __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDNetscapeCertSequence __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDNetscapeCertType __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDNetscapeSGC __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDOCSPSigning __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDOrganizationName __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDOrganizationalUnitName __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDPolicyConstraints __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDPolicyMappings __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDPrivateKeyUsagePeriod __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDQC_Statements __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDSerialNumber __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDServerAuth __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDStateProvinceName __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDStreetAddress __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDSubjectAltName __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDSubjectDirectoryAttributes __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDSubjectEmailAddress __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDSubjectInfoAccess __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDSubjectKeyIdentifier __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDSubjectPicture __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDSubjectSignatureBitmap __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDSurname __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDTimeStamping __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDTitle __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDUseExemptions __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V1CertificateIssuerUniqueId __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V1CertificateSubjectUniqueId __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V1IssuerName __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V1IssuerNameCStruct __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V1IssuerNameLDAP __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V1IssuerNameStd __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V1SerialNumber __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V1Signature __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V1SignatureAlgorithm __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V1SignatureAlgorithmParameters __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V1SignatureAlgorithmTBS __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V1SignatureCStruct __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V1SignatureStruct __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V1SubjectName __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V1SubjectNameCStruct __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V1SubjectNameLDAP __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V1SubjectNameStd __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V1SubjectPublicKey __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V1SubjectPublicKeyAlgorithm __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V1SubjectPublicKeyAlgorithmParameters __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V1SubjectPublicKeyCStruct __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V1ValidityNotAfter __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V1ValidityNotBefore __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V1Version __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V3Certificate __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V3CertificateCStruct __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V3CertificateExtensionCStruct __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V3CertificateExtensionCritical __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V3CertificateExtensionId __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V3CertificateExtensionStruct __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V3CertificateExtensionType __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V3CertificateExtensionValue __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V3CertificateExtensionsCStruct __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V3CertificateExtensionsStruct __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V3CertificateNumberOfExtensions __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V3SignedCertificate __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDX509V3SignedCertificateCStruct __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecOIDSRVName __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_NA);
CF_ASSUME_NONNULL_END
#if defined(__cplusplus)
}
#endif
#endif /* !_SECURITY_SECCERTIFICATEOIDS_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecureDownload.h | #ifndef __SECURE_DOWNLOAD__
#define __SECURE_DOWNLOAD__
#if defined(__cplusplus)
extern "C" {
#endif
/*
* Copyright (c) 2006-2021 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
@header SecureDownload
@abstract Used by clients to implement Apple's Verified Download System.
Please note that a succesful check does not guarantee anything about
the safety of the file being downloaded. Rather, it simply checks to make sure
that the contents of the file being downloaded exactly matches the contents
of the file when the ticket was originally generated.
To use, do the following:
1: Download the secure download ticket.
2: Pass the ticket to SecureDownloadCreateWithTicket. On error, call
SecureDownloadGetTrustRef to return data that will help you figure
out why the ticket was bad.
3: If SecureDownloadCreateWithTicket returns errSecSuccess, call SecureDownloadCopyURLs
to return a list of data download locations. Begin downloading data from
the first URL in the list. If that download fails, try downloading from
the second URL, and so forth.
4: Each time you receive data, call SecureDownloadReceivedData.
5: Once all data has been received, call SecureDownloadFinished.
6: Release the SecureDownloadRef by calling SecureDownloadRelease.
*/
#include <CoreFoundation/CoreFoundation.h>
#include <Security/SecBase.h>
#include <Security/SecTrust.h> /* SecTrustRef */
#define SECUREDOWNLOAD_API_DEPRECATED API_DEPRECATED("SecureDownload is not supported", macos(10.5, 12.0)) API_UNAVAILABLE(ios, watchos, tvos, macCatalyst)
typedef struct OpaqueSecureDownload *SecureDownloadRef;
enum {
errSecureDownloadInvalidTicket = -20052,
errSecureDownloadInvalidDownload = -20053
};
/*!
@enum _SecureDownloadSetupCallbackResult
@discussion This type is used to indicate whether or not a
signer should be evaluated.
@constant kSecureDownloadDoNotEvaluateSigner Indicates that the signer should not be evaluated.
@constant kSecureDownloadEvaluateSigner Indicates that the signer should be evaluated.
@constant kSecureDownloadFailEvaluation Indicates that evaluation should fail immediately.
*/
typedef enum _SecureDownloadTrustCallbackResult
{
kSecureDownloadDoNotEvaluateSigner = 0,
kSecureDownloadEvaluateSigner = 1,
kSecureDownloadFailEvaluation = 2
} SecureDownloadTrustCallbackResult SECUREDOWNLOAD_API_DEPRECATED;
/*!
@typedef SecureDownloadTrustSetupCallback
@discussion This callback is used to determine whether trust for a particular
signer should be evaluated.
@param trustRef The trustRef for this evaluation
@param setupContext user defined.
@result A SecureDownloadTrustCallbackResult (see).
*/
typedef SecureDownloadTrustCallbackResult(*SecureDownloadTrustSetupCallback)
(SecTrustRef trustRef, void* setupContext)
SECUREDOWNLOAD_API_DEPRECATED;
/*!
@typedef SecureDownloadTrustEvaluateCallback
@discussion This callback is used called after trust has been evaluated.
@param trustRef The trustRef for this evaluation
@param result The result of the evaluation (See the SecTrust documentation).
@param evaluateContext user defined.
@result A SecTrustResultType. Return the value passed in result if you
do not want to change the evaluation result.
*/
typedef SecTrustResultType(*SecureDownloadTrustEvaluateCallback)
(SecTrustRef trustRef, SecTrustResultType result,
void *evaluateContext)
SECUREDOWNLOAD_API_DEPRECATED;
/*!
@function SecureDownloadCreateWithTicket
@abstract Create a SecureDownloadRef for use during the Secure Download process.
@param ticket The download ticket.
@param setup Called before trust is verified for each signer of the ticket.
This allows the user to modify the SecTrustRef if needed
(see the SecTrust documentation). Returns a SecureDownloadTrustCallbackResult (see).
@param setupContext User defined. Passed as a parameter to the setupCallback.
@param evaluate Called after SecTrustEvaluate has been called for a
signer if the result was not trusted. This allows
the developer to query the user as to whether or not
to trust the signer. Returns a SecTrustResultType
@param evaluateContext User defined. Passed as a parameter to the evaluate callback.
@param downloadRef The returned reference.
@result Returns errSecureDownloadInvalidTicket if the ticket was invalid. Otherwise
see "Security Error Codes" (SecBase.h).
.
*/
OSStatus SecureDownloadCreateWithTicket (CFDataRef ticket,
SecureDownloadTrustSetupCallback setup,
void* setupContext,
SecureDownloadTrustEvaluateCallback evaluate,
void* evaluateContext,
SecureDownloadRef* downloadRef)
SECUREDOWNLOAD_API_DEPRECATED;
/*!
@function SecureDownloadCopyURLs
@abstract Return a list of URL's from which the data can be downloaded. The first
URL in the list is the preferred download location. The other URL's are
backup locations in case earlier locations in the list could not be
accessed.
@param downloadRef A SecureDownloadRef instance.
@param urls On return, the list of URL's to download. Format is a CFArray of CFURL's.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecureDownloadCopyURLs (SecureDownloadRef downloadRef, CFArrayRef* urls)
SECUREDOWNLOAD_API_DEPRECATED;
/*!
@function SecureDownloadCopyName
@abstract Return the printable name of this download ticket.
@param downloadRef A SecureDownloadRef instance.
@param name On output, the download name.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecureDownloadCopyName (SecureDownloadRef downloadRef, CFStringRef* name)
SECUREDOWNLOAD_API_DEPRECATED;
/*!
@function SecureDownloadCopyCreationDate
@abstract Return the date the downlooad ticket was created.
@param downloadRef A SecureDownloadRef instance.
@result A result code.
*/
OSStatus SecureDownloadCopyCreationDate (SecureDownloadRef downloadRef, CFDateRef* date)
SECUREDOWNLOAD_API_DEPRECATED;
/*!
@function SecureDownloadGetDownloadSize
@abstract Return the size of the expected download.
@param downloadRef A SecureDownloadRef instance.
@param downloadSize On output, the size of the download.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecureDownloadGetDownloadSize (SecureDownloadRef downloadRef, SInt64 *downloadSize)
SECUREDOWNLOAD_API_DEPRECATED;
/*!
@function SecureDownloadUpdateWithData
@abstract Check data received during Secure Download for validity.
Call this function each time data is received.
@param downloadRef A SecureDownloadRef instance.
@param data The data to check.
@result Returns errSecureDownloadInvalidDownload if data is invalid. Otherwise
see "Security Error Codes" (SecBase.h).
*/
OSStatus SecureDownloadUpdateWithData (SecureDownloadRef downloadRef, CFDataRef data)
SECUREDOWNLOAD_API_DEPRECATED;
/*!
@function SecureDownloadFinished
@abstract Concludes the secure download process. Call this after all data has been received.
@param downloadRef A SecureDownloadRef instance.
@result Returns errSecureDownloadInvalidDownload if data is invalid. Otherwise
see "Security Error Codes" (SecBase.h).
*/
OSStatus SecureDownloadFinished (SecureDownloadRef downloadRef)
SECUREDOWNLOAD_API_DEPRECATED;
/*!
@function SecureDownloadRelease
@abstract Releases a SecureDownloadRef.
@param downloadRef The SecureDownloadRef to release.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecureDownloadRelease (SecureDownloadRef downloadRef)
SECUREDOWNLOAD_API_DEPRECATED;
/*!
@function SecureDownloadCopyTicketLocation
@abstract Copies the ticket location from an x-securedownload URL.
@param url The x-securedownload URL.
@param ticketLocation On exit, the URL of the ticket.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecureDownloadCopyTicketLocation (CFURLRef url, CFURLRef *ticketLocation)
SECUREDOWNLOAD_API_DEPRECATED;
#if defined(__cplusplus)
};
#endif
#endif
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/oidscrl.h | /*
* Copyright (c) 1999-2001,2004,2011,2014 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*
* oidscrl.h -- Object Identifiers for X509 CRLs and OCSP
*/
#ifndef _OIDSCRL_H_
#define _OIDSCRL_H_ 1
#include <Security/cssmconfig.h>
#include <Security/cssmtype.h>
#include <Security/oidsbase.h>
#ifdef __cplusplus
extern "C" {
#endif
#define INTEL_X509V2_CRL_R08 INTEL_SEC_FORMATS, 2, 1
#define INTEL_X509V2_CRL_R08_LENGTH INTEL_SEC_FORMATS_LENGTH+2
extern const CSSM_OID
/* CRL OIDs */
CSSMOID_X509V2CRLSignedCrlStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V2CRLSignedCrlCStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V2CRLTbsCertListStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V2CRLTbsCertListCStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V2CRLVersion DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V1CRLIssuerStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V1CRLIssuerNameCStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V1CRLIssuerNameLDAP DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V1CRLThisUpdate DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V1CRLNextUpdate DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
/* CRL Entry (CRL CertList) OIDS */
CSSMOID_X509V1CRLRevokedCertificatesStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V1CRLRevokedCertificatesCStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V1CRLNumberOfRevokedCertEntries DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V1CRLRevokedEntryStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V1CRLRevokedEntryCStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V1CRLRevokedEntrySerialNumber DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V1CRLRevokedEntryRevocationDate DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
/* CRL Entry (CRL CertList) Extension OIDs */
CSSMOID_X509V2CRLRevokedEntryAllExtensionsStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V2CRLRevokedEntryAllExtensionsCStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V2CRLRevokedEntryNumberOfExtensions DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V2CRLRevokedEntrySingleExtensionStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V2CRLRevokedEntrySingleExtensionCStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V2CRLRevokedEntryExtensionId DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V2CRLRevokedEntryExtensionCritical DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V2CRLRevokedEntryExtensionType DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V2CRLRevokedEntryExtensionValue DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
/* CRL Extension OIDs */
CSSMOID_X509V2CRLAllExtensionsStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V2CRLAllExtensionsCStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V2CRLNumberOfExtensions DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V2CRLSingleExtensionStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V2CRLSingleExtensionCStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V2CRLExtensionId DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V2CRLExtensionCritical DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V2CRLExtensionType DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
/* OCSP */
CSSMOID_PKIX_OCSP DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKIX_OCSP_BASIC DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKIX_OCSP_NONCE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKIX_OCSP_CRL DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKIX_OCSP_RESPONSE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKIX_OCSP_NOCHECK DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKIX_OCSP_ARCHIVE_CUTOFF DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKIX_OCSP_SERVICE_LOCATOR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
#ifdef __cplusplus
}
#endif
#endif /* _OIDSCRL_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/CSCommon.h | /*
* Copyright (c) 2006-2014 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
@header CSCommon
CSCommon is the common header of all Code Signing API headers.
It defines types, constants, and error codes.
*/
#ifndef _H_CSCOMMON
#define _H_CSCOMMON
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <CoreFoundation/CoreFoundation.h>
/*
* Some macOS API's use the old style defined name CSSM_DATA and CSSM_OID.
* These are just typedefs for SecAsn* which are available for iOS. We complete
* those here in case they're not available for compatibility.
*/
#include <TargetConditionals.h>
#if TARGET_OS_IPHONE
#ifndef CSSM_DATA
#define CSSM_DATA SecAsn1Item
#endif
#ifndef CSSM_OID
#define CSSM_OID SecAsn1Oid
#endif
#endif /* TARGET_OS_IPHONE */
CF_ASSUME_NONNULL_BEGIN
/*
Code Signing specific OSStatus codes.
[Assigned range 0xFFFE_FAxx].
*/
CF_ENUM(OSStatus) {
errSecCSUnimplemented = -67072, /* unimplemented code signing feature */
errSecCSInvalidObjectRef = -67071, /* invalid API object reference */
errSecCSInvalidFlags = -67070, /* invalid or inappropriate API flag(s) specified */
errSecCSObjectRequired = -67069, /* a required pointer argument was NULL */
errSecCSStaticCodeNotFound = -67068, /* cannot find code object on disk */
errSecCSUnsupportedGuestAttributes = -67067, /* cannot locate guests using this attribute set */
errSecCSInvalidAttributeValues = -67066, /* given attribute values are invalid */
errSecCSNoSuchCode = -67065, /* host has no guest with the requested attributes */
errSecCSMultipleGuests = -67064, /* ambiguous guest specification (host has multiple guests with these attribute values) */
errSecCSGuestInvalid = -67063, /* code identity has been invalidated */
errSecCSUnsigned = -67062, /* code object is not signed at all */
errSecCSSignatureFailed = -67061, /* invalid signature (code or signature have been modified) */
errSecCSSignatureNotVerifiable = -67060, /* the code cannot be read by the verifier (file system permissions etc.) */
errSecCSSignatureUnsupported = -67059, /* unsupported type or version of signature */
errSecCSBadDictionaryFormat = -67058, /* a required plist file or resource is malformed */
errSecCSResourcesNotSealed = -67057, /* resources are present but not sealed by signature */
errSecCSResourcesNotFound = -67056, /* code has no resources but signature indicates they must be present */
errSecCSResourcesInvalid = -67055, /* the sealed resource directory is invalid */
errSecCSBadResource = -67054, /* a sealed resource is missing or invalid */
errSecCSResourceRulesInvalid = -67053, /* invalid resource specification rule(s) */
errSecCSReqInvalid = -67052, /* invalid or corrupted code requirement(s) */
errSecCSReqUnsupported = -67051, /* unsupported type or version of code requirement(s) */
errSecCSReqFailed = -67050, /* code failed to satisfy specified code requirement(s) */
errSecCSBadObjectFormat = -67049, /* object file format unrecognized, invalid, or unsuitable */
errSecCSInternalError = -67048, /* internal error in Code Signing subsystem */
errSecCSHostReject = -67047, /* code rejected its host */
errSecCSNotAHost = -67046, /* attempt to specify guest of code that is not a host */
errSecCSSignatureInvalid = -67045, /* invalid or unsupported format for signature */
errSecCSHostProtocolRelativePath = -67044, /* host protocol violation - absolute guest path required */
errSecCSHostProtocolContradiction = -67043, /* host protocol violation - contradictory hosting modes */
errSecCSHostProtocolDedicationError = -67042, /* host protocol violation - operation not allowed with/for a dedicated guest */
errSecCSHostProtocolNotProxy = -67041, /* host protocol violation - proxy hosting not engaged */
errSecCSHostProtocolStateError = -67040, /* host protocol violation - invalid guest state change request */
errSecCSHostProtocolUnrelated = -67039, /* host protocol violation - the given guest is not a guest of the given host */
/* -67038 obsolete (no longer issued) */
errSecCSNotSupported = -67037, /* operation inapplicable or not supported for this type of code */
errSecCSCMSTooLarge = -67036, /* signature too large to embed (size limitation of on-disk representation) */
errSecCSHostProtocolInvalidHash = -67035, /* host protocol violation - invalid guest hash */
errSecCSStaticCodeChanged = -67034, /* the code on disk does not match what is running */
errSecCSDBDenied = -67033, /* permission to use a database denied */
errSecCSDBAccess = -67032, /* cannot access a database */
errSecCSSigDBDenied = -67033, /* permission to use a database denied */
errSecCSSigDBAccess = -67032, /* cannot access a database */
errSecCSHostProtocolInvalidAttribute = -67031, /* host returned invalid or inconsistent guest attributes */
errSecCSInfoPlistFailed = -67030, /* invalid Info.plist (plist or signature have been modified) */
errSecCSNoMainExecutable = -67029, /* the code has no main executable file */
errSecCSBadBundleFormat = -67028, /* bundle format unrecognized, invalid, or unsuitable */
errSecCSNoMatches = -67027, /* no matches for search or update operation */
errSecCSFileHardQuarantined = -67026, /* File created by an AppSandbox, exec/open not allowed */
errSecCSOutdated = -67025, /* presented data is out of date */
errSecCSDbCorrupt = -67024, /* a system database or file is corrupt */
errSecCSResourceDirectoryFailed = -67023, /* invalid resource directory (directory or signature have been modified) */
errSecCSUnsignedNestedCode = -67022, /* nested code is unsigned */
errSecCSBadNestedCode = -67021, /* nested code is modified or invalid */
errSecCSBadCallbackValue = -67020, /* monitor callback returned invalid value */
errSecCSHelperFailed = -67019, /* the codesign_allocate helper tool cannot be found or used */
errSecCSVetoed = -67018,
errSecCSBadLVArch = -67017, /* library validation flag cannot be used with an i386 binary */
errSecCSResourceNotSupported = -67016, /* unsupported resource found (something not a directory, file or symlink) */
errSecCSRegularFile = -67015, /* the main executable or Info.plist must be a regular file (no symlinks, etc.) */
errSecCSUnsealedAppRoot = -67014, /* unsealed contents present in the bundle root */
errSecCSWeakResourceRules = -67013, /* resource envelope is obsolete (custom omit rules) */
errSecCSDSStoreSymlink = -67012, /* .DS_Store files cannot be a symlink */
errSecCSAmbiguousBundleFormat = -67011, /* bundle format is ambiguous (could be app or framework) */
errSecCSBadMainExecutable = -67010, /* main executable failed strict validation */
errSecCSBadFrameworkVersion = -67009, /* embedded framework contains modified or invalid version */
errSecCSUnsealedFrameworkRoot = -67008, /* unsealed contents present in the root directory of an embedded framework */
errSecCSWeakResourceEnvelope = -67007, /* resource envelope is obsolete (version 1 signature) */
errSecCSCancelled = -67006, /* operation was terminated by explicit cancelation */
errSecCSInvalidPlatform = -67005, /* invalid platform identifier or platform mismatch */
errSecCSTooBig = -67004, /* code is too big for current signing format */
errSecCSInvalidSymlink = -67003, /* invalid destination for symbolic link in bundle */
errSecCSNotAppLike = -67002, /* the code is valid but does not seem to be an app */
errSecCSBadDiskImageFormat = -67001, /* disk image format unrecognized, invalid, or unsuitable */
errSecCSUnsupportedDigestAlgorithm = -67000, /* a requested signature digest algorithm is not supported */
errSecCSInvalidAssociatedFileData = -66999, /* resource fork, Finder information, or similar detritus not allowed */
errSecCSInvalidTeamIdentifier = -66998, /* a Team Identifier string is invalid */
errSecCSBadTeamIdentifier = -66997, /* a Team Identifier is wrong or inappropriate */
errSecCSSignatureUntrusted = -66996, /* signature is valid but signer is not trusted */
errSecMultipleExecSegments = -66995, /* the image contains multiple executable segments */
errSecCSInvalidEntitlements = -66994, /* invalid entitlement plist */
errSecCSInvalidRuntimeVersion = -66993, /* an invalid runtime version was explicitly set */
errSecCSRevokedNotarization = -66992, /* notarization indicates this code has been revoked */
};
/*
* Code Signing specific CFError "user info" keys.
* In calls that can return CFErrorRef indications, if a CFErrorRef is actually
* returned, its "user info" dictionary may contain some of the following keys
* to more closely describe the circumstances of the failure.
* Do not rely on the presence of any particular key to categorize a problem;
* always use the primary OSStatus return for that. The data contained under
* these keys is always supplemental and optional.
*/
extern const CFStringRef kSecCFErrorArchitecture; /* CFStringRef: name of architecture causing the problem */
extern const CFStringRef kSecCFErrorPattern; /* CFStringRef: invalid resource selection pattern encountered */
extern const CFStringRef kSecCFErrorResourceSeal; /* CFTypeRef: invalid component in resource seal (CodeResources) */
extern const CFStringRef kSecCFErrorResourceAdded; /* CFURLRef: unsealed resource found */
extern const CFStringRef kSecCFErrorResourceAltered; /* CFURLRef: modified resource found */
extern const CFStringRef kSecCFErrorResourceMissing; /* CFURLRef: sealed (non-optional) resource missing */
extern const CFStringRef kSecCFErrorResourceSideband; /* CFURLRef: sealed resource has invalid sideband data (resource fork, etc.) */
extern const CFStringRef kSecCFErrorInfoPlist; /* CFTypeRef: Info.plist dictionary or component thereof found invalid */
extern const CFStringRef kSecCFErrorGuestAttributes; /* CFTypeRef: Guest attribute set of element not accepted */
extern const CFStringRef kSecCFErrorRequirementSyntax; /* CFStringRef: compilation error for Requirement source */
extern const CFStringRef kSecCFErrorPath; /* CFURLRef: subcomponent containing the error */
/*!
@typedef SecCodeRef
This is the type of a reference to running code.
In many (but not all) calls, this can be passed to a SecStaticCodeRef
argument, which performs an implicit SecCodeCopyStaticCode call and
operates on the result.
*/
typedef struct CF_BRIDGED_TYPE(id) __SecCode *SecCodeRef; /* running code */
/*!
@typedef SecStaticCodeRef
This is the type of a reference to static code on disk.
*/
typedef struct CF_BRIDGED_TYPE(id) __SecCode const *SecStaticCodeRef; /* code on disk */
/*!
@typedef SecRequirementRef
This is the type of a reference to a code requirement.
*/
typedef struct CF_BRIDGED_TYPE(id) __SecRequirement *SecRequirementRef; /* code requirement */
/*!
@typedef SecGuestRef
An abstract handle to identify a particular Guest in the context of its Host.
Guest handles are assigned by the host at will, with kSecNoGuest (zero) being
reserved as the null value. They can be reused for new children if desired.
*/
typedef u_int32_t SecGuestRef;
CF_ENUM(SecGuestRef) {
kSecNoGuest = 0, /* not a valid SecGuestRef */
};
/*!
@typedef SecCSFlags
This is the type of flags arguments to Code Signing API calls.
It provides a bit mask of request and option flags. All of the bits in these
masks are reserved to Apple; if you set any bits not defined in these headers,
the behavior is generally undefined.
This list describes the flags that are shared among several Code Signing API calls.
Flags that only apply to one call are defined and documented with that call.
Global flags are assigned from high order down (31 -> 0); call-specific flags
are assigned from the bottom up (0 -> 31).
@constant kSecCSDefaultFlags
When passed to a flags argument throughout, indicates that default behavior
is desired. Do not mix with other flags values.
@constant kSecCSConsiderExpiration
When passed to a call that performs code validation, requests that code signatures
made by expired certificates be rejected. By default, expiration of participating
certificates is not automatic grounds for rejection.
*/
typedef CF_OPTIONS(uint32_t, SecCSFlags) {
kSecCSDefaultFlags = 0, /* no particular flags (default behavior) */
kSecCSConsiderExpiration = 1U << 31, /* consider expired certificates invalid */
kSecCSEnforceRevocationChecks = 1 << 30, /* force revocation checks regardless of preference settings */
kSecCSNoNetworkAccess = 1 << 29, /* do not use the network, cancels "kSecCSEnforceRevocationChecks" */
kSecCSReportProgress = 1 << 28, /* make progress report call-backs when configured */
kSecCSCheckTrustedAnchors = 1 << 27, /* build certificate chain to system trust anchors, not to any self-signed certificate */
kSecCSQuickCheck = 1 << 26, /* (internal) */
kSecCSApplyEmbeddedPolicy = 1 << 25, /* Apply Embedded (iPhone) policy regardless of the platform we're running on */
};
/*!
@typedef SecCodeSignatureFlags
This is the type of option flags that can be embedded in a code signature
during signing, and that govern the use of the signature thereafter.
Some of these flags can be set through the codesign(1) command's --options
argument; some are set implicitly based on signing circumstances; and all
can be set with the kSecCodeSignerFlags item of a signing information dictionary.
@constant kSecCodeSignatureHost
Indicates that the code may act as a host that controls and supervises guest
code. If this flag is not set in a code signature, the code is never considered
eligible to be a host, and any attempt to act like one will be ignored or rejected.
@constant kSecCodeSignatureAdhoc
The code has been sealed without a signing identity. No identity may be retrieved
from it, and any code requirement placing restrictions on the signing identity
will fail. This flag is set by the code signing API and cannot be set explicitly.
@constant kSecCodeSignatureForceHard
Implicitly set the "hard" status bit for the code when it starts running.
This bit indicates that the code prefers to be denied access to a resource
if gaining such access would cause its invalidation. Since the hard bit is
sticky, setting this option bit guarantees that the code will always have
it set.
@constant kSecCodeSignatureForceKill
Implicitly set the "kill" status bit for the code when it starts running.
This bit indicates that the code wishes to be terminated with prejudice if
it is ever invalidated. Since the kill bit is sticky, setting this option bit
guarantees that the code will always be dynamically valid, since it will die
immediately if it becomes invalid.
@constant kSecCodeSignatureForceExpiration
Forces the kSecCSConsiderExpiration flag on all validations of the code.
@constant kSecCodeSignatureRuntime
Instructs the kernel to apply runtime hardening policies as required by the
hardened runtime version
@constant kSecCodeSignatureLinkerSigned
The code was automatically signed by the linker. This signature should be
ignored in any new signing operation.
*/
typedef CF_OPTIONS(uint32_t, SecCodeSignatureFlags) {
kSecCodeSignatureHost = 0x0001, /* may host guest code */
kSecCodeSignatureAdhoc = 0x0002, /* must be used without signer */
kSecCodeSignatureForceHard = 0x0100, /* always set HARD mode on launch */
kSecCodeSignatureForceKill = 0x0200, /* always set KILL mode on launch */
kSecCodeSignatureForceExpiration = 0x0400, /* force certificate expiration checks */
kSecCodeSignatureRestrict = 0x0800, /* restrict dyld loading */
kSecCodeSignatureEnforcement = 0x1000, /* enforce code signing */
kSecCodeSignatureLibraryValidation = 0x2000, /* library validation required */
kSecCodeSignatureRuntime = 0x10000, /* apply runtime hardening policies */
kSecCodeSignatureLinkerSigned = 0x20000, /* identify that the signature was auto-generated by the linker*/
};
/*!
@typedef SecCodeStatus
The code signing system attaches a set of status flags to each running code.
These flags are maintained by the code's host, and can be read by anyone.
A code may change its own flags, a host may change its guests' flags,
and root may change anyone's flags. However, these flags are sticky in that
each can change in only one direction (and never back, for the lifetime of the code).
Not even root can violate this restriction.
There are other flags in SecCodeStatus that are not publicly documented.
Do not rely on them, and do not ever attempt to explicitly set them.
@constant kSecCodeStatusValid
Indicates that the code is dynamically valid, i.e. it started correctly
and has not been invalidated since then. The valid bit can only be cleared.
Warning: This bit is not your one-stop shortcut to determining the validity of code.
It represents the dynamic component of the full validity function; if this
bit is unset, the code is definitely invalid, but the converse is not always true.
In fact, code hosts may represent the outcome of some delayed static validation work in this bit,
and thus it strictly represents a blend of (all of) dynamic and (some of) static validity,
depending on the implementation of the particular host managing the code. You can (only)
rely that (1) dynamic invalidation will clear this bit; and (2) the combination
of static validation and dynamic validity (as performed by the SecCodeCheckValidity* APIs)
will give a correct answer.
@constant kSecCodeStatusHard
Indicates that the code prefers to be denied access to resources if gaining access
would invalidate it. This bit can only be set.
It is undefined whether code that is marked hard and is already invalid will still
be denied access to a resource that would invalidate it if it were still valid. That is,
the code may or may not get access to such a resource while being invalid, and that choice
may appear random.
@constant kSecCodeStatusKill
Indicates that the code wants to be killed (terminated) if it ever loses its validity.
This bit can only be set. Code that has the kill flag set will never be dynamically invalid
(and live). Note however that a change in static validity does not necessarily trigger instant
death.
@constant kSecCodeStatusDebugged
Indicated that code has been debugged by another process that was allowed to do so. The debugger
causes this to be set when it attachs.
@constant kSecCodeStatusPlatform
Indicates the code is platform code, shipping with the operating system and signed by Apple.
*/
typedef CF_OPTIONS(uint32_t, SecCodeStatus) {
kSecCodeStatusValid = 0x00000001,
kSecCodeStatusHard = 0x00000100,
kSecCodeStatusKill = 0x00000200,
kSecCodeStatusDebugged = 0x10000000,
kSecCodeStatusPlatform = 0x04000000,
};
/*!
@typedef SecRequirementType
An enumeration indicating different types of internal requirements for code.
*/
typedef CF_ENUM(uint32_t, SecRequirementType) {
kSecHostRequirementType = 1, /* what hosts may run us */
kSecGuestRequirementType = 2, /* what guests we may run */
kSecDesignatedRequirementType = 3, /* designated requirement */
kSecLibraryRequirementType = 4, /* what libraries we may link against */
kSecPluginRequirementType = 5, /* what plug-ins we may load */
kSecInvalidRequirementType, /* invalid type of Requirement (must be last) */
kSecRequirementTypeCount = kSecInvalidRequirementType /* number of valid requirement types */
};
/*!
Types of cryptographic digests (hashes) used to hold code signatures
together.
Each combination of type, length, and other parameters is a separate
hash type; we don't understand "families" here.
These type codes govern the digest links that connect a CodeDirectory
to its subordinate data structures (code pages, resources, etc.)
They do not directly control other uses of hashes (such as those used
within X.509 certificates and CMS blobs).
*/
typedef CF_ENUM(uint32_t, SecCSDigestAlgorithm) {
kSecCodeSignatureNoHash = 0, /* null value */
kSecCodeSignatureHashSHA1 = 1, /* SHA-1 */
kSecCodeSignatureHashSHA256 = 2, /* SHA-256 */
kSecCodeSignatureHashSHA256Truncated = 3, /* SHA-256 truncated to first 20 bytes */
kSecCodeSignatureHashSHA384 = 4, /* SHA-384 */
kSecCodeSignatureHashSHA512 = 5, /* SHA-512 */
};
CF_ASSUME_NONNULL_END
#ifdef __cplusplus
}
#endif
#endif //_H_CSCOMMON
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/Authorization.h | /*
* Copyright (c) 2000-2004,2007,2011-2012 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
* Authorization.h -- APIs for implementing access control in applications
* and daemons.
*/
#ifndef _SECURITY_AUTHORIZATION_H_
#define _SECURITY_AUTHORIZATION_H_
#include <TargetConditionals.h>
#include <MacTypes.h>
#include <Availability.h>
#include <CoreFoundation/CFAvailability.h>
#include <CoreFoundation/CFBase.h>
#include <CoreFoundation/CFArray.h>
#include <stdio.h>
#if defined(__cplusplus)
extern "C" {
#endif
CF_ASSUME_NONNULL_BEGIN
/*!
@header Authorization
Version 1.0 10/16/2000
The Authorization API contains all the APIs that a application or tool that need pre-authorization or need an authorization desision made.
A typical use cases are a preference panel that would start off calling AuthorizationCreate() (without UI) to get an authorization object. Then call AuthorizationCopyRights() to figure out what is currently allowed.
If any of the operations that the preference panel wishes to perform are currently not allowed the lock icon in the window would show up in the locked state. Otherwise it would show up unlocked.
When the user locks the lock AuthorizationFree() is called with the kAuthorizationFlagDestroyRights to destroy any authorization rights that have been acquired.
When the user unlocks the lock AuthorizationCreate() is called with the kAuthorizationFlagInteractionAllowed and kAuthorizationFlagExtendRights flags to obtain all required rights. The old authorization object can be freed by calling AuthorizationFree() with no flags.
*/
/*!
@defined kAuthorizationEmptyEnvironment
Parameter to specify to AuthorizationCreate when no environment is being provided.
*/
#define kAuthorizationEmptyEnvironment NULL
/*!
@enum AuthorizationStatus
Error codes returned by Authorization API.
*/
/*
Note: the comments that appear after these errors are used to create SecErrorMessages.strings.
The comments must not be multi-line, and should be in a form meaningful to an end user. If
a different or additional comment is needed, it can be put in the header doc format, or on a
line that does not start with errZZZ.
errAuthorizationSuccess can't include a string as it's also errSecSuccess in libsecurity_keychain/lib/SecBase.h
*/
CF_ENUM(OSStatus) {
errAuthorizationSuccess = 0,
errAuthorizationInvalidSet = -60001, /* The authorization rights are invalid. */
errAuthorizationInvalidRef = -60002, /* The authorization reference is invalid. */
errAuthorizationInvalidTag = -60003, /* The authorization tag is invalid. */
errAuthorizationInvalidPointer = -60004, /* The returned authorization is invalid. */
errAuthorizationDenied = -60005, /* The authorization was denied. */
errAuthorizationCanceled = -60006, /* The authorization was canceled by the user. */
errAuthorizationInteractionNotAllowed = -60007, /* The authorization was denied since no user interaction was possible. */
errAuthorizationInternal = -60008, /* Unable to obtain authorization for this operation. */
errAuthorizationExternalizeNotAllowed = -60009, /* The authorization is not allowed to be converted to an external format. */
errAuthorizationInternalizeNotAllowed = -60010, /* The authorization is not allowed to be created from an external format. */
errAuthorizationInvalidFlags = -60011, /* The provided option flag(s) are invalid for this authorization operation. */
errAuthorizationToolExecuteFailure = -60031, /* The specified program could not be executed. */
errAuthorizationToolEnvironmentError = -60032, /* An invalid status was returned during execution of a privileged tool. */
errAuthorizationBadAddress = -60033, /* The requested socket address is invalid (must be 0-1023 inclusive). */
};
/*!
@typedef AuthorizationFlags
Optional flags passed in to several Authorization APIs.
See the description of AuthorizationCreate, AuthorizationCopyRights and AuthorizationFree for a description of how they affect those calls.
*/
typedef CF_OPTIONS(UInt32, AuthorizationFlags) {
kAuthorizationFlagDefaults = 0,
kAuthorizationFlagInteractionAllowed = (1 << 0),
kAuthorizationFlagExtendRights = (1 << 1),
kAuthorizationFlagPartialRights = (1 << 2),
kAuthorizationFlagDestroyRights = (1 << 3),
kAuthorizationFlagPreAuthorize = (1 << 4),
// private bits (do not use)
kAuthorizationFlagNoData = (1 << 20)
};
/*!
@enum AuthorizationRightFlags
Flags returned in the flags field of ItemSet Items when calling AuthorizationCopyRights().
*/
enum {
kAuthorizationFlagCanNotPreAuthorize = (1 << 0)
};
/*!
@typedef AuthorizationRef
Opaque reference to an authorization object.
*/
typedef const struct AuthorizationOpaqueRef *AuthorizationRef;
/*!
@typedef AuthorizationString
A zero terminated string in UTF-8 encoding.
*/
typedef const char *AuthorizationString;
/*!
@typedef AuthorizationItem
Each AuthorizationItem describes a single string-named item with optional
parameter value. The value must be contiguous memory of valueLength bytes;
internal structure is defined separately for each name.
@field name name of the item, as an AuthorizationString. Mandatory.
@field valueLength Number of bytes in parameter value. Must be 0 if no parameter value.
@field value Pointer to the optional parameter value associated with name.
Must be NULL if no parameter value.
@field flags Reserved field. Must be set to 0 on creation. Do not modify after that.
*/
typedef struct {
AuthorizationString name;
size_t valueLength;
void * __nullable value;
UInt32 flags;
} AuthorizationItem;
/*!
@typedef AuthorizationItemSet
An AuthorizationItemSet structure represents a set of zero or more AuthorizationItems. Since it is a set it should not contain any identical AuthorizationItems.
@field count Number of items identified by items.
@field items Pointer to an array of items.
*/
typedef struct {
UInt32 count;
AuthorizationItem * __nullable items;
} AuthorizationItemSet;
static const size_t kAuthorizationExternalFormLength = 32;
/*!
@typedef AuthorizationExternalForm
An AuthorizationExternalForm structure can hold the externalized form of
an AuthorizationRef. As such, it can be transmitted across IPC channels
to other processes, which can re-internalize it to recover a valid AuthorizationRef
handle.
The data contained in an AuthorizationExternalForm should be considered opaque.
SECURITY NOTE: Applications should take care to not disclose the AuthorizationExternalForm to
potential attackers since it would authorize rights to them.
*/
typedef struct {
char bytes[kAuthorizationExternalFormLength];
} AuthorizationExternalForm;
/*!
@typedef AuthorizationRights
An AuthorizationItemSet representing a set of rights each with an associated argument (value).
Each argument value is as defined for the specific right they belong to. Argument values may not contain pointers as the should be copyable to different address spaces.
*/
typedef AuthorizationItemSet AuthorizationRights;
/*!
@typedef AuthorizationEnvironment
An AuthorizationItemSet representing environmental information of potential use
to authorization decisions.
*/
typedef AuthorizationItemSet AuthorizationEnvironment;
/*!
@function AuthorizationCreate
Create a new autorization object which can be used in other authorization calls. When the authorization is no longer needed AuthorizationFree should be called.
When the kAuthorizationFlagInteractionAllowed flag is set, user interaction will happen when required. Failing to set this flag will result in this call failing with a errAuthorizationInteractionNotAllowed status when interaction is required.
Setting the kAuthorizationFlagExtendRights flag will extend the currently available rights. If this flag is set the returned AuthorizationRef will grant all the rights requested when errAuthorizationSuccess is returned. If this flag is not set the operation will almost certainly succeed, but no attempt will be made to make the requested rights availible.
Call AuthorizationCopyRights to figure out which of the requested rights are granted by the returned AuthorizationRef.
Setting the kAuthorizationFlagPartialRights flag will cause this call to succeed if only some of the requested rights are being granted by the returned AuthorizationRef. Unless this flag is set this API will fail if not all the requested rights could be obtained.
Setting the kAuthorizationFlagDestroyRights flag will prevent any rights obtained during this call from being preserved after returning from this API (This is most useful when the authorization parameter is NULL and the caller doesn't want to affect the session state in any way).
Setting the kAuthorizationFlagPreAuthorize flag will pre authorize the requested rights so that at a later time -- by calling AuthorizationMakeExternalForm() follow by AuthorizationCreateFromExternalForm() -- the obtained rights can be used in a different process. Rights that can't be preauthorized will be treated as if they were authorized for the sake of returning an error (in other words if all rights are either authorized or could not be preauthorized this call will still succeed).
The rights which could not be preauthorized are not currently authorized and may fail to authorize when a later call to AuthorizationCopyRights() is made, unless the kAuthorizationFlagExtendRights and kAuthorizationFlagInteractionAllowed flags are set. Even then they might still fail if the user does not supply the correct credentials.
The reason for passing in this flag is to provide correct audit trail information and to avoid unnecessary user interaction.
@param rights (input/optional) An AuthorizationItemSet containing rights for which authorization is being requested. If none are specified the resulting AuthorizationRef will authorize nothing at all.
@param environment (input/optional) An AuthorizationItemSet containing environment state used when making the autorization decision. See the AuthorizationEnvironment type for details.
@param flags (input) options specified by the AuthorizationFlags enum. set all unused bits to zero to allow for future expansion.
@param authorization (output optional) A pointer to an AuthorizationRef to be returned. When the returned AuthorizationRef is no longer needed AuthorizationFree should be called to prevent anyone from using the acquired rights. If NULL is specified no new rights are returned, but the system will attempt to authorize all the requested rights and return the appropriate status.
@result errAuthorizationSuccess 0 authorization or all requested rights succeeded.
errAuthorizationDenied -60005 The authorization for one or more of the requested rights was denied.
errAuthorizationCanceled -60006 The authorization was canceled by the user.
errAuthorizationInteractionNotAllowed -60007 The authorization was denied since no interaction with the user was allowed.
*/
OSStatus AuthorizationCreate(const AuthorizationRights * __nullable rights,
const AuthorizationEnvironment * __nullable environment,
AuthorizationFlags flags,
AuthorizationRef __nullable * __nullable authorization);
/*!
@function AuthorizationFree
Destroy an AutorizationRef object. If the kAuthorizationFlagDestroyRights flag is passed,
any rights associated with the authorization are lost. Otherwise, only local resources
are released, and the rights may still be available to other clients.
Setting the kAuthorizationFlagDestroyRights flag will prevent any rights that were obtained by the specified authorization object to be preserved after returning from this API. This effectivaly locks down all potentially shared authorizations.
@param authorization (input) The authorization object on which this operation is performed.
@param flags (input) Bit mask of option flags to this call.
@result errAuthorizationSuccess 0 No error.
errAuthorizationInvalidRef -60002 The authorization parameter is invalid.
*/
OSStatus AuthorizationFree(AuthorizationRef authorization, AuthorizationFlags flags);
/*!
@function AuthorizationCopyRights
Given a set of rights, return the subset that is currently authorized
by the AuthorizationRef given.
When the kAuthorizationFlagInteractionAllowed flag is set, user interaction will happen when required. Failing to set this flag will result in this call failing with a errAuthorizationInteractionNotAllowed status when interaction is required.
Setting the kAuthorizationFlagExtendRights flag will extend the currently available rights.
Setting the kAuthorizationFlagPartialRights flag will cause this call to succeed if only some of the requested rights are being granted by the returned AuthorizationRef. Unless this flag is set this API will fail if not all the requested rights could be obtained.
Setting the kAuthorizationFlagDestroyRights flag will prevent any additional rights obtained during this call from being preserved after returning from this API.
Setting the kAuthorizationFlagPreAuthorize flag will pre authorize the requested rights so that at a later time -- by calling AuthorizationMakeExternalForm() follow by AuthorizationCreateFromExternalForm() -- the obtained rights can be used in a different process. Rights that can't be preauthorized will be treated as if they were authorized for the sake of returning an error (in other words if all rights are either authorized or could not be preauthorized this call will still succeed), and they will be returned in authorizedRights with their kAuthorizationFlagCanNotPreAuthorize bit in the flags field set to 1.
The rights which could not be preauthorized are not currently authorized and may fail to authorize when a later call to AuthorizationCopyRights() is made, unless the kAuthorizationFlagExtendRights and kAuthorizationFlagInteractionAllowed flags are set. Even then they might still fail if the user does not supply the correct credentials.
The reason for passing in this flag is to provide correct audit trail information and to avoid unnecessary user interaction.
Setting the kAuthorizationFlagPreAuthorize flag will pre authorize the requested rights so that at a later time -- by calling AuthorizationMakeExternalForm() follow by AuthorizationCreateFromExternalForm() -- the obtained rights can be used in a different process. When this flags is specified rights that can't be preauthorized will be returned as if they were authorized with their kAuthorizationFlagCanNotPreAuthorize bit in the flags field set to 1. These rights are not currently authorized and may fail to authorize later unless kAuthorizationFlagExtendRights and kAuthorizationFlagInteractionAllowed flags are set when the actual authorization is done. And even then they might still fail if the user does not supply the correct credentials.
@param authorization (input) The authorization object on which this operation is performed.
@param rights (input) A rights set (see AuthorizationCreate).
@param environment (input/optional) An AuthorizationItemSet containing environment state used when making the autorization decision. See the AuthorizationEnvironment type for details.
@param flags (input) options specified by the AuthorizationFlags enum. set all unused bits to zero to allow for future expansion.
@param authorizedRights (output/optional) A pointer to a newly allocated AuthorizationInfoSet in which the authorized subset of rights are returned (authorizedRights should be deallocated by calling AuthorizationFreeItemSet() when it is no longer needed). If NULL the only information returned is the status. Note that if the kAuthorizationFlagPreAuthorize flag was specified rights that could not be preauthorized are returned in authorizedRights, but their flags contains the kAuthorizationFlagCanNotPreAuthorize bit.
@result errAuthorizationSuccess 0 No error.
errAuthorizationInvalidRef -60002 The authorization parameter is invalid.
errAuthorizationInvalidSet -60001 The rights parameter is invalid.
errAuthorizationInvalidPointer -60004 The authorizedRights parameter is invalid.
*/
OSStatus AuthorizationCopyRights(AuthorizationRef authorization,
const AuthorizationRights *rights,
const AuthorizationEnvironment * __nullable environment,
AuthorizationFlags flags,
AuthorizationRights * __nullable * __nullable authorizedRights);
#ifdef __BLOCKS__
/*!
@typedef AuthorizationAsyncCallback
Callback block passed to AuthorizationCopyRightsAsync.
@param err (output) The result of the AuthorizationCopyRights call.
@param blockAuthorizedRights (output) The authorizedRights from the AuthorizationCopyRights call to be deallocated by calling AuthorizationFreeItemSet() when it is no longer needed.
*/
typedef void (^AuthorizationAsyncCallback)(OSStatus err, AuthorizationRights * __nullable blockAuthorizedRights);
/*!
@function AuthorizationCopyRightsAsync
An asynchronous version of AuthorizationCopyRights.
@param callbackBlock (input) The callback block to be called upon completion.
*/
void AuthorizationCopyRightsAsync(AuthorizationRef authorization,
const AuthorizationRights *rights,
const AuthorizationEnvironment * __nullable environment,
AuthorizationFlags flags,
AuthorizationAsyncCallback callbackBlock);
#endif /* __BLOCKS__ */
/*!
@function AuthorizationCopyInfo
Returns sideband information (e.g. access credentials) obtained from a call to AuthorizationCreate. The format of this data depends of the tag specified.
@param authorization (input) The authorization object on which this operation is performed.
@param tag (input/optional) An optional string tag specifing which sideband information should be returned. When NULL is specified all available information is returned.
@param info (output) A pointer to a newly allocated AuthorizationInfoSet in which the requested sideband infomation is returned (info should be deallocated by calling AuthorizationFreeItemSet() when it is no longer needed).
@result errAuthorizationSuccess 0 No error.
errAuthorizationInvalidRef -60002 The authorization parameter is invalid.
errAuthorizationInvalidTag -60003 The tag parameter is invalid.
errAuthorizationInvalidPointer -60004 The info parameter is invalid.
*/
OSStatus AuthorizationCopyInfo(AuthorizationRef authorization,
AuthorizationString __nullable tag,
AuthorizationItemSet * __nullable * __nonnull info);
/*!
@function AuthorizationMakeExternalForm
Turn an Authorization into an external "byte blob" form so it can be
transmitted to another process.
Note that *storing* the external form somewhere will probably not do what
you want, since authorizations are bounded by sessions, processes, and possibly
time limits. This is for online transmission of authorizations.
@param authorization The (valid) authorization reference to externalize
@param extForm Pointer to an AuthorizationExternalForm variable to fill.
@result errAuthorizationSuccess 0 No error.
errAuthorizationExternalizeNotAllowed -60009 Externalizing this authorization is not allowed.
errAuthorizationInvalidRef -60002 The authorization parameter is invalid.
*/
OSStatus AuthorizationMakeExternalForm(AuthorizationRef authorization,
AuthorizationExternalForm * __nonnull extForm);
/*!
@function AuthorizationCreateFromExternalForm
Internalize the external "byte blob" form of an authorization reference.
@param extForm Pointer to an AuthorizationExternalForm value.
@param authorization Will be filled with a valid AuthorizationRef on success.
@result errAuthorizationInternalizeNotAllowed -60010 Internalizing this authorization is not allowed.
*/
OSStatus AuthorizationCreateFromExternalForm(const AuthorizationExternalForm *extForm,
AuthorizationRef __nullable * __nonnull authorization);
/*!
@function AuthorizationFreeItemSet
Release the memory allocated for an AuthorizationItemSet that was allocated
by an API call.
@param set The AuthorizationItemSet to deallocate.
@result errAuthorizationSuccess 0 No error.
errAuthorizationInvalidSet -60001 The set parameter is invalid.
*/
OSStatus AuthorizationFreeItemSet(AuthorizationItemSet *set);
/*!
@function AuthorizationExecuteWithPrivileges
Run an executable tool with enhanced privileges after passing
suitable authorization procedures.
@param authorization An authorization reference that is used to authorize
access to the enhanced privileges. It is also passed to the tool for
further access control.
@param pathToTool Full pathname to the tool that should be executed
with enhanced privileges.
@param options Option bits (reserved). Must be zero.
@param arguments An argv-style vector of strings to be passed to the tool.
@param communicationsPipe Assigned a UNIX stdio FILE pointer for
a bidirectional pipe to communicate with the tool. The tool will have
this pipe as its standard I/O channels (stdin/stdout). If NULL, do not
establish a communications pipe.
@discussion This function has been deprecated and should no longer be used.
Use a launchd-launched helper tool and/or the Service Mangement framework
for this functionality.
*/
OSStatus AuthorizationExecuteWithPrivileges(AuthorizationRef authorization,
const char *pathToTool,
AuthorizationFlags options,
char * __nonnull const * __nonnull arguments,
FILE * __nullable * __nullable communicationsPipe) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_7,__IPHONE_NA,__IPHONE_NA);
/*!
@function AuthorizationCopyPrivilegedReference
From within a tool launched via the AuthorizationExecuteWithPrivileges function
ONLY, retrieve the AuthorizationRef originally passed to that function.
While AuthorizationExecuteWithPrivileges already verified the authorization to
launch your tool, the tool may want to avail itself of any additional pre-authorizations
the caller may have obtained through that reference.
@discussion This function has been deprecated and should no longer be used.
Use a launchd-launched helper tool and/or the Service Mangement framework
for this functionality.
*/
OSStatus AuthorizationCopyPrivilegedReference(AuthorizationRef __nullable * __nonnull authorization,
AuthorizationFlags flags) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_7,__IPHONE_NA,__IPHONE_NA);
CF_ASSUME_NONNULL_END
#if defined(__cplusplus)
}
#endif
#endif /* !_SECURITY_AUTHORIZATION_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/x509defs.h | /*
* Copyright (c) 1999-2002,2004,2011,2014 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*
* x509defs.h -- Data structures for X509 Certificate Library field values
*/
#ifndef _X509DEFS_H_
#define _X509DEFS_H_ 1
#include <Security/cssmtype.h>
#ifdef __cplusplus
extern "C" {
#endif
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
typedef uint8 CSSM_BER_TAG;
#define BER_TAG_UNKNOWN 0
#define BER_TAG_BOOLEAN 1
#define BER_TAG_INTEGER 2
#define BER_TAG_BIT_STRING 3
#define BER_TAG_OCTET_STRING 4
#define BER_TAG_NULL 5
#define BER_TAG_OID 6
#define BER_TAG_OBJECT_DESCRIPTOR 7
#define BER_TAG_EXTERNAL 8
#define BER_TAG_REAL 9
#define BER_TAG_ENUMERATED 10
/* 12 to 15 are reserved for future versions of the recommendation */
#define BER_TAG_PKIX_UTF8_STRING 12
#define BER_TAG_SEQUENCE 16
#define BER_TAG_SET 17
#define BER_TAG_NUMERIC_STRING 18
#define BER_TAG_PRINTABLE_STRING 19
#define BER_TAG_T61_STRING 20
#define BER_TAG_TELETEX_STRING BER_TAG_T61_STRING
#define BER_TAG_VIDEOTEX_STRING 21
#define BER_TAG_IA5_STRING 22
#define BER_TAG_UTC_TIME 23
#define BER_TAG_GENERALIZED_TIME 24
#define BER_TAG_GRAPHIC_STRING 25
#define BER_TAG_ISO646_STRING 26
#define BER_TAG_GENERAL_STRING 27
#define BER_TAG_VISIBLE_STRING BER_TAG_ISO646_STRING
/* 28 - are reserved for future versions of the recommendation */
#define BER_TAG_PKIX_UNIVERSAL_STRING 28
#define BER_TAG_PKIX_BMP_STRING 30
/* Data Structures for X.509 Certificates */
#define CSSM_X509_ALGORITHM_IDENTIFIER SecAsn1AlgId
typedef SecAsn1AlgId *CSSM_X509_ALGORITHM_IDENTIFIER_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* X509 Distinguished name structure */
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_x509_type_value_pair {
CSSM_OID type;
CSSM_BER_TAG valueType; /* The Tag to be used when */
/*this value is BER encoded */
CSSM_DATA value;
} CSSM_X509_TYPE_VALUE_PAIR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_X509_TYPE_VALUE_PAIR_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_x509_rdn {
uint32 numberOfPairs;
CSSM_X509_TYPE_VALUE_PAIR_PTR AttributeTypeAndValue;
} CSSM_X509_RDN DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_X509_RDN_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_x509_name {
uint32 numberOfRDNs;
CSSM_X509_RDN_PTR RelativeDistinguishedName;
} CSSM_X509_NAME DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_X509_NAME_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* Public key info struct */
#define CSSM_X509_SUBJECT_PUBLIC_KEY_INFO SecAsn1PubKeyInfo
typedef SecAsn1PubKeyInfo *CSSM_X509_SUBJECT_PUBLIC_KEY_INFO_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_x509_time {
CSSM_BER_TAG timeType;
CSSM_DATA time;
} CSSM_X509_TIME DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_X509_TIME_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* Validity struct */
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER x509_validity {
CSSM_X509_TIME notBefore;
CSSM_X509_TIME notAfter;
} CSSM_X509_VALIDITY DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_X509_VALIDITY_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
#define CSSM_X509_OPTION_PRESENT CSSM_TRUE
#define CSSM_X509_OPTION_NOT_PRESENT CSSM_FALSE
typedef CSSM_BOOL CSSM_X509_OPTION;
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_x509ext_basicConstraints {
CSSM_BOOL cA;
CSSM_X509_OPTION pathLenConstraintPresent;
uint32 pathLenConstraint;
} CSSM_X509EXT_BASICCONSTRAINTS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_X509EXT_BASICCONSTRAINTS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef enum extension_data_format {
CSSM_X509_DATAFORMAT_ENCODED = 0,
CSSM_X509_DATAFORMAT_PARSED,
CSSM_X509_DATAFORMAT_PAIR
} CSSM_X509EXT_DATA_FORMAT;
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_x509_extensionTagAndValue {
CSSM_BER_TAG type;
CSSM_DATA value;
} CSSM_X509EXT_TAGandVALUE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_X509EXT_TAGandVALUE_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_x509ext_pair {
CSSM_X509EXT_TAGandVALUE tagAndValue;
void *parsedValue;
} CSSM_X509EXT_PAIR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_X509EXT_PAIR_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* Extension structure */
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_x509_extension {
CSSM_OID extnId;
CSSM_BOOL critical;
CSSM_X509EXT_DATA_FORMAT format;
union DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_x509ext_value {
CSSM_X509EXT_TAGandVALUE *tagAndValue;
void *parsedValue;
CSSM_X509EXT_PAIR *valuePair;
} value;
CSSM_DATA BERvalue;
} CSSM_X509_EXTENSION DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_X509_EXTENSION_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_x509_extensions {
uint32 numberOfExtensions;
CSSM_X509_EXTENSION_PTR extensions;
} CSSM_X509_EXTENSIONS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_X509_EXTENSIONS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* X509V3 certificate structure */
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_x509_tbs_certificate {
CSSM_DATA version;
CSSM_DATA serialNumber;
CSSM_X509_ALGORITHM_IDENTIFIER signature;
CSSM_X509_NAME issuer;
CSSM_X509_VALIDITY validity;
CSSM_X509_NAME subject;
CSSM_X509_SUBJECT_PUBLIC_KEY_INFO subjectPublicKeyInfo;
CSSM_DATA issuerUniqueIdentifier;
CSSM_DATA subjectUniqueIdentifier;
CSSM_X509_EXTENSIONS extensions;
} CSSM_X509_TBS_CERTIFICATE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_X509_TBS_CERTIFICATE_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* Signature structure */
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_x509_signature {
CSSM_X509_ALGORITHM_IDENTIFIER algorithmIdentifier;
CSSM_DATA encrypted;
} CSSM_X509_SIGNATURE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_X509_SIGNATURE_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* Signed certificate structure */
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_x509_signed_certificate {
CSSM_X509_TBS_CERTIFICATE certificate;
CSSM_X509_SIGNATURE signature;
} CSSM_X509_SIGNED_CERTIFICATE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_X509_SIGNED_CERTIFICATE_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_x509ext_policyQualifierInfo {
CSSM_OID policyQualifierId;
CSSM_DATA value;
} CSSM_X509EXT_POLICYQUALIFIERINFO DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_X509EXT_POLICYQUALIFIERINFO_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_x509ext_policyQualifiers {
uint32 numberOfPolicyQualifiers;
CSSM_X509EXT_POLICYQUALIFIERINFO *policyQualifier;
} CSSM_X509EXT_POLICYQUALIFIERS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_X509EXT_POLICYQUALIFIERS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_x509ext_policyInfo {
CSSM_OID policyIdentifier;
CSSM_X509EXT_POLICYQUALIFIERS policyQualifiers;
} CSSM_X509EXT_POLICYINFO DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_X509EXT_POLICYINFO_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* Data Structures for X.509 Certificate Revocations Lists */
/* x509V2 entry in the CRL revokedCertificates sequence */
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_x509_revoked_cert_entry {
CSSM_DATA certificateSerialNumber;
CSSM_X509_TIME revocationDate;
CSSM_X509_EXTENSIONS extensions;
} CSSM_X509_REVOKED_CERT_ENTRY DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_X509_REVOKED_CERT_ENTRY_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_x509_revoked_cert_list {
uint32 numberOfRevokedCertEntries;
CSSM_X509_REVOKED_CERT_ENTRY_PTR revokedCertEntry;
} CSSM_X509_REVOKED_CERT_LIST DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_X509_REVOKED_CERT_LIST_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* x509v2 Certificate Revocation List (CRL) (unsigned) structure */
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_x509_tbs_certlist {
CSSM_DATA version;
CSSM_X509_ALGORITHM_IDENTIFIER signature;
CSSM_X509_NAME issuer;
CSSM_X509_TIME thisUpdate;
CSSM_X509_TIME nextUpdate;
CSSM_X509_REVOKED_CERT_LIST_PTR revokedCertificates;
CSSM_X509_EXTENSIONS extensions;
} CSSM_X509_TBS_CERTLIST DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_X509_TBS_CERTLIST_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_x509_signed_crl {
CSSM_X509_TBS_CERTLIST tbsCertList;
CSSM_X509_SIGNATURE signature;
} CSSM_X509_SIGNED_CRL DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_X509_SIGNED_CRL_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
#pragma clang diagnostic pop
#ifdef __cplusplus
}
#endif
#endif /* _X509DEFS_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/cssmconfig.h | /*
* Copyright (c) 2000-2001,2003-2004,2007,2011-2012 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*
* cssmconfig.h -- Platform specific defines and typedefs for cdsa.
*/
#ifndef _CSSMCONFIG_H_
#define _CSSMCONFIG_H_ 1
#include <AvailabilityMacros.h>
#include <TargetConditionals.h>
#include <ConditionalMacros.h>
/* #if defined(TARGET_API_MAC_OS8) || defined(TARGET_API_MAC_CARBON) || defined(TARGET_API_MAC_OSX) */
#if TARGET_OS_MAC
#include <sys/types.h>
#include <stdint.h>
#else
#error Unknown API architecture.
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _SINT64
typedef int64_t sint64;
#define _SINT64
#endif
#ifndef _UINT64
typedef uint64_t uint64;
#define _UINT64
#endif
#ifndef _SINT32
typedef int32_t sint32;
#define _SINT32
#endif
#ifndef _SINT16
typedef int16_t sint16;
#define _SINT16
#endif
#ifndef _SINT8
typedef int8_t sint8;
#define _SINT8
#endif
#ifndef _UINT32
typedef uint32_t uint32;
#define _UINT32
#endif
#ifndef _UINT16
typedef uint16_t uint16;
#define _UINT16
#endif
#ifndef _UINT8
typedef uint8_t uint8;
#define _UINT8
#endif
typedef intptr_t CSSM_INTPTR;
typedef size_t CSSM_SIZE;
#define CSSMACI
#define CSSMAPI
#define CSSMCLI
#define CSSMCSPI
#define CSSMDLI
#define CSSMKRI
#define CSSMSPI
#define CSSMTPI
#ifdef __cplusplus
}
#endif
#endif /* _CSSMCONFIG_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecRequirement.h | /*
* Copyright (c) 2006,2011,2013-2014 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
@header SecRequirement
SecRequirement represents a condition or constraint (a "Code Requirement")
that code must satisfy to be considered valid for some purpose.
SecRequirement itself does not understand or care WHY such a constraint
is appropriate or useful; it is purely a tool for formulating, recording,
and evaluating it.
Code Requirements are usually stored and retrieved in the form of a variable-length
binary Blob that can be encapsulated as a CFDataRef and safely stored in various
data structures. They can be formulated in a text form that can be compiled
into binary form and decompiled back into text form without loss of functionality
(though comments and formatting are not preserved).
*/
#ifndef _H_SECREQUIREMENT
#define _H_SECREQUIREMENT
#include <Security/CSCommon.h>
#include <Security/SecCertificate.h>
#ifdef __cplusplus
extern "C" {
#endif
CF_ASSUME_NONNULL_BEGIN
/*!
@function SecRequirementGetTypeID
Returns the type identifier of all SecRequirement instances.
*/
CFTypeID SecRequirementGetTypeID(void);
/*!
@function SecRequirementCreateWithData
Create a SecRequirement object from binary form.
This is the effective inverse of SecRequirementCopyData.
@param data A binary blob obtained earlier from a valid SecRequirement object
using the SecRequirementCopyData call. This is the only publicly supported
way to get such a data blob.
@param flags Optional flags. Pass kSecCSDefaultFlags for standard behavior.
@param requirement On successful return, contains a reference to a SecRequirement
object that behaves identically to the one the data blob was obtained from.
@result Upon success, errSecSuccess. Upon error, an OSStatus value documented in
CSCommon.h or certain other Security framework headers.
*/
OSStatus SecRequirementCreateWithData(CFDataRef data, SecCSFlags flags,
SecRequirementRef * __nonnull CF_RETURNS_RETAINED requirement);
/*!
@function SecRequirementCreateWithString
Create a SecRequirement object by compiling a valid text representation
of a requirement.
@param text A CFString containing the text form of a (single) Code Requirement.
@param flags Optional flags. Pass kSecCSDefaultFlags for standard behavior.
@param requirement On successful return, contains a reference to a SecRequirement
object that implements the conditions described in text.
@result Upon success, errSecSuccess. Upon error, an OSStatus value documented in
CSCommon.h or certain other Security framework headers.
*/
OSStatus SecRequirementCreateWithString(CFStringRef text, SecCSFlags flags,
SecRequirementRef * __nonnull CF_RETURNS_RETAINED requirement);
OSStatus SecRequirementCreateWithStringAndErrors(CFStringRef text, SecCSFlags flags,
CFErrorRef *errors, SecRequirementRef * __nonnull CF_RETURNS_RETAINED requirement);
/*!
@function SecRequirementCopyData
Extracts a stable, persistent binary form of a SecRequirement.
This is the effective inverse of SecRequirementCreateWithData.
@param requirement A valid SecRequirement object.
@param flags Optional flags. Pass kSecCSDefaultFlags for standard behavior.
@param data On successful return, contains a reference to a CFData object
containing a binary blob that can be fed to SecRequirementCreateWithData
to recreate a SecRequirement object with identical behavior.
@result Upon success, errSecSuccess. Upon error, an OSStatus value documented in
CSCommon.h or certain other Security framework headers.
*/
OSStatus SecRequirementCopyData(SecRequirementRef requirement, SecCSFlags flags,
CFDataRef * __nonnull CF_RETURNS_RETAINED data);
/*!
@function SecRequirementCopyString
Converts a SecRequirement object into text form.
This is the effective inverse of SecRequirementCreateWithString.
Repeated application of this function may produce text that differs in
formatting, may contain different source comments, and may perform its
validation functions in different order. However, it is guaranteed that
recompiling the text using SecRequirementCreateWithString will produce a
SecRequirement object that behaves identically to the one you start with.
@param requirement A valid SecRequirement object.
@param flags Optional flags. Pass kSecCSDefaultFlags for standard behavior.
@param text On successful return, contains a reference to a CFString object
containing a text representation of the requirement.
@result Upon success, errSecSuccess. Upon error, an OSStatus value documented in
CSCommon.h or certain other Security framework headers.
*/
OSStatus SecRequirementCopyString(SecRequirementRef requirement, SecCSFlags flags,
CFStringRef * __nonnull CF_RETURNS_RETAINED text);
CF_ASSUME_NONNULL_END
#ifdef __cplusplus
}
#endif
#endif //_H_SECREQUIREMENT
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/oidscert.h | /*
* Copyright (c) 1999-2004,2008-2014 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*
* oidscert.h -- Object Identifiers for X509 Certificate Library
*/
#ifndef _OIDSCERT_H_
#define _OIDSCERT_H_ 1
#include <Security/cssmconfig.h>
#include <Security/cssmtype.h>
#include <Security/oidsbase.h>
#ifdef __cplusplus
extern "C" {
#endif
#define INTEL_X509V3_CERT_R08 INTEL_SEC_FORMATS, 1, 1
#define INTEL_X509V3_CERT_R08_LENGTH INTEL_SEC_FORMATS_LENGTH + 2
/* Prefix for defining Certificate Extension field OIDs */
#define INTEL_X509V3_CERT_PRIVATE_EXTENSIONS INTEL_X509V3_CERT_R08, 50
#define INTEL_X509V3_CERT_PRIVATE_EXTENSIONS_LENGTH INTEL_X509V3_CERT_R08_LENGTH + 1
/* Prefix for defining signature field OIDs */
#define INTEL_X509V3_SIGN_R08 INTEL_SEC_FORMATS, 3, 2
#define INTEL_X509V3_SIGN_R08_LENGTH INTEL_SEC_FORMATS_LENGTH + 2
/* Suffix specifying format or representation of a field value */
/* Note that if a format suffix is not specified, a flat data representation is implied. */
#define INTEL_X509_C_DATATYPE 1
#define INTEL_X509_LDAPSTRING_DATATYPE 2
/* Certificate OIDS */
extern const CSSM_OID
CSSMOID_X509V3SignedCertificate DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V3SignedCertificateCStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V3Certificate DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V3CertificateCStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V1Version DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V1SerialNumber DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V1IssuerName DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, // normalized & encoded
CSSMOID_X509V1IssuerNameStd DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, // encoded
CSSMOID_X509V1IssuerNameCStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, // CSSM_X509_NAME
CSSMOID_X509V1IssuerNameLDAP DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V1ValidityNotBefore DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V1ValidityNotAfter DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V1SubjectName DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, // normalized & encoded
CSSMOID_X509V1SubjectNameStd DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, // encoded
CSSMOID_X509V1SubjectNameCStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, // CSSM_X509_NAME
CSSMOID_X509V1SubjectNameLDAP DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_CSSMKeyStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V1SubjectPublicKeyCStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V1SubjectPublicKeyAlgorithm DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V1SubjectPublicKeyAlgorithmParameters DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V1SubjectPublicKey DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V1CertificateIssuerUniqueId DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V1CertificateSubjectUniqueId DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V3CertificateExtensionsStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V3CertificateExtensionsCStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V3CertificateNumberOfExtensions DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V3CertificateExtensionStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V3CertificateExtensionCStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V3CertificateExtensionId DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V3CertificateExtensionCritical DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V3CertificateExtensionType DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V3CertificateExtensionValue DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
/* Signature OID Fields */
CSSMOID_X509V1SignatureStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V1SignatureCStruct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V1SignatureAlgorithm DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V1SignatureAlgorithmTBS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V1SignatureAlgorithmParameters DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_X509V1Signature DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
/* Extension OID Fields */
CSSMOID_SubjectSignatureBitmap DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_SubjectPicture DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_SubjectEmailAddress DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_UseExemptions DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/***
*** Apple addenda
***/
/*
* Standard Cert and CRL extensions.
*/
extern const CSSM_OID
CSSMOID_SubjectDirectoryAttributes DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_SubjectKeyIdentifier DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_KeyUsage DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PrivateKeyUsagePeriod DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_SubjectAltName DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_IssuerAltName DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_BasicConstraints DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_CrlNumber DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_CrlReason DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_HoldInstructionCode DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_InvalidityDate DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_DeltaCrlIndicator DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_IssuingDistributionPoint DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_IssuingDistributionPoints DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_CertIssuer DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_NameConstraints DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_CrlDistributionPoints DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_CertificatePolicies DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PolicyMappings DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PolicyConstraints DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_AuthorityKeyIdentifier DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ExtendedKeyUsage DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_InhibitAnyPolicy DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_AuthorityInfoAccess DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_BiometricInfo DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_QC_Statements DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_SubjectInfoAccess DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ExtendedKeyUsageAny DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ServerAuth DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ClientAuth DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ExtendedUseCodeSigning DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_EmailProtection DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_TimeStamping DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_OCSPSigning DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_KERBv5_PKINIT_KP_CLIENT_AUTH DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_KERBv5_PKINIT_KP_KDC DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_EKU_IPSec DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_DOTMAC_CERT_EXTENSION DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_DOTMAC_CERT_IDENTITY DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_DOTMAC_CERT_EMAIL_SIGN DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_DOTMAC_CERT_EMAIL_ENCRYPT DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_CERT_POLICY DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_DOTMAC_CERT_POLICY DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ADC_CERT_POLICY DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_MACAPPSTORE_CERT_POLICY DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_MACAPPSTORE_RECEIPT_CERT_POLICY DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLEID_CERT_POLICY DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLEID_SHARING_CERT_POLICY DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_MOBILE_STORE_SIGNING_POLICY DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_TEST_MOBILE_STORE_SIGNING_POLICY DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_EKU_CODE_SIGNING DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_EKU_CODE_SIGNING_DEV DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_EKU_RESOURCE_SIGNING DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_EKU_ICHAT_SIGNING DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_EKU_ICHAT_ENCRYPTION DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_EKU_SYSTEM_IDENTITY DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_EKU_PASSBOOK_SIGNING DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_EKU_PROFILE_SIGNING DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_EKU_QA_PROFILE_SIGNING DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_EXTENSION DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_EXTENSION_CODE_SIGNING DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_EXTENSION_APPLE_SIGNING DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_EXTENSION_ADC_DEV_SIGNING DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_EXTENSION_ADC_APPLE_SIGNING DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_EXTENSION_PASSBOOK_SIGNING DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_EXTENSION_MACAPPSTORE_RECEIPT DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_EXTENSION_INTERMEDIATE_MARKER DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_EXTENSION_WWDR_INTERMEDIATE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_EXTENSION_ITMS_INTERMEDIATE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_EXTENSION_AAI_INTERMEDIATE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_EXTENSION_APPLEID_INTERMEDIATE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_EXTENSION_APPLEID_SHARING DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_EXTENSION_SYSINT2_INTERMEDIATE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_EXTENSION_DEVELOPER_AUTHENTICATION DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_EXTENSION_SERVER_AUTHENTICATION DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_EXTENSION_ESCROW_SERVICE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_EXTENSION_PROVISIONING_PROFILE_SIGNING DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
/*
* Netscape extensions.
*/
extern const CSSM_OID
CSSMOID_NetscapeCertType DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_NetscapeCertSequence DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_NetscapeSGC DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
extern const CSSM_OID CSSMOID_MicrosoftSGC DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/*
* Field values for CSSMOID_NetscapeCertType DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, a bit string.
* Assumes a 16 bit field, even though currently only 8 bits
* are defined.
*/
#define CE_NCT_SSL_Client 0x8000
#define CE_NCT_SSL_Server 0x4000
#define CE_NCT_SMIME 0x2000
#define CE_NCT_ObjSign 0x1000
#define CE_NCT_Reserved 0x0800
#define CE_NCT_SSL_CA 0x0400
#define CE_NCT_SMIME_CA 0x0200
#define CE_NCT_ObjSignCA 0x0100
#ifdef __cplusplus
}
#endif
#endif /* _OIDSCERT_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/AuthorizationPlugin.h | /*
* Copyright (c) 2001-2002,2004,2011-2012,2014 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
* AuthorizationPlugin.h
* AuthorizationPlugin -- APIs for implementing authorization plugins.
*/
#ifndef _SECURITY_AUTHORIZATIONPLUGIN_H_
#define _SECURITY_AUTHORIZATIONPLUGIN_H_
#include <Security/Authorization.h>
#if defined(__cplusplus)
extern "C" {
#endif
CF_ASSUME_NONNULL_BEGIN
/*!
@header AuthorizationPlugin
The AuthorizationPlugin API allows the creation of plugins that can participate
in authorization decisions. Using the AuthorizationDB API the system can be configured
to use these plugins. Plugins are loaded into a separate process, the pluginhost, to
isolate the process of authorization from the client. There are two types of pluginhosts.
One runs as an anonymous user and can be used to communicate with the user, for example
to ask for a password. Another one runs with root privileges to perform privileged
operations that may be required.
A typical use is to implement additional policies that cannot be expressed in the
authorization configuration.
Plugins implement a handshake function called AuthorizationPluginCreate with which
their interface (AuthorizationPluginInterface) and the engine's interface
(AuthorizationCallbacks) are exchanged. Plugins are asked to create
Mechanisms, which are the basic element as authorizations are performed.
Mechanisms are invoked when it is time for them to make a decision. A decision is
made by setting a single result (AuthorizationResult). Mechanisms in the
authorization can communicate auxiliary information by setting and/or getting hints
and setting and/or getting context data. Hints are advisory and don't need to be
looked at, nor are they preserved as part of the authorization result. Context data
becomes part of the result of the authorization.
Context data is tagged with a flag that describes whether the information is returned
to the authorization client upon request (AuthorizationCopyInfo() in Authorization.h)
or whether it's private to the mechanisms making a decision.
*/
/*!
@typedef AuthorizationValue
Auxiliary data is passed between the engine and the mechanism as AuthorizationValues
*/
typedef struct AuthorizationValue
{
size_t length;
void * __nullable data;
} AuthorizationValue;
/*!
@typedef AuthorizationValueVector
A vector of AuthorizationValues. Used to communicate arguments passed from the
configuration file <code>authorization(5)</code>.
*/
typedef struct AuthorizationValueVector
{
UInt32 count;
AuthorizationValue *values;
} AuthorizationValueVector;
/*!
@typedef
Data produced as context during the authorization evaluation is tagged.
If data is set to be extractable (kAuthorizationContextFlagExtractable), it will be possible for the client of authorization to obtain the value of this attribute using AuthorizationCopyInfo().
If data is marked as volatile (kAuthorizationContextFlagVolatile), this value will not be remembered in the AuthorizationRef.
Sticky data (kAuthorizationContextFlagSticky) persists through a failed or interrupted evaluation. It can be used to propagate an error condition from a downstream plugin to an upstream one. It is not remembered in the AuthorizationRef.
*/
typedef CF_OPTIONS(UInt32, AuthorizationContextFlags)
{
kAuthorizationContextFlagExtractable = (1 << 0),
kAuthorizationContextFlagVolatile = (1 << 1),
kAuthorizationContextFlagSticky = (1 << 2)
};
/*!
@typedef AuthorizationMechanismId
The mechanism id specified in the configuration is passed to the plugin to create the appropriate mechanism.
*/
typedef const AuthorizationString AuthorizationMechanismId;
/*!
@typedef AuthorizationPluginId
Not used by plugin writers. Loaded plugins are identified by their name.
*/
typedef const AuthorizationString AuthorizationPluginId;
/*!
@typedef AuthorizationPluginRef
Handle passed back by the plugin writer when creating a plugin. Any pluginhost will only instantiate one instance. The handle is used when creating mechanisms.
*/
typedef void *AuthorizationPluginRef;
/*!
@typedef AuthorizationMechanismRef
Handle passed back by the plugin writer when creating an an instance of a mechanism in a plugin. One instance will be created for any authorization.
*/
typedef void *AuthorizationMechanismRef;
/*!
@typedef AuthorizationEngineRef
Handle passed from the engine to an instance of a mechanism in a plugin (corresponds to a particular AuthorizationMechanismRef).
*/
typedef struct __OpaqueAuthorizationEngine *AuthorizationEngineRef;
/*!
@typedef AuthorizationSessionId
A unique value for an AuthorizationSession being evaluated, provided by the authorization engine.
A session is represented by a top level call to an Authorization API.
*/
typedef void *AuthorizationSessionId;
/*!
@enum AuthorizationResult
Possible values for SetResult() in AuthorizationCallbacks.
@constant kAuthorizationResultAllow the operation succeeded and authorization should be granted as far as this mechanism is concerned.
@constant kAuthorizationResultDeny the operation succeeded but authorization should be denied as far as this mechanism is concerned.
@constant kAuthorizationResultUndefined the operation failed for some reason and should not be retried for this session.
@constant kAuthorizationResultUserCanceled the user has requested that the evaluation be terminated.
*/
typedef CF_CLOSED_ENUM(UInt32, AuthorizationResult) {
kAuthorizationResultAllow,
kAuthorizationResultDeny,
kAuthorizationResultUndefined,
kAuthorizationResultUserCanceled,
};
/*!
@enum
Version of the interface (AuthorizationPluginInterface) implemented by the plugin.
The value is matched to the definition in this file.
*/
enum {
kAuthorizationPluginInterfaceVersion = 0
};
/*!
@enum
Version of the callback structure (AuthorizationCallbacks) passed to the plugin.
The value is matched to the definition in this file. The engine may provide a newer
interface.
*/
enum {
kAuthorizationCallbacksVersion = 4
};
/*!
@typedef
Callback API provided by the AuthorizationEngine.
@field version Engine callback version.
@field SetResult Set a result after a call to AuthorizationSessionInvoke.
@field RequestInterrupt Request authorization engine to interrupt all mechamisms invoked after this mechamism has called SessionSetResult and then call AuthorizationSessionInvoke again.
@field DidDeactivate Respond to the Deactivate request.
@field GetContextValue Read value from context. AuthorizationValue does not own data.
@field SetContextValue Write value to context. AuthorizationValue and data are copied.
@field GetHintValue Read value from hints. AuthorizationValue does not own data.
@field SetHintValue Write value to hints. AuthorizationValue and data are copied.
@field GetArguments Read arguments passed. AuthorizationValueVector does not own data.
@field GetSessionId Read SessionId.
@field GetLAContext Returns LAContext which will have LACredentialCTKPIN credential set if PIN is available otherwise context without credentials is returned. LAContext can be used for operations with Tokens which would normally require PIN. Caller owns returned context and is responsible for release.
@field GetTokenIdentities Returns array of identities. Caller owns returned array and is reponsible for release.
@field GetTKTokenWatcher Returns TKTokenWatcher object. Caller owns returned context and is responsible for release.
@field RemoveContextValue Removes value from context.
@field RemoveHintValue Removes value from hints.
*/
typedef struct AuthorizationCallbacks {
/* Engine callback version. */
UInt32 version;
/* Set a result after a call to AuthorizationSessionInvoke. */
OSStatus (*SetResult)(AuthorizationEngineRef inEngine, AuthorizationResult inResult);
/* Request authorization engine to interrupt all mechamisms invoked after
this mechamism has called SessionSetResult and then call
AuthorizationSessionInvoke again. */
OSStatus (*RequestInterrupt)(AuthorizationEngineRef inEngine);
/* Respond to the Deactivate request. */
OSStatus (*DidDeactivate)(AuthorizationEngineRef inEngine);
/* Read value from context. AuthorizationValue does not own data. */
OSStatus (*GetContextValue)(AuthorizationEngineRef inEngine,
AuthorizationString inKey,
AuthorizationContextFlags * __nullable outContextFlags,
const AuthorizationValue * __nullable * __nullable outValue);
/* Write value to context. AuthorizationValue and data are copied. */
OSStatus (*SetContextValue)(AuthorizationEngineRef inEngine,
AuthorizationString inKey,
AuthorizationContextFlags inContextFlags,
const AuthorizationValue *inValue);
/* Read value from hints. AuthorizationValue does not own data. */
OSStatus (*GetHintValue)(AuthorizationEngineRef inEngine,
AuthorizationString inKey,
const AuthorizationValue * __nullable * __nullable outValue);
/* Write value to hints. AuthorizationValue and data are copied. */
OSStatus (*SetHintValue)(AuthorizationEngineRef inEngine,
AuthorizationString inKey,
const AuthorizationValue *inValue);
/* Read arguments passed. AuthorizationValueVector does not own data. */
OSStatus (*GetArguments)(AuthorizationEngineRef inEngine,
const AuthorizationValueVector * __nullable * __nonnull outArguments);
/* Read SessionId. */
OSStatus (*GetSessionId)(AuthorizationEngineRef inEngine,
AuthorizationSessionId __nullable * __nullable outSessionId);
/* Read value from hints. AuthorizationValue does not own data. */
OSStatus (*GetImmutableHintValue)(AuthorizationEngineRef inEngine,
AuthorizationString inKey,
const AuthorizationValue * __nullable * __nullable outValue);
/*
Available only on systems with callback version 2 or higher
Constructs LAContext object based od actual user credentials,
userful for kSecUseAuthenticationContext for SecItem calls.
Caller is responsible for outValue release */
OSStatus (*GetLAContext)(AuthorizationEngineRef inEngine,
CFTypeRef __nullable * __nullable outValue) __OSX_AVAILABLE_STARTING(__MAC_10_13, __IPHONE_NA);
/*
Available only on systems with callback version 2 or higher
Returns array of available identities available on tokens. Each array item consists of two
elements. The first one is SecIdentityRef and the second one is textual description of that identity
context parameter may contain CFTypeRef returned by GetLAContext.
Caller is responsible for outValue release */
OSStatus (*GetTokenIdentities)(AuthorizationEngineRef inEngine,
CFTypeRef context,
CFArrayRef __nullable * __nullable outValue) __OSX_AVAILABLE_STARTING(__MAC_10_13, __IPHONE_NA);
/*
Available only on systems with callback version 3 or higher
Constructs TKTokenWatcher object.
Caller is responsible for outValue release */
OSStatus (*GetTKTokenWatcher)(AuthorizationEngineRef inEngine,
CFTypeRef __nullable * __nullable outValue) __OSX_AVAILABLE_STARTING(__MAC_10_13_4, __IPHONE_NA);
/* Remove value from hints. */
OSStatus (*RemoveHintValue)(AuthorizationEngineRef inEngine,
AuthorizationString inKey);
/* Write value to context. */
OSStatus (*RemoveContextValue)(AuthorizationEngineRef inEngine,
AuthorizationString inKey);
} AuthorizationCallbacks;
/*!
@typedef
Interface that must be implemented by each plugin.
@field version Must be set to kAuthorizationPluginInterfaceVersion
@field PluginDestroy Plugin should clean up and release any resources it is holding.
@field MechanismCreate The plugin should create a mechanism named mechanismId. The mechanism needs to use the AuthorizationEngineRef for the callbacks and pass back a AuthorizationMechanismRef for itself. MechanismDestroy will be called when it is no longer needed.
@field MechanismInvoke Invoke an instance of a mechanism. It should call SetResult during or after returning from this function.
@field MechanismDeactivate Mechanism should respond with a DidDeactivate as soon as possible
@field MechanismDestroy Mechanism should clean up and release any resources it is holding
*/
typedef struct AuthorizationPluginInterface
{
/* Must be set to kAuthorizationPluginInterfaceVersion. */
UInt32 version;
/* Notify a plugin that it is about to be unloaded so it get a chance to clean up and release any resources it is holding. */
OSStatus (*PluginDestroy)(AuthorizationPluginRef inPlugin);
/* The plugin should create a mechanism named mechanismId. The mechanism needs to use the
AuthorizationEngineRef for the callbacks and pass back an AuthorizationMechanismRef for
itself. MechanismDestroy will be called when it is no longer needed. */
OSStatus (*MechanismCreate)(AuthorizationPluginRef inPlugin,
AuthorizationEngineRef inEngine,
AuthorizationMechanismId mechanismId,
AuthorizationMechanismRef __nullable * __nonnull outMechanism);
/* Invoke an instance of a mechanism. It should call SetResult during or after returning from this function. */
OSStatus (*MechanismInvoke)(AuthorizationMechanismRef inMechanism);
/* Mechanism should respond with a DidDeactivate as soon as possible. */
OSStatus (*MechanismDeactivate)(AuthorizationMechanismRef inMechanism);
/* Mechanism should clean up and release any resources it is holding. */
OSStatus (*MechanismDestroy)(AuthorizationMechanismRef inMechanism);
} AuthorizationPluginInterface;
/*!
@function AuthorizationPluginCreate
Initialize a plugin after it gets loaded. This is the main entry point to a plugin. This function will only be called once.
After all Mechanism instances have been destroyed outPluginInterface->PluginDestroy will be called.
@param callbacks (input) A pointer to an AuthorizationCallbacks which contains the callbacks implemented by the AuthorizationEngine.
@param outPlugin (output) On successful completion should contain a valid AuthorizationPluginRef. This will be passed in to any subsequent calls the engine makes to outPluginInterface->MechanismCreate and outPluginInterface->PluginDestroy.
@param outPluginInterface (output) On successful completion should contain a pointer to a AuthorizationPluginInterface that will stay valid until outPluginInterface->PluginDestroy is called. */
OSStatus AuthorizationPluginCreate(const AuthorizationCallbacks *callbacks,
AuthorizationPluginRef __nullable * __nonnull outPlugin,
const AuthorizationPluginInterface * __nullable * __nonnull outPluginInterface);
CF_ASSUME_NONNULL_END
#if defined(__cplusplus)
}
#endif
#endif /* _SECURITY_AUTHORIZATIONPLUGIN_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecKey.h | /*
* Copyright (c) 2006-2014,2016 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
@header SecKey
The functions provided in SecKey.h implement and manage a particular
type of keychain item that represents a key. A key can be stored in a
keychain, but a key can also be a transient object.
On OSX, you can use a SecKey as a SecKeychainItem in most functions.
*/
#ifndef _SECURITY_SECKEY_H_
#define _SECURITY_SECKEY_H_
#include <Availability.h>
#include <Security/SecBase.h>
#include <CoreFoundation/CoreFoundation.h>
#include <dispatch/dispatch.h>
#include <sys/types.h>
#if SEC_OS_OSX
#include <Security/SecAccess.h>
#include <Security/cssmtype.h>
#endif /* SEC_OS_OSX */
__BEGIN_DECLS
CF_ASSUME_NONNULL_BEGIN
CF_IMPLICIT_BRIDGING_ENABLED
#if SEC_OS_OSX
/*!
@enum KeyItemAttributeConstants
@abstract Specifies keychain item attributes for keys.
@constant kSecKeyKeyClass type uint32 (CSSM_KEYCLASS), value
is one of CSSM_KEYCLASS_PUBLIC_KEY, CSSM_KEYCLASS_PRIVATE_KEY
or CSSM_KEYCLASS_SESSION_KEY.
@constant kSecKeyPrintName type blob, human readable name of
the key. Same as kSecLabelItemAttr for normal keychain items.
@constant kSecKeyAlias type blob, currently unused.
@constant kSecKeyPermanent type uint32, value is nonzero iff
this key is permanent (stored in some keychain). This is always
1.
@constant kSecKeyPrivate type uint32, value is nonzero iff this
key is protected by a user login or a password, or both.
@constant kSecKeyModifiable type uint32, value is nonzero iff
attributes of this key can be modified.
@constant kSecKeyLabel type blob, for private and public keys
this contains the hash of the public key. This is used to
associate certificates and keys. Its value matches the value
of the kSecPublicKeyHashItemAttr of a certificate and it's used
to construct an identity from a certificate and a key.
For symmetric keys this is whatever the creator of the key
passed in during the generate key call.
@constant kSecKeyApplicationTag type blob, currently unused.
@constant kSecKeyKeyCreator type data, the data points to a
CSSM_GUID structure representing the moduleid of the csp owning
this key.
@constant kSecKeyKeyType type uint32, value is a CSSM_ALGORITHMS
representing the algorithm associated with this key.
@constant kSecKeyKeySizeInBits type uint32, value is the number
of bits in this key.
@constant kSecKeyEffectiveKeySize type uint32, value is the
effective number of bits in this key. For example a des key
has a kSecKeyKeySizeInBits of 64 but a kSecKeyEffectiveKeySize
of 56.
@constant kSecKeyStartDate type CSSM_DATE. Earliest date from
which this key may be used. If the value is all zeros or not
present, no restriction applies.
@constant kSecKeyEndDate type CSSM_DATE. Latest date at
which this key may be used. If the value is all zeros or not
present, no restriction applies.
@constant kSecKeySensitive type uint32, iff value is nonzero
this key cannot be wrapped with CSSM_ALGID_NONE.
@constant kSecKeyAlwaysSensitive type uint32, value is nonzero
iff this key has always been marked sensitive.
@constant kSecKeyExtractable type uint32, value is nonzero iff
this key can be wrapped.
@constant kSecKeyNeverExtractable type uint32, value is nonzero
iff this key was never marked extractable.
@constant kSecKeyEncrypt type uint32, value is nonzero iff this
key can be used in an encrypt operation.
@constant kSecKeyDecrypt type uint32, value is nonzero iff this
key can be used in a decrypt operation.
@constant kSecKeyDerive type uint32, value is nonzero iff this
key can be used in a deriveKey operation.
@constant kSecKeySign type uint32, value is nonzero iff this
key can be used in a sign operation.
@constant kSecKeyVerify type uint32, value is nonzero iff this
key can be used in a verify operation.
@constant kSecKeySignRecover type uint32.
@constant kSecKeyVerifyRecover type uint32.
key can unwrap other keys.
@constant kSecKeyWrap type uint32, value is nonzero iff this
key can wrap other keys.
@constant kSecKeyUnwrap type uint32, value is nonzero iff this
key can unwrap other keys.
@discussion
The use of these enumerations has been deprecated. Please
use the equivalent items defined in SecItem.h
@@@.
*/
CF_ENUM(int)
{
kSecKeyKeyClass = 0,
kSecKeyPrintName = 1,
kSecKeyAlias = 2,
kSecKeyPermanent = 3,
kSecKeyPrivate = 4,
kSecKeyModifiable = 5,
kSecKeyLabel = 6,
kSecKeyApplicationTag = 7,
kSecKeyKeyCreator = 8,
kSecKeyKeyType = 9,
kSecKeyKeySizeInBits = 10,
kSecKeyEffectiveKeySize = 11,
kSecKeyStartDate = 12,
kSecKeyEndDate = 13,
kSecKeySensitive = 14,
kSecKeyAlwaysSensitive = 15,
kSecKeyExtractable = 16,
kSecKeyNeverExtractable = 17,
kSecKeyEncrypt = 18,
kSecKeyDecrypt = 19,
kSecKeyDerive = 20,
kSecKeySign = 21,
kSecKeyVerify = 22,
kSecKeySignRecover = 23,
kSecKeyVerifyRecover = 24,
kSecKeyWrap = 25,
kSecKeyUnwrap = 26
} API_DEPRECATED("No longer supported", macos(10.3, 12.0));
/*!
@enum SecCredentialType
@abstract Determines the type of credential returned by SecKeyGetCredentials.
@constant kSecCredentialTypeWithUI Operations with this key are allowed to present UI if required.
@constant kSecCredentialTypeNoUI Operations with this key are not allowed to present UI, and will fail if UI is required.
@constant kSecCredentialTypeDefault The default setting for determining whether to present UI is used. This setting can be changed with a call to SecKeychainSetUserInteractionAllowed.
*/
typedef CF_ENUM(uint32, SecCredentialType)
{
kSecCredentialTypeDefault = 0,
kSecCredentialTypeWithUI,
kSecCredentialTypeNoUI
} API_DEPRECATED("No longer supported", macos(10.3, 12.0));
#endif /* SEC_OS_OSX */
/*!
@typedef SecPadding
@abstract Supported padding types.
*/
typedef CF_OPTIONS(uint32_t, SecPadding)
{
kSecPaddingNone = 0,
kSecPaddingPKCS1 = 1,
kSecPaddingOAEP = 2, // __OSX_UNAVAILABLE __IOS_AVAILABLE(2.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0),
/* For SecKeyRawSign/SecKeyRawVerify only,
ECDSA signature is raw byte format {r,s}, big endian.
First half is r, second half is s */
kSecPaddingSigRaw = 0x4000,
/* For SecKeyRawSign/SecKeyRawVerify only, data to be signed is an MD2
hash; standard ASN.1 padding will be done, as well as PKCS1 padding
of the underlying RSA operation. */
kSecPaddingPKCS1MD2 = 0x8000, // __OSX_DEPRECATED(10.0, 10.12, "MD2 is deprecated") __IOS_DEPRECATED(2.0, 5.0, "MD2 is deprecated") __TVOS_UNAVAILABLE __WATCHOS_UNAVAILABLE,
/* For SecKeyRawSign/SecKeyRawVerify only, data to be signed is an MD5
hash; standard ASN.1 padding will be done, as well as PKCS1 padding
of the underlying RSA operation. */
kSecPaddingPKCS1MD5 = 0x8001, // __OSX_DEPRECATED(10.0, 10.12, "MD5 is deprecated") __IOS_DEPRECATED(2.0, 5.0, "MD5 is deprecated") __TVOS_UNAVAILABLE __WATCHOS_UNAVAILABLE,
/* For SecKeyRawSign/SecKeyRawVerify only, data to be signed is a SHA1
hash; standard ASN.1 padding will be done, as well as PKCS1 padding
of the underlying RSA operation. */
kSecPaddingPKCS1SHA1 = 0x8002,
/* For SecKeyRawSign/SecKeyRawVerify only, data to be signed is a SHA224
hash; standard ASN.1 padding will be done, as well as PKCS1 padding
of the underlying RSA operation. */
kSecPaddingPKCS1SHA224 = 0x8003, // __OSX_UNAVAILABLE __IOS_AVAILABLE(2.0),
/* For SecKeyRawSign/SecKeyRawVerify only, data to be signed is a SHA256
hash; standard ASN.1 padding will be done, as well as PKCS1 padding
of the underlying RSA operation. */
kSecPaddingPKCS1SHA256 = 0x8004, // __OSX_UNAVAILABLE __IOS_AVAILABLE(2.0),
/* For SecKeyRawSign/SecKeyRawVerify only, data to be signed is a SHA384
hash; standard ASN.1 padding will be done, as well as PKCS1 padding
of the underlying RSA operation. */
kSecPaddingPKCS1SHA384 = 0x8005, // __OSX_UNAVAILABLE __IOS_AVAILABLE(2.0),
/* For SecKeyRawSign/SecKeyRawVerify only, data to be signed is a SHA512
hash; standard ASN.1 padding will be done, as well as PKCS1 padding
of the underlying RSA operation. */
kSecPaddingPKCS1SHA512 = 0x8006, // __OSX_UNAVAILABLE __IOS_AVAILABLE(2.0),
} API_DEPRECATED("Replaced with SecKeyAlgorithm", macos(10.6, 12.0), ios(2.0, 15.0), tvos(4.0, 15.0), watchos(1.0, 8.0));
#if SEC_OS_OSX
/*!
@typedef SecKeySizes
@abstract Supported key lengths.
*/
typedef CF_ENUM(uint32_t, SecKeySizes)
{
kSecDefaultKeySize = 0,
// Symmetric Keysizes - default is currently kSecAES128 for AES.
kSec3DES192 = 192,
kSecAES128 = 128,
kSecAES192 = 192,
kSecAES256 = 256,
// Supported ECC Keys for Suite-B from RFC 4492 section 5.1.1.
// default is currently kSecp256r1
kSecp192r1 = 192,
kSecp256r1 = 256,
kSecp384r1 = 384,
kSecp521r1 = 521, // Yes, 521
// Boundaries for RSA KeySizes - default is currently 2048
// RSA keysizes must be multiples of 8
kSecRSAMin = 1024,
kSecRSAMax = 4096
} API_DEPRECATED("No longer supported", macos(10.9, 12.0));
#endif /* SEC_OS_OSX */
/*!
@enum Key Parameter Constants
@discussion Predefined key constants used to get or set values in a dictionary.
These are used to provide explicit parameters to key generation functions
when non-default values are desired. See the description of the
SecKeyGeneratePair API for usage information.
@constant kSecPrivateKeyAttrs The value for this key is a CFDictionaryRef
containing attributes specific for the private key to be generated.
@constant kSecPublicKeyAttrs The value for this key is a CFDictionaryRef
containing attributes specific for the public key to be generated.
*/
extern const CFStringRef kSecPrivateKeyAttrs
API_AVAILABLE(macos(10.8), ios(2.0), tvos(4.0), watchos(1.0));
extern const CFStringRef kSecPublicKeyAttrs
API_AVAILABLE(macos(10.8), ios(2.0), tvos(4.0), watchos(1.0));
/*!
@function SecKeyGetTypeID
@abstract Returns the type identifier of SecKey instances.
@result The CFTypeID of SecKey instances.
*/
CFTypeID SecKeyGetTypeID(void)
API_AVAILABLE(macos(10.3), ios(2.0), tvos(4.0), watchos(1.0));
#if SEC_OS_OSX
/*!
@function SecKeyCreatePair
@abstract Creates an asymmetric key pair and stores it in a specified keychain.
@param keychainRef A reference to the keychain in which to store the private and public key items. Specify NULL for the default keychain.
@param algorithm An algorithm for the key pair. This parameter is ignored if a valid (non-zero) contextHandle is supplied.
@param keySizeInBits A key size for the key pair. This parameter is ignored if a valid (non-zero) contextHandle is supplied.
@param contextHandle (optional) A CSSM_CC_HANDLE, or 0. If this argument is supplied, the algorithm and keySizeInBits parameters are ignored. If extra parameters are needed to generate a key (some algorithms require this), you should create a context using CSSM_CSP_CreateKeyGenContext, using the CSPHandle obtained by calling SecKeychainGetCSPHandle. Then use CSSM_UpdateContextAttributes to add parameters, and dispose of the context using CSSM_DeleteContext after calling this function.
@param publicKeyUsage A bit mask indicating all permitted uses for the new public key. CSSM_KEYUSE bit mask values are defined in cssmtype.h.
@param publicKeyAttr A bit mask defining attribute values for the new public key. The bit mask values are equivalent to a CSSM_KEYATTR_FLAGS and are defined in cssmtype.h.
@param privateKeyUsage A bit mask indicating all permitted uses for the new private key. CSSM_KEYUSE bit mask values are defined in cssmtype.h.
@param privateKeyAttr A bit mask defining attribute values for the new private key. The bit mask values are equivalent to a CSSM_KEYATTR_FLAGS and are defined in cssmtype.h.
@param initialAccess (optional) A SecAccess object that determines the initial access rights to the private key. The public key is given "any/any" access rights by default.
@param publicKey (optional) On return, the keychain item reference of the generated public key. Use the SecKeyGetCSSMKey function to obtain the CSSM_KEY. The caller must call CFRelease on this value if it is returned. Pass NULL if a reference to this key is not required.
@param privateKey (optional) On return, the keychain item reference of the generated private key. Use the SecKeyGetCSSMKey function to obtain the CSSM_KEY. The caller must call CFRelease on this value if it is returned. Pass NULL if a reference to this key is not required.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This API is deprecated for 10.7. Please use the SecKeyGeneratePair API instead.
*/
OSStatus SecKeyCreatePair(
SecKeychainRef _Nullable keychainRef,
CSSM_ALGORITHMS algorithm,
uint32 keySizeInBits,
CSSM_CC_HANDLE contextHandle,
CSSM_KEYUSE publicKeyUsage,
uint32 publicKeyAttr,
CSSM_KEYUSE privateKeyUsage,
uint32 privateKeyAttr,
SecAccessRef _Nullable initialAccess,
SecKeyRef* _Nullable CF_RETURNS_RETAINED publicKey,
SecKeyRef* _Nullable CF_RETURNS_RETAINED privateKey)
CSSM_DEPRECATED;
/*!
@function SecKeyGenerate
@abstract Creates a symmetric key and optionally stores it in a specified keychain.
@param keychainRef (optional) A reference to the keychain in which to store the generated key. Specify NULL to generate a transient key.
@param algorithm An algorithm for the symmetric key. This parameter is ignored if a valid (non-zero) contextHandle is supplied.
@param keySizeInBits A key size for the key pair. This parameter is ignored if a valid (non-zero) contextHandle is supplied.
@param contextHandle (optional) A CSSM_CC_HANDLE, or 0. If this argument is supplied, the algorithm and keySizeInBits parameters are ignored. If extra parameters are needed to generate a key (some algorithms require this), you should create a context using CSSM_CSP_CreateKeyGenContext, using the CSPHandle obtained by calling SecKeychainGetCSPHandle. Then use CSSM_UpdateContextAttributes to add parameters, and dispose of the context using CSSM_DeleteContext after calling this function.
@param keyUsage A bit mask indicating all permitted uses for the new key. CSSM_KEYUSE bit mask values are defined in cssmtype.h.
@param keyAttr A bit mask defining attribute values for the new key. The bit mask values are equivalent to a CSSM_KEYATTR_FLAGS and are defined in cssmtype.h.
@param initialAccess (optional) A SecAccess object that determines the initial access rights for the key. This parameter is ignored if the keychainRef is NULL.
@param keyRef On return, a reference to the generated key. Use the SecKeyGetCSSMKey function to obtain the CSSM_KEY. The caller must call CFRelease on this value if it is returned.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This API is deprecated for 10.7. Please use the SecKeyGenerateSymmetric API instead.
*/
OSStatus SecKeyGenerate(
SecKeychainRef _Nullable keychainRef,
CSSM_ALGORITHMS algorithm,
uint32 keySizeInBits,
CSSM_CC_HANDLE contextHandle,
CSSM_KEYUSE keyUsage,
uint32 keyAttr,
SecAccessRef _Nullable initialAccess,
SecKeyRef* _Nullable CF_RETURNS_RETAINED keyRef)
CSSM_DEPRECATED;
/*!
@function SecKeyGetCSSMKey
@abstract Returns a pointer to the CSSM_KEY for the given key item reference.
@param key A keychain key item reference. The key item must be of class type kSecPublicKeyItemClass, kSecPrivateKeyItemClass, or kSecSymmetricKeyItemClass.
@param cssmKey On return, a pointer to a CSSM_KEY structure for the given key. This pointer remains valid until the key reference is released. The caller should not attempt to modify or free this data.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion The CSSM_KEY is valid until the key item reference is released. This API is deprecated in 10.7. Its use should no longer be needed.
*/
OSStatus SecKeyGetCSSMKey(SecKeyRef key, const CSSM_KEY * _Nullable * __nonnull cssmKey)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/*!
@function SecKeyGetCSPHandle
@abstract Returns the CSSM_CSP_HANDLE for the given key reference. The handle is valid until the key reference is released.
@param keyRef A key reference.
@param cspHandle On return, the CSSM_CSP_HANDLE for the given keychain.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This API is deprecated in 10.7. Its use should no longer be needed.
*/
OSStatus SecKeyGetCSPHandle(SecKeyRef keyRef, CSSM_CSP_HANDLE *cspHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/*!
@function SecKeyGetCredentials
@abstract For a given key, return a pointer to a CSSM_ACCESS_CREDENTIALS structure which will allow the key to be used.
@param keyRef The key for which a credential is requested.
@param operation The type of operation to be performed with this key. See "Authorization tag type" for defined operations (cssmtype.h).
@param credentialType The type of credential requested.
@param outCredentials On return, a pointer to a CSSM_ACCESS_CREDENTIALS structure. This pointer remains valid until the key reference is released. The caller should not attempt to modify or free this data.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecKeyGetCredentials(
SecKeyRef keyRef,
CSSM_ACL_AUTHORIZATION_TAG operation,
SecCredentialType credentialType,
const CSSM_ACCESS_CREDENTIALS * _Nullable * __nonnull outCredentials)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/*!
@function SecKeyGenerateSymmetric
@abstract Generates a random symmetric key with the specified length
and algorithm type.
@param parameters A dictionary containing one or more key-value pairs.
See the discussion sections below for a complete overview of options.
@param error An optional pointer to a CFErrorRef. This value is set
if an error occurred. If not NULL, the caller is responsible for
releasing the CFErrorRef.
@result On return, a SecKeyRef reference to the symmetric key, or
NULL if the key could not be created.
@discussion In order to generate a symmetric key, the parameters dictionary
must at least contain the following keys:
* kSecAttrKeyType with a value of kSecAttrKeyTypeAES or any other
kSecAttrKeyType defined in SecItem.h
* kSecAttrKeySizeInBits with a value being a CFNumberRef containing
the requested key size in bits. Example sizes for AES keys are:
128, 192, 256, 512.
To store the generated symmetric key in a keychain, set these keys:
* kSecUseKeychain (value is a SecKeychainRef)
* kSecAttrLabel (a user-visible label whose value is a CFStringRef,
e.g. "My App's Encryption Key")
* kSecAttrApplicationLabel (a label defined by your application, whose
value is a CFDataRef and which can be used to find this key in a
subsequent call to SecItemCopyMatching, e.g. "ID-1234567890-9876-0151")
To specify the generated key's access control settings, set this key:
* kSecAttrAccess (value is a SecAccessRef)
The keys below may be optionally set in the parameters dictionary
(with a CFBooleanRef value) to override the default usage values:
* kSecAttrCanEncrypt (defaults to true if not explicitly specified)
* kSecAttrCanDecrypt (defaults to true if not explicitly specified)
* kSecAttrCanWrap (defaults to true if not explicitly specified)
* kSecAttrCanUnwrap (defaults to true if not explicitly specified)
*/
_Nullable CF_RETURNS_RETAINED
SecKeyRef SecKeyGenerateSymmetric(CFDictionaryRef parameters, CFErrorRef *error)
API_DEPRECATED("No longer supported", macos(10.7, 12.0));
/*!
@function SecKeyCreateFromData
@abstract Creates a symmetric key with the given data and sets the
algorithm type specified.
@param parameters A dictionary containing one or more key-value pairs.
See the discussion sections below for a complete overview of options.
@result On return, a SecKeyRef reference to the symmetric key.
@discussion In order to generate a symmetric key the parameters dictionary must
at least contain the following keys:
* kSecAttrKeyType with a value of kSecAttrKeyTypeAES or any other
kSecAttrKeyType defined in SecItem.h
The keys below may be optionally set in the parameters dictionary
(with a CFBooleanRef value) to override the default usage values:
* kSecAttrCanEncrypt (defaults to true if not explicitly specified)
* kSecAttrCanDecrypt (defaults to true if not explicitly specified)
* kSecAttrCanWrap (defaults to true if not explicitly specified)
* kSecAttrCanUnwrap (defaults to true if not explicitly specified)
*/
_Nullable
SecKeyRef SecKeyCreateFromData(CFDictionaryRef parameters,
CFDataRef keyData, CFErrorRef *error)
API_DEPRECATED("No longer supported", macos(10.7, 12.0));
#ifdef __BLOCKS__
/*!
@typedef SecKeyGeneratePairBlock
@abstract Delivers the result from an asynchronous key pair generation.
@param publicKey - the public key generated. You must retain publicKey if you wish to use it after your block returns.
@param privateKey - the private key generated. You must retain publicKey if you wish to use it after your block returns.
@param error - Any errors returned. You must retain error if you wish to use it after your block returns.
*/
typedef void (^SecKeyGeneratePairBlock)(SecKeyRef publicKey, SecKeyRef privateKey, CFErrorRef error);
/*!
@function SecKeyGeneratePairAsync
@abstract Generate a private/public keypair returning the values in a callback.
@param parameters A dictionary containing one or more key-value pairs.
@param deliveryQueue A dispatch queue to be used to deliver the results.
@param result A callback function to result when the operation has completed.
@discussion In order to generate a keypair the parameters dictionary must
at least contain the following keys:
* kSecAttrKeyType with a value being kSecAttrKeyTypeRSA or any other
kSecAttrKeyType defined in SecItem.h
* kSecAttrKeySizeInBits with a value being a CFNumberRef or CFStringRef
containing the requested key size in bits. Example sizes for RSA
keys are: 512, 768, 1024, 2048.
Setting the following attributes explicitly will override the defaults below.
See SecItem.h for detailed information on these attributes including the types
of the values.
* kSecAttrLabel default NULL
* kSecAttrIsPermanent if this key is present and has a Boolean
value of true, the key or key pair will be added to the default
keychain.
* kSecAttrApplicationTag default NULL
* kSecAttrEffectiveKeySize default NULL same as kSecAttrKeySizeInBits
* kSecAttrCanEncrypt default false for private keys, true for public keys
* kSecAttrCanDecrypt default true for private keys, false for public keys
* kSecAttrCanDerive default true
* kSecAttrCanSign default true for private keys, false for public keys
* kSecAttrCanVerify default false for private keys, true for public keys
* kSecAttrCanWrap default false for private keys, true for public keys
* kSecAttrCanUnwrap default true for private keys, false for public keys
*/
void SecKeyGeneratePairAsync(CFDictionaryRef parameters,
dispatch_queue_t deliveryQueue, SecKeyGeneratePairBlock result)
API_DEPRECATED("No longer supported", macos(10.7, 12.0));
#endif /* __BLOCKS__ */
// Derive, Wrap, and Unwrap
/*!
@function SecKeyDeriveFromPassword
@abstract Derives a symmetric key from a password.
@param password The password from which the keyis to be derived.
@param parameters A dictionary containing one or more key-value pairs.
@param error If the call fails this will contain the error code.
@discussion In order to derive a key the parameters dictionary must contain at least contain the following keys:
* kSecAttrSalt - a CFData for the salt value for mixing in the pseudo-random rounds.
* kSecAttrPRF - the algorithm to use for the pseudo-random-function.
If 0, this defaults to kSecAttrPRFHmacAlgSHA1. Possible values are:
* kSecAttrPRFHmacAlgSHA1
* kSecAttrPRFHmacAlgSHA224
* kSecAttrPRFHmacAlgSHA256
* kSecAttrPRFHmacAlgSHA384
* kSecAttrPRFHmacAlgSHA512
* kSecAttrRounds - the number of rounds to call the pseudo random function.
If 0, a count will be computed to average 1/10 of a second.
* kSecAttrKeySizeInBits with a value being a CFNumberRef
containing the requested key size in bits. Example sizes for RSA keys are:
512, 768, 1024, 2048.
@result On success a SecKeyRef is returned. On failure this result is NULL and the
error parameter contains the reason.
*/
_Nullable CF_RETURNS_RETAINED
SecKeyRef SecKeyDeriveFromPassword(CFStringRef password,
CFDictionaryRef parameters, CFErrorRef *error)
API_DEPRECATED("No longer supported", macos(10.7, 12.0));
/*!
@function SecKeyWrapSymmetric
@abstract Wraps a symmetric key with a symmetric key.
@param keyToWrap The key which is to be wrapped.
@param wrappingKey The key wrapping key.
@param parameters The parameter list to use for wrapping the key.
@param error If the call fails this will contain the error code.
@result On success a CFDataRef is returned. On failure this result is NULL and the
error parameter contains the reason.
@discussion In order to wrap a key the parameters dictionary may contain the following key:
* kSecSalt - a CFData for the salt value for the encrypt.
*/
_Nullable
CFDataRef SecKeyWrapSymmetric(SecKeyRef keyToWrap,
SecKeyRef wrappingKey, CFDictionaryRef parameters, CFErrorRef *error)
API_DEPRECATED("No longer supported", macos(10.7, 12.0));
/*!
@function SecKeyUnwrapSymmetric
@abstract Unwrap a wrapped symmetric key.
@param keyToUnwrap The wrapped key to unwrap.
@param unwrappingKey The key unwrapping key.
@param parameters The parameter list to use for unwrapping the key.
@param error If the call fails this will contain the error code.
@result On success a SecKeyRef is returned. On failure this result is NULL and the
error parameter contains the reason.
@discussion In order to unwrap a key the parameters dictionary may contain the following key:
* kSecSalt - a CFData for the salt value for the decrypt.
*/
_Nullable
SecKeyRef SecKeyUnwrapSymmetric(CFDataRef _Nullable * __nonnull keyToUnwrap,
SecKeyRef unwrappingKey, CFDictionaryRef parameters, CFErrorRef *error)
API_DEPRECATED("No longer supported", macos(10.7, 12.0));
#endif /* SEC_OS_OSX */
/*!
@function SecKeyGeneratePair
@abstract Generate a private/public keypair.
@param parameters A dictionary containing one or more key-value pairs.
See the discussion sections below for a complete overview of options.
@param publicKey On return, a SecKeyRef reference to the public key.
@param privateKey On return, a SecKeyRef reference to the private key.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion In order to generate a keypair the parameters dictionary must
at least contain the following keys:
* kSecAttrKeyType with a value of kSecAttrKeyTypeRSA or any other
kSecAttrKeyType defined in SecItem.h
* kSecAttrKeySizeInBits with a value being a CFNumberRef containing
the requested key size in bits. Example sizes for RSA keys are:
512, 768, 1024, 2048.
The values below may be set either in the top-level dictionary or in a
dictionary that is the value of the kSecPrivateKeyAttrs or
kSecPublicKeyAttrs key in the top-level dictionary. Setting these
attributes explicitly will override the defaults below. See SecItem.h
for detailed information on these attributes including the types of
the values.
* kSecAttrLabel default NULL
* kSecUseKeychain default NULL, which specifies the default keychain
* kSecAttrIsPermanent default false
if this key is present and has a Boolean value of true, the key or
key pair will be added to the keychain.
* kSecAttrTokenID default NULL
The CFStringRef ID of the token to generate the key or keypair on. This
attribute can contain CFStringRef and can be present only in the top-level
parameters dictionary.
* kSecAttrApplicationTag default NULL
* kSecAttrEffectiveKeySize default NULL same as kSecAttrKeySizeInBits
* kSecAttrCanEncrypt default false for private keys, true for public keys
* kSecAttrCanDecrypt default true for private keys, false for public keys
* kSecAttrCanDerive default true
* kSecAttrCanSign default true for private keys, false for public keys
* kSecAttrCanVerify default false for private keys, true for public keys
* kSecAttrCanWrap default false for private keys, true for public keys
* kSecAttrCanUnwrap default true for private keys, false for public keys
NOTE: The function always saves keys in the keychain on macOS and as such attribute
kSecAttrIsPermanent is ignored. The function respects attribute kSecAttrIsPermanent
on iOS, tvOS and watchOS.
It is recommended to use SecKeyCreateRandomKey() which respects kSecAttrIsPermanent
on all platforms.
*/
OSStatus SecKeyGeneratePair(CFDictionaryRef parameters,
SecKeyRef * _Nullable CF_RETURNS_RETAINED publicKey, SecKeyRef * _Nullable CF_RETURNS_RETAINED privateKey)
API_DEPRECATED("Use SecKeyCreateRandomKey", macos(10.7, 12.0), ios(2.0, 15.0), tvos(4.0, 15.0), watchos(1.0, 8.0));
#if SEC_OS_IPHONE
/*!
@function SecKeyRawSign
@abstract Given a private key and data to sign, generate a digital
signature.
@param key Private key with which to sign.
@param padding See Padding Types above, typically kSecPaddingPKCS1SHA1.
@param dataToSign The data to be signed, typically the digest of the
actual data.
@param dataToSignLen Length of dataToSign in bytes.
@param sig Pointer to buffer in which the signature will be returned.
@param sigLen IN/OUT maximum length of sig buffer on input, actualy
length of sig on output.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion If the padding argument is kSecPaddingPKCS1, PKCS1 padding
will be performed prior to signing. If this argument is kSecPaddingNone,
the incoming data will be signed "as is".
When PKCS1 padding is performed, the maximum length of data that can
be signed is the value returned by SecKeyGetBlockSize() - 11.
NOTE: The behavior this function with kSecPaddingNone is undefined if the
first byte of dataToSign is zero; there is no way to verify leading zeroes
as they are discarded during the calculation.
If you want to generate a proper PKCS1 style signature with DER encoding
of the digest type - and the dataToSign is a SHA1 digest - use
kSecPaddingPKCS1SHA1.
*/
OSStatus SecKeyRawSign(
SecKeyRef key,
SecPadding padding,
const uint8_t *dataToSign,
size_t dataToSignLen,
uint8_t *sig,
size_t *sigLen)
API_DEPRECATED("Use SecKeyCreateSignature", ios(2.0, 15.0), tvos(4.0, 15.0), watchos(1.0, 8.0));
/*!
@function SecKeyRawVerify
@abstract Given a public key, data which has been signed, and a signature,
verify the signature.
@param key Public key with which to verify the signature.
@param padding See Padding Types above, typically kSecPaddingPKCS1SHA1.
@param signedData The data over which sig is being verified, typically
the digest of the actual data.
@param signedDataLen Length of signedData in bytes.
@param sig Pointer to the signature to verify.
@param sigLen Length of sig in bytes.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion If the padding argument is kSecPaddingPKCS1, PKCS1 padding
will be checked during verification. If this argument is kSecPaddingNone,
the incoming data will be compared directly to sig.
If you are verifying a proper PKCS1-style signature, with DER encoding
of the digest type - and the signedData is a SHA1 digest - use
kSecPaddingPKCS1SHA1.
*/
OSStatus SecKeyRawVerify(
SecKeyRef key,
SecPadding padding,
const uint8_t *signedData,
size_t signedDataLen,
const uint8_t *sig,
size_t sigLen)
API_DEPRECATED("Use SecKeyVerifySignature", ios(2.0, 15.0), tvos(4.0, 15.0), watchos(1.0, 8.0));
/*!
@function SecKeyEncrypt
@abstract Encrypt a block of plaintext.
@param key Public key with which to encrypt the data.
@param padding See Padding Types above, typically kSecPaddingPKCS1.
@param plainText The data to encrypt.
@param plainTextLen Length of plainText in bytes, this must be less
or equal to the value returned by SecKeyGetBlockSize().
@param cipherText Pointer to the output buffer.
@param cipherTextLen On input, specifies how much space is available at
cipherText; on return, it is the actual number of cipherText bytes written.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion If the padding argument is kSecPaddingPKCS1 or kSecPaddingOAEP,
PKCS1 (respectively kSecPaddingOAEP) padding will be performed prior to encryption.
If this argument is kSecPaddingNone, the incoming data will be encrypted "as is".
kSecPaddingOAEP is the recommended value. Other value are not recommended
for security reason (Padding attack or malleability).
When PKCS1 padding is performed, the maximum length of data that can
be encrypted is the value returned by SecKeyGetBlockSize() - 11.
When memory usage is a critical issue, note that the input buffer
(plainText) can be the same as the output buffer (cipherText).
*/
OSStatus SecKeyEncrypt(
SecKeyRef key,
SecPadding padding,
const uint8_t *plainText,
size_t plainTextLen,
uint8_t *cipherText,
size_t *cipherTextLen)
API_DEPRECATED("Use SecKeyCreateEncryptedData", ios(2.0, 15.0), tvos(4.0, 15.0), watchos(1.0, 8.0));
/*!
@function SecKeyDecrypt
@abstract Decrypt a block of ciphertext.
@param key Private key with which to decrypt the data.
@param padding See Padding Types above, typically kSecPaddingPKCS1.
@param cipherText The data to decrypt.
@param cipherTextLen Length of cipherText in bytes, this must be less
or equal to the value returned by SecKeyGetBlockSize().
@param plainText Pointer to the output buffer.
@param plainTextLen On input, specifies how much space is available at
plainText; on return, it is the actual number of plainText bytes written.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion If the padding argument is kSecPaddingPKCS1 or kSecPaddingOAEP,
the corresponding padding will be removed after decryption.
If this argument is kSecPaddingNone, the decrypted data will be returned "as is".
When memory usage is a critical issue, note that the input buffer
(plainText) can be the same as the output buffer (cipherText).
*/
OSStatus SecKeyDecrypt(
SecKeyRef key, /* Private key */
SecPadding padding, /* kSecPaddingNone,
kSecPaddingPKCS1,
kSecPaddingOAEP */
const uint8_t *cipherText,
size_t cipherTextLen, /* length of cipherText */
uint8_t *plainText,
size_t *plainTextLen) /* IN/OUT */
API_DEPRECATED("Use SecKeyCreateDecryptedData", ios(2.0, 15.0), tvos(4.0, 15.0), watchos(1.0, 8.0));
#endif // SEC_OS_IPHONE
/*!
@function SecKeyCreateRandomKey
@abstract Generates a new public/private key pair.
@param parameters A dictionary containing one or more key-value pairs.
See the discussion sections below for a complete overview of options.
@param error On error, will be populated with an error object describing the failure.
See "Security Error Codes" (SecBase.h).
@return Newly generated private key. To get associated public key, use SecKeyCopyPublicKey().
@discussion In order to generate a keypair the parameters dictionary must
at least contain the following keys:
* kSecAttrKeyType with a value being kSecAttrKeyTypeRSA or any other
kSecAttrKeyType defined in SecItem.h
* kSecAttrKeySizeInBits with a value being a CFNumberRef or CFStringRef
containing the requested key size in bits. Example sizes for RSA
keys are: 512, 768, 1024, 2048.
The values below may be set either in the top-level dictionary or in a
dictionary that is the value of the kSecPrivateKeyAttrs or
kSecPublicKeyAttrs key in the top-level dictionary. Setting these
attributes explicitly will override the defaults below. See SecItem.h
for detailed information on these attributes including the types of
the values.
* kSecAttrLabel default NULL
* kSecAttrIsPermanent if this key is present and has a Boolean value of true,
the key or key pair will be added to the default keychain.
* kSecAttrTokenID if this key should be generated on specified token. This
attribute can contain CFStringRef and can be present only in the top-level
parameters dictionary.
* kSecAttrApplicationTag default NULL
* kSecAttrEffectiveKeySize default NULL same as kSecAttrKeySizeInBits
* kSecAttrCanEncrypt default false for private keys, true for public keys
* kSecAttrCanDecrypt default true for private keys, false for public keys
* kSecAttrCanDerive default true
* kSecAttrCanSign default true for private keys, false for public keys
* kSecAttrCanVerify default false for private keys, true for public keys
* kSecAttrCanWrap default false for private keys, true for public keys
* kSecAttrCanUnwrap default true for private keys, false for public keys
*/
SecKeyRef _Nullable SecKeyCreateRandomKey(CFDictionaryRef parameters, CFErrorRef *error)
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
/*!
@function SecKeyCreateWithData
@abstract Create a SecKey from a well-defined external representation.
@param keyData CFData representing the key. The format of the data depends on the type of key being created.
@param attributes Dictionary containing attributes describing the key to be imported. The keys in this dictionary
are kSecAttr* constants from SecItem.h. Mandatory attributes are:
* kSecAttrKeyType
* kSecAttrKeyClass
@param error On error, will be populated with an error object describing the failure.
See "Security Error Codes" (SecBase.h).
@result A SecKey object representing the key, or NULL on failure.
@discussion This function does not add keys to any keychain, but the SecKey object it returns can be added
to keychain using the SecItemAdd function.
The requested data format depend on the type of key (kSecAttrKeyType) being created:
* kSecAttrKeyTypeRSA PKCS#1 format, public key can be also in x509 public key format
* kSecAttrKeyTypeECSECPrimeRandom ANSI X9.63 format (04 || X || Y [ || K])
*/
SecKeyRef _Nullable SecKeyCreateWithData(CFDataRef keyData, CFDictionaryRef attributes, CFErrorRef *error)
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
/*!
@function SecKeyGetBlockSize
@abstract Returns block length of the key in bytes.
@param key The key for which the block length is requested.
@result The block length of the key in bytes.
@discussion If for example key is an RSA key the value returned by
this function is the size of the modulus.
*/
size_t SecKeyGetBlockSize(SecKeyRef key)
API_AVAILABLE(macos(10.6), ios(2.0), tvos(4.0), watchos(1.0));
/*!
@function SecKeyCopyExternalRepresentation
@abstract Create an external representation for the given key suitable for the key's type.
@param key The key to be exported.
@param error On error, will be populated with an error object describing the failure.
See "Security Error Codes" (SecBase.h).
@result A CFData representing the key in a format suitable for that key type.
@discussion This function may fail if the key is not exportable (e.g., bound to a smart card or Secure Enclave).
The format in which the key will be exported depends on the type of key:
* kSecAttrKeyTypeRSA PKCS#1 format
* kSecAttrKeyTypeECSECPrimeRandom ANSI X9.63 format (04 || X || Y [ || K])
*/
CFDataRef _Nullable SecKeyCopyExternalRepresentation(SecKeyRef key, CFErrorRef *error)
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
/*!
@function SecKeyCopyAttributes
@abstract Retrieve keychain attributes of a key.
@param key The key whose attributes are to be retrieved.
@result Dictionary containing attributes of the key. The keys that populate this dictionary are defined
and discussed in SecItem.h.
@discussion The attributes provided by this function are:
* kSecAttrCanEncrypt
* kSecAttrCanDecrypt
* kSecAttrCanDerive
* kSecAttrCanSign
* kSecAttrCanVerify
* kSecAttrKeyClass
* kSecAttrKeyType
* kSecAttrKeySizeInBits
* kSecAttrTokenID
* kSecAttrApplicationLabel
The set of values is not fixed. Future versions may return more values in this dictionary.
*/
CFDictionaryRef _Nullable SecKeyCopyAttributes(SecKeyRef key)
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
/*!
@function SecKeyCopyPublicKey
@abstract Retrieve the public key from a key pair or private key.
@param key The key from which to retrieve a public key.
@result The public key or NULL if public key is not available for specified key.
@discussion Fails if key does not contain a public key or no public key can be computed from it.
*/
SecKeyRef _Nullable SecKeyCopyPublicKey(SecKeyRef key)
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
/*!
@enum SecKeyAlgorithm
@abstract Available algorithms for performing cryptographic operations with SecKey object. String representation
of constant can be used for logging or debugging purposes, because they contain human readable names of the algorithm.
@constant kSecKeyAlgorithmRSASignatureRaw
Raw RSA sign/verify operation, size of input data must be the same as value returned by SecKeyGetBlockSize().
@constant kSecKeyAlgorithmRSASignatureDigestPKCS1v15Raw
RSA sign/verify operation, assumes that input data is digest and OID and digest algorithm as specified in PKCS# v1.5.
This algorithm is typically not used directly, instead use algorithm with specified digest, like
kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA256.
@constant kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA1
RSA signature with PKCS#1 padding, input data must be SHA-1 generated digest.
@constant kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA224
RSA signature with PKCS#1 padding, input data must be SHA-224 generated digest.
@constant kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA256
RSA signature with PKCS#1 padding, input data must be SHA-256 generated digest.
@constant kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA384
RSA signature with PKCS#1 padding, input data must be SHA-384 generated digest.
@constant kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA512
RSA signature with PKCS#1 padding, input data must be SHA-512 generated digest.
@constant kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA1
RSA signature with PKCS#1 padding, SHA-1 digest is generated by called function automatically from input data of any size.
@constant kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA224
RSA signature with PKCS#1 padding, SHA-224 digest is generated by called function automatically from input data of any size.
@constant kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA256
RSA signature with PKCS#1 padding, SHA-256 digest is generated by called function automatically from input data of any size.
@constant kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA384
RSA signature with PKCS#1 padding, SHA-384 digest is generated by called function automatically from input data of any size.
@constant kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA512
RSA signature with PKCS#1 padding, SHA-512 digest is generated by called function automatically from input data of any size.
@constant kSecKeyAlgorithmRSASignatureDigestPSSSHA1
RSA signature with RSASSA-PSS padding according to PKCS#1 v2.1, input data must be SHA-1 generated digest.
PSS padding is calculated using MGF1 with SHA1 and saltLength parameter is set to 20 (SHA-1 output size).
@constant kSecKeyAlgorithmRSASignatureDigestPSSSHA224
RSA signature with RSASSA-PSS padding according to PKCS#1 v2.1, input data must be SHA-224 generated digest.
PSS padding is calculated using MGF1 with SHA224 and saltLength parameter is set to 28 (SHA-224 output size).
@constant kSecKeyAlgorithmRSASignatureDigestPSSSHA256
RSA signature with RSASSA-PSS padding according to PKCS#1 v2.1, input data must be SHA-256 generated digest.
PSS padding is calculated using MGF1 with SHA256 and saltLength parameter is set to 32 (SHA-256 output size).
@constant kSecKeyAlgorithmRSASignatureDigestPSSSHA384
RSA signature with RSASSA-PSS padding according to PKCS#1 v2.1, input data must be SHA-384 generated digest.
PSS padding is calculated using MGF1 with SHA384 and saltLength parameter is set to 48 (SHA-384 output size).
@constant kSecKeyAlgorithmRSASignatureDigestPSSSHA512
RSA signature with RSASSA-PSS padding according to PKCS#1 v2.1, input data must be SHA-512 generated digest.
PSS padding is calculated using MGF1 with SHA512 and saltLength parameter is set to 64 (SHA-512 output size).
@constant kSecKeyAlgorithmRSASignatureMessagePSSSHA1
RSA signature with RSASSA-PSS padding according to PKCS#1 v2.1, SHA-1 digest is generated by called function automatically from input data of any size.
PSS padding is calculated using MGF1 with SHA1 and saltLength parameter is set to 20 (SHA-1 output size).
@constant kSecKeyAlgorithmRSASignatureMessagePSSSHA224
RSA signature with RSASSA-PSS padding according to PKCS#1 v2.1, SHA-224 digest is generated by called function automatically from input data of any size.
PSS padding is calculated using MGF1 with SHA224 and saltLength parameter is set to 28 (SHA-224 output size).
@constant kSecKeyAlgorithmRSASignatureMessagePSSSHA256
RSA signature with RSASSA-PSS padding according to PKCS#1 v2.1, SHA-256 digest is generated by called function automatically from input data of any size.
PSS padding is calculated using MGF1 with SHA256 and saltLength parameter is set to 32 (SHA-256 output size).
@constant kSecKeyAlgorithmRSASignatureMessagePSSSHA384
RSA signature with RSASSA-PSS padding according to PKCS#1 v2.1, SHA-384 digest is generated by called function automatically from input data of any size.
PSS padding is calculated using MGF1 with SHA384 and saltLength parameter is set to 48 (SHA-384 output size).
@constant kSecKeyAlgorithmRSASignatureMessagePSSSHA512
RSA signature with RSASSA-PSS padding according to PKCS#1 v2.1, SHA-512 digest is generated by called function automatically from input data of any size.
PSS padding is calculated using MGF1 with SHA512 and saltLength parameter is set to 64 (SHA-512 output size).
@constant kSecKeyAlgorithmECDSASignatureRFC4754
ECDSA algorithm, signature is concatenated r and s, big endian, input data must be message digest generated by some hash function.
@constant kSecKeyAlgorithmECDSASignatureDigestX962
ECDSA algorithm, signature is in DER x9.62 encoding, input data must be message digest generated by some hash functions.
@constant kSecKeyAlgorithmECDSASignatureDigestX962SHA1
ECDSA algorithm, signature is in DER x9.62 encoding, input data must be message digest created by SHA1 algorithm.
@constant kSecKeyAlgorithmECDSASignatureDigestX962SHA224
ECDSA algorithm, signature is in DER x9.62 encoding, input data must be message digest created by SHA224 algorithm.
@constant kSecKeyAlgorithmECDSASignatureDigestX962SHA256
ECDSA algorithm, signature is in DER x9.62 encoding, input data must be message digest created by SHA256 algorithm.
@constant kSecKeyAlgorithmECDSASignatureDigestX962SHA384
ECDSA algorithm, signature is in DER x9.62 encoding, input data must be message digest created by SHA384 algorithm.
@constant kSecKeyAlgorithmECDSASignatureDigestX962SHA512
ECDSA algorithm, signature is in DER x9.62 encoding, input data must be message digest created by SHA512 algorithm.
@constant kSecKeyAlgorithmECDSASignatureMessageX962SHA1
ECDSA algorithm, signature is in DER x9.62 encoding, SHA-1 digest is generated by called function automatically from input data of any size.
@constant kSecKeyAlgorithmECDSASignatureMessageX962SHA224
ECDSA algorithm, signature is in DER x9.62 encoding, SHA-224 digest is generated by called function automatically from input data of any size.
@constant kSecKeyAlgorithmECDSASignatureMessageX962SHA256
ECDSA algorithm, signature is in DER x9.62 encoding, SHA-256 digest is generated by called function automatically from input data of any size.
@constant kSecKeyAlgorithmECDSASignatureMessageX962SHA384
ECDSA algorithm, signature is in DER x9.62 encoding, SHA-384 digest is generated by called function automatically from input data of any size.
@constant kSecKeyAlgorithmECDSASignatureMessageX962SHA512
ECDSA algorithm, signature is in DER x9.62 encoding, SHA-512 digest is generated by called function automatically from input data of any size.
@constant kSecKeyAlgorithmRSAEncryptionRaw
Raw RSA encryption or decryption, size of data must match RSA key modulus size. Note that direct
use of this algorithm without padding is cryptographically very weak, it is important to always introduce
some kind of padding. Input data size must be less or equal to the key block size and returned block has always
the same size as block size, as returned by SecKeyGetBlockSize().
@constant kSecKeyAlgorithmRSAEncryptionPKCS1
RSA encryption or decryption, data is padded using PKCS#1 padding scheme. This algorithm should be used only for
backward compatibility with existing protocols and data. New implementations should choose cryptographically
stronger algorithm instead (see kSecKeyAlgorithmRSAEncryptionOAEP). Input data must be at most
"key block size - 11" bytes long and returned block has always the same size as block size, as returned
by SecKeyGetBlockSize().
@constant kSecKeyAlgorithmRSAEncryptionOAEPSHA1
RSA encryption or decryption, data is padded using OAEP padding scheme internally using SHA1. Input data must be at most
"key block size - 42" bytes long and returned block has always the same size as block size, as returned
by SecKeyGetBlockSize(). Use kSecKeyAlgorithmRSAEncryptionOAEPSHA1AESGCM to be able to encrypt and decrypt arbitrary long data.
@constant kSecKeyAlgorithmRSAEncryptionOAEPSHA224
RSA encryption or decryption, data is padded using OAEP padding scheme internally using SHA224. Input data must be at most
"key block size - 58" bytes long and returned block has always the same size as block size, as returned
by SecKeyGetBlockSize(). Use kSecKeyAlgorithmRSAEncryptionOAEPSHA224AESGCM to be able to encrypt and decrypt arbitrary long data.
@constant kSecKeyAlgorithmRSAEncryptionOAEPSHA256
RSA encryption or decryption, data is padded using OAEP padding scheme internally using SHA256. Input data must be at most
"key block size - 66" bytes long and returned block has always the same size as block size, as returned
by SecKeyGetBlockSize(). Use kSecKeyAlgorithmRSAEncryptionOAEPSHA256AESGCM to be able to encrypt and decrypt arbitrary long data.
@constant kSecKeyAlgorithmRSAEncryptionOAEPSHA384
RSA encryption or decryption, data is padded using OAEP padding scheme internally using SHA384. Input data must be at most
"key block size - 98" bytes long and returned block has always the same size as block size, as returned
by SecKeyGetBlockSize(). Use kSecKeyAlgorithmRSAEncryptionOAEPSHA384AESGCM to be able to encrypt and decrypt arbitrary long data.
@constant kSecKeyAlgorithmRSAEncryptionOAEPSHA512
RSA encryption or decryption, data is padded using OAEP padding scheme internally using SHA512. Input data must be at most
"key block size - 130" bytes long and returned block has always the same size as block size, as returned
by SecKeyGetBlockSize(). Use kSecKeyAlgorithmRSAEncryptionOAEPSHA512AESGCM to be able to encrypt and decrypt arbitrary long data.
@constant kSecKeyAlgorithmRSAEncryptionOAEPSHA1AESGCM
Randomly generated AES session key is encrypted by RSA with OAEP padding. User data are encrypted using session key in GCM
mode with all-zero 16 bytes long IV (initialization vector). Finally 16 byte AES-GCM tag is appended to ciphertext.
256bit AES key is used if RSA key is 4096bit or bigger, otherwise 128bit AES key is used. Raw public key data is used
as authentication data for AES-GCM encryption.
@constant kSecKeyAlgorithmRSAEncryptionOAEPSHA224AESGCM
Randomly generated AES session key is encrypted by RSA with OAEP padding. User data are encrypted using session key in GCM
mode with all-zero 16 bytes long IV (initialization vector). Finally 16 byte AES-GCM tag is appended to ciphertext.
256bit AES key is used if RSA key is 4096bit or bigger, otherwise 128bit AES key is used. Raw public key data is used
as authentication data for AES-GCM encryption.
@constant kSecKeyAlgorithmRSAEncryptionOAEPSHA256AESGCM
Randomly generated AES session key is encrypted by RSA with OAEP padding. User data are encrypted using session key in GCM
mode with all-zero 16 bytes long IV (initialization vector). Finally 16 byte AES-GCM tag is appended to ciphertext.
256bit AES key is used if RSA key is 4096bit or bigger, otherwise 128bit AES key is used. Raw public key data is used
as authentication data for AES-GCM encryption.
@constant kSecKeyAlgorithmRSAEncryptionOAEPSHA384AESGCM
Randomly generated AES session key is encrypted by RSA with OAEP padding. User data are encrypted using session key in GCM
mode with all-zero 16 bytes long IV (initialization vector). Finally 16 byte AES-GCM tag is appended to ciphertext.
256bit AES key is used if RSA key is 4096bit or bigger, otherwise 128bit AES key is used. Raw public key data is used
as authentication data for AES-GCM encryption.
@constant kSecKeyAlgorithmRSAEncryptionOAEPSHA512AESGCM
Randomly generated AES session key is encrypted by RSA with OAEP padding. User data are encrypted using session key in GCM
mode with all-zero 16 bytes long IV (initialization vector). Finally 16 byte AES-GCM tag is appended to ciphertext.
256bit AES key is used if RSA key is 4096bit or bigger, otherwise 128bit AES key is used. Raw public key data is used
as authentication data for AES-GCM encryption.
@constant kSecKeyAlgorithmECIESEncryptionStandardX963SHA1AESGCM
Legacy ECIES encryption or decryption, use kSecKeyAlgorithmECIESEncryptionStandardVariableIVX963SHA256AESGCM in new code.
Encryption is done using AES-GCM with key negotiated by kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA1. AES Key size
is 128bit for EC keys <=256bit and 256bit for bigger EC keys. Ephemeral public key data is used as sharedInfo for KDF.
AES-GCM uses 16 bytes long TAG and all-zero 16 byte long IV (initialization vector).
@constant kSecKeyAlgorithmECIESEncryptionStandardX963SHA224AESGCM
Legacy ECIES encryption or decryption, use kSecKeyAlgorithmECIESEncryptionStandardVariableIVX963SHA224AESGCM in new code.
Encryption is done using AES-GCM with key negotiated by kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA224. AES Key size
is 128bit for EC keys <=256bit and 256bit for bigger EC keys. Ephemeral public key data is used as sharedInfo for KDF.
AES-GCM uses 16 bytes long TAG and all-zero 16 byte long IV (initialization vector).
@constant kSecKeyAlgorithmECIESEncryptionStandardX963SHA256AESGCM
Legacy ECIES encryption or decryption, use kSecKeyAlgorithmECIESEncryptionStandardVariableIVX963SHA256AESGCM in new code.
Encryption is done using AES-GCM with key negotiated by kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA256. AES Key size
is 128bit for EC keys <=256bit and 256bit for bigger EC keys. Ephemeral public key data is used as sharedInfo for KDF.
AES-GCM uses 16 bytes long TAG and all-zero 16 byte long IV (initialization vector).
@constant kSecKeyAlgorithmECIESEncryptionStandardX963SHA384AESGCM
Legacy ECIES encryption or decryption, use kSecKeyAlgorithmECIESEncryptionStandardVariableIVX963SHA384AESGCM in new code.
Encryption is done using AES-GCM with key negotiated by kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA384. AES Key size
is 128bit for EC keys <=256bit and 256bit for bigger EC keys. Ephemeral public key data is used as sharedInfo for KDF.
AES-GCM uses 16 bytes long TAG and all-zero 16 byte long IV (initialization vector).
@constant kSecKeyAlgorithmECIESEncryptionStandardX963SHA512AESGCM
Legacy ECIES encryption or decryption, use kSecKeyAlgorithmECIESEncryptionStandardVariableIVX963SHA512AESGCM in new code.
Encryption is done using AES-GCM with key negotiated by kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA512. AES Key size
is 128bit for EC keys <=256bit and 256bit for bigger EC keys. Ephemeral public key data is used as sharedInfo for KDF.
AES-GCM uses 16 bytes long TAG and all-zero 16 byte long IV (initialization vector).
@constant kSecKeyAlgorithmECIESEncryptionCofactorX963SHA1AESGCM
Legacy ECIES encryption or decryption, use kSecKeyAlgorithmECIESEncryptionCofactorVariableIVX963SHA256AESGCM in new code.
Encryption is done using AES-GCM with key negotiated by kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA1. AES Key size
is 128bit for EC keys <=256bit and 256bit for bigger EC keys. Ephemeral public key data is used as sharedInfo for KDF.
AES-GCM uses 16 bytes long TAG and all-zero 16 byte long IV (initialization vector).
@constant kSecKeyAlgorithmECIESEncryptionCofactorX963SHA224AESGCM
Legacy ECIES encryption or decryption, use kSecKeyAlgorithmECIESEncryptionCofactorVariableIVX963SHA224AESGCM in new code.
Encryption is done using AES-GCM with key negotiated by kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA224. AES Key size
is 128bit for EC keys <=256bit and 256bit for bigger EC keys. Ephemeral public key data is used as sharedInfo for KDF.
AES-GCM uses 16 bytes long TAG and all-zero 16 byte long IV (initialization vector).
@constant kSecKeyAlgorithmECIESEncryptionCofactorX963SHA256AESGCM
Legacy ECIES encryption or decryption, use kSecKeyAlgorithmECIESEncryptionCofactorVariableIVX963SHA256AESGCM in new code.
Encryption is done using AES-GCM with key negotiated by kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA256. AES Key size
is 128bit for EC keys <=256bit and 256bit for bigger EC keys. Ephemeral public key data is used as sharedInfo for KDF.
AES-GCM uses 16 bytes long TAG and all-zero 16 byte long IV (initialization vector).
@constant kSecKeyAlgorithmECIESEncryptionCofactorX963SHA384AESGCM
Legacy ECIES encryption or decryption, use kSecKeyAlgorithmECIESEncryptionCofactorVariableIVX963SHA384AESGCM in new code.
Encryption is done using AES-GCM with key negotiated by kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA384. AES Key size
is 128bit for EC keys <=256bit and 256bit for bigger EC keys. Ephemeral public key data is used as sharedInfo for KDF.
AES-GCM uses 16 bytes long TAG and all-zero 16 byte long IV (initialization vector).
@constant kSecKeyAlgorithmECIESEncryptionCofactorX963SHA512AESGCM
Legacy ECIES encryption or decryption, use kSecKeyAlgorithmECIESEncryptionCofactorVariableIVX963SHA512AESGCM in new code.
Encryption is done using AES-GCM with key negotiated by kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA512. AES Key size
is 128bit for EC keys <=256bit and 256bit for bigger EC keys. Ephemeral public key data is used as sharedInfo for KDF.
AES-GCM uses 16 bytes long TAG and all-zero 16 byte long IV (initialization vector).
@constant kSecKeyAlgorithmECIESEncryptionStandardVariableIVX963SHA224AESGCM
ECIES encryption or decryption. This algorithm does not limit the size of the message to be encrypted or decrypted.
Encryption is done using AES-GCM with key negotiated by kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA224. AES Key size
is 128bit for EC keys <=256bit and 256bit for bigger EC keys. Ephemeral public key data is used as sharedInfo for KDF.
AES-GCM uses 16 bytes long TAG, AES key is first half of KDF output and 16 byte long IV (initialization vector) is second half
of KDF output.
@constant kSecKeyAlgorithmECIESEncryptionStandardVariableIVX963SHA256AESGCM
ECIES encryption or decryption. This algorithm does not limit the size of the message to be encrypted or decrypted.
Encryption is done using AES-GCM with key negotiated by kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA256. AES Key size
is 128bit for EC keys <=256bit and 256bit for bigger EC keys. Ephemeral public key data is used as sharedInfo for KDF.
AES-GCM uses 16 bytes long TAG, AES key is first half of KDF output and 16 byte long IV (initialization vector) is second half
of KDF output.
@constant kSecKeyAlgorithmECIESEncryptionStandardVariableIVX963SHA384AESGCM
ECIES encryption or decryption. This algorithm does not limit the size of the message to be encrypted or decrypted.
Encryption is done using AES-GCM with key negotiated by kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA384. AES Key size
is 128bit for EC keys <=256bit and 256bit for bigger EC keys. Ephemeral public key data is used as sharedInfo for KDF.
AES-GCM uses 16 bytes long TAG, AES key is first half of KDF output and 16 byte long IV (initialization vector) is second half
of KDF output.
@constant kSecKeyAlgorithmECIESEncryptionStandardVariableIVX963SHA512AESGCM
ECIES encryption or decryption. This algorithm does not limit the size of the message to be encrypted or decrypted.
Encryption is done using AES-GCM with key negotiated by kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA512. AES Key size
is 128bit for EC keys <=256bit and 256bit for bigger EC keys. Ephemeral public key data is used as sharedInfo for KDF.
AES-GCM uses 16 bytes long TAG, AES key is first half of KDF output and 16 byte long IV (initialization vector) is second half
of KDF output.
@constant kSecKeyAlgorithmECIESEncryptionCofactorVariableIVX963SHA224AESGCM
ECIES encryption or decryption. This algorithm does not limit the size of the message to be encrypted or decrypted.
Encryption is done using AES-GCM with key negotiated by kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA224. AES Key size
is 128bit for EC keys <=256bit and 256bit for bigger EC keys. Ephemeral public key data is used as sharedInfo for KDF.
AES-GCM uses 16 bytes long TAG, AES key is first half of KDF output and 16 byte long IV (initialization vector) is second half
of KDF output.
@constant kSecKeyAlgorithmECIESEncryptionCofactorVariableIVX963SHA256AESGCM
ECIES encryption or decryption. This algorithm does not limit the size of the message to be encrypted or decrypted.
Encryption is done using AES-GCM with key negotiated by kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA256. AES Key size
is 128bit for EC keys <=256bit and 256bit for bigger EC keys. Ephemeral public key data is used as sharedInfo for KDF.
AES-GCM uses 16 bytes long TAG, AES key is first half of KDF output and 16 byte long IV (initialization vector) is second half
of KDF output.
@constant kSecKeyAlgorithmECIESEncryptionCofactorVariableIVX963SHA384AESGCM
ECIES encryption or decryption. This algorithm does not limit the size of the message to be encrypted or decrypted.
Encryption is done using AES-GCM with key negotiated by kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA384. AES Key size
is 128bit for EC keys <=256bit and 256bit for bigger EC keys. Ephemeral public key data is used as sharedInfo for KDF.
AES-GCM uses 16 bytes long TAG, AES key is first half of KDF output and 16 byte long IV (initialization vector) is second half
of KDF output.
@constant kSecKeyAlgorithmECIESEncryptionCofactorVariableIVX963SHA512AESGCM
ECIES encryption or decryption. This algorithm does not limit the size of the message to be encrypted or decrypted.
Encryption is done using AES-GCM with key negotiated by kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA512. AES Key size
is 128bit for EC keys <=256bit and 256bit for bigger EC keys. Ephemeral public key data is used as sharedInfo for KDF.
AES-GCM uses 16 bytes long TAG, AES key is first half of KDF output and 16 byte long IV (initialization vector) is second half
of KDF output.
@constant kSecKeyAlgorithmECDHKeyExchangeCofactor
Compute shared secret using ECDH cofactor algorithm, suitable only for kSecAttrKeyTypeECSECPrimeRandom keys.
This algorithm does not accept any parameters, length of output raw shared secret is given by the length of the key.
@constant kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA1
Compute shared secret using ECDH cofactor algorithm, suitable only for kSecAttrKeyTypeECSECPrimeRandom keys
and apply ANSI X9.63 KDF with SHA1 as hashing function. Requires kSecKeyKeyExchangeParameterRequestedSize and allows
kSecKeyKeyExchangeParameterSharedInfo parameters to be used.
@constant kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA224
Compute shared secret using ECDH cofactor algorithm, suitable only for kSecAttrKeyTypeECSECPrimeRandom keys
and apply ANSI X9.63 KDF with SHA224 as hashing function. Requires kSecKeyKeyExchangeParameterRequestedSize and allows
kSecKeyKeyExchangeParameterSharedInfo parameters to be used.
@constant kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA256
Compute shared secret using ECDH cofactor algorithm, suitable only for kSecAttrKeyTypeECSECPrimeRandom keys
and apply ANSI X9.63 KDF with SHA256 as hashing function. Requires kSecKeyKeyExchangeParameterRequestedSize and allows
kSecKeyKeyExchangeParameterSharedInfo parameters to be used.
@constant kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA384
Compute shared secret using ECDH cofactor algorithm, suitable only for kSecAttrKeyTypeECSECPrimeRandom keys
and apply ANSI X9.63 KDF with SHA384 as hashing function. Requires kSecKeyKeyExchangeParameterRequestedSize and allows
kSecKeyKeyExchangeParameterSharedInfo parameters to be used.
@constant kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA512
Compute shared secret using ECDH cofactor algorithm, suitable only for kSecAttrKeyTypeECSECPrimeRandom keys
and apply ANSI X9.63 KDF with SHA512 as hashing function. Requires kSecKeyKeyExchangeParameterRequestedSize and allows
kSecKeyKeyExchangeParameterSharedInfo parameters to be used.
@constant kSecKeyAlgorithmECDHKeyExchangeStandard
Compute shared secret using ECDH algorithm without cofactor, suitable only for kSecAttrKeyTypeECSECPrimeRandom keys.
This algorithm does not accept any parameters, length of output raw shared secret is given by the length of the key.
@constant kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA1
Compute shared secret using ECDH algorithm without cofactor, suitable only for kSecAttrKeyTypeECSECPrimeRandom keys
and apply ANSI X9.63 KDF with SHA1 as hashing function. Requires kSecKeyKeyExchangeParameterRequestedSize and allows
kSecKeyKeyExchangeParameterSharedInfo parameters to be used.
@constant kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA224
Compute shared secret using ECDH algorithm without cofactor, suitable only for kSecAttrKeyTypeECSECPrimeRandom keys
and apply ANSI X9.63 KDF with SHA224 as hashing function. Requires kSecKeyKeyExchangeParameterRequestedSize and allows
kSecKeyKeyExchangeParameterSharedInfo parameters to be used.
@constant kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA256
Compute shared secret using ECDH algorithm without cofactor, suitable only for kSecAttrKeyTypeECSECPrimeRandom keys
and apply ANSI X9.63 KDF with SHA256 as hashing function. Requires kSecKeyKeyExchangeParameterRequestedSize and allows
kSecKeyKeyExchangeParameterSharedInfo parameters to be used.
@constant kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA384
Compute shared secret using ECDH algorithm without cofactor, suitable only for kSecAttrKeyTypeECSECPrimeRandom keys
and apply ANSI X9.63 KDF with SHA384 as hashing function. Requires kSecKeyKeyExchangeParameterRequestedSize and allows
kSecKeyKeyExchangeParameterSharedInfo parameters to be used.
@constant kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA512
Compute shared secret using ECDH algorithm without cofactor, suitable only for kSecAttrKeyTypeECSECPrimeRandom keys
and apply ANSI X9.63 KDF with SHA512 as hashing function. Requires kSecKeyKeyExchangeParameterRequestedSize and allows
kSecKeyKeyExchangeParameterSharedInfo parameters to be used.
*/
typedef CFStringRef SecKeyAlgorithm CF_STRING_ENUM
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureRaw
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureDigestPKCS1v15Raw
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA1
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA224
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA256
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA384
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA512
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA1
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA224
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA256
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA384
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA512
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureDigestPSSSHA1
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureDigestPSSSHA224
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureDigestPSSSHA256
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureDigestPSSSHA384
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureDigestPSSSHA512
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureMessagePSSSHA1
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureMessagePSSSHA224
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureMessagePSSSHA256
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureMessagePSSSHA384
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureMessagePSSSHA512
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECDSASignatureRFC4754
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECDSASignatureDigestX962
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECDSASignatureDigestX962SHA1
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECDSASignatureDigestX962SHA224
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECDSASignatureDigestX962SHA256
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECDSASignatureDigestX962SHA384
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECDSASignatureDigestX962SHA512
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECDSASignatureMessageX962SHA1
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECDSASignatureMessageX962SHA224
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECDSASignatureMessageX962SHA256
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECDSASignatureMessageX962SHA384
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECDSASignatureMessageX962SHA512
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSAEncryptionRaw
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSAEncryptionPKCS1
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSAEncryptionOAEPSHA1
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSAEncryptionOAEPSHA224
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSAEncryptionOAEPSHA256
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSAEncryptionOAEPSHA384
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSAEncryptionOAEPSHA512
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSAEncryptionOAEPSHA1AESGCM
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSAEncryptionOAEPSHA224AESGCM
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSAEncryptionOAEPSHA256AESGCM
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSAEncryptionOAEPSHA384AESGCM
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmRSAEncryptionOAEPSHA512AESGCM
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECIESEncryptionStandardX963SHA1AESGCM
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECIESEncryptionStandardX963SHA224AESGCM
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECIESEncryptionStandardX963SHA256AESGCM
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECIESEncryptionStandardX963SHA384AESGCM
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECIESEncryptionStandardX963SHA512AESGCM
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECIESEncryptionCofactorX963SHA1AESGCM
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECIESEncryptionCofactorX963SHA224AESGCM
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECIESEncryptionCofactorX963SHA256AESGCM
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECIESEncryptionCofactorX963SHA384AESGCM
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECIESEncryptionCofactorX963SHA512AESGCM
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECIESEncryptionStandardVariableIVX963SHA224AESGCM
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECIESEncryptionStandardVariableIVX963SHA256AESGCM
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECIESEncryptionStandardVariableIVX963SHA384AESGCM
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECIESEncryptionStandardVariableIVX963SHA512AESGCM
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECIESEncryptionCofactorVariableIVX963SHA224AESGCM
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECIESEncryptionCofactorVariableIVX963SHA256AESGCM
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECIESEncryptionCofactorVariableIVX963SHA384AESGCM
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECIESEncryptionCofactorVariableIVX963SHA512AESGCM
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECDHKeyExchangeStandard
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA1
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA224
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA256
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA384
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA512
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECDHKeyExchangeCofactor
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA1
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA224
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA256
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA384
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyAlgorithm kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA512
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
/*!
@function SecKeyCreateSignature
@abstract Given a private key and data to sign, generate a digital signature.
@param key Private key with which to sign.
@param algorithm One of SecKeyAlgorithm constants suitable to generate signature with this key.
@param dataToSign The data to be signed, typically the digest of the actual data.
@param error On error, will be populated with an error object describing the failure.
See "Security Error Codes" (SecBase.h).
@result The signature over dataToSign represented as a CFData, or NULL on failure.
@discussion Computes digital signature using specified key over input data. The operation algorithm
further defines the exact format of input data, operation to be performed and output signature.
*/
CFDataRef _Nullable SecKeyCreateSignature(SecKeyRef key, SecKeyAlgorithm algorithm, CFDataRef dataToSign, CFErrorRef *error)
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
/*!
@function SecKeyVerifySignature
@abstract Given a public key, data which has been signed, and a signature, verify the signature.
@param key Public key with which to verify the signature.
@param algorithm One of SecKeyAlgorithm constants suitable to verify signature with this key.
@param signedData The data over which sig is being verified, typically the digest of the actual data.
@param signature The signature to verify.
@param error On error, will be populated with an error object describing the failure.
See "Security Error Codes" (SecBase.h).
@result True if the signature was valid, False otherwise.
@discussion Verifies digital signature operation using specified key and signed data. The operation algorithm
further defines the exact format of input data, signature and operation to be performed.
*/
Boolean SecKeyVerifySignature(SecKeyRef key, SecKeyAlgorithm algorithm, CFDataRef signedData, CFDataRef signature, CFErrorRef *error)
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
/*!
@function SecKeyCreateEncryptedData
@abstract Encrypt a block of plaintext.
@param key Public key with which to encrypt the data.
@param algorithm One of SecKeyAlgorithm constants suitable to perform encryption with this key.
@param plaintext The data to encrypt. The length and format of the data must conform to chosen algorithm,
typically be less or equal to the value returned by SecKeyGetBlockSize().
@param error On error, will be populated with an error object describing the failure.
See "Security Error Codes" (SecBase.h).
@result The ciphertext represented as a CFData, or NULL on failure.
@discussion Encrypts plaintext data using specified key. The exact type of the operation including the format
of input and output data is specified by encryption algorithm.
*/
CFDataRef _Nullable SecKeyCreateEncryptedData(SecKeyRef key, SecKeyAlgorithm algorithm, CFDataRef plaintext,
CFErrorRef *error)
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
/*!
@function SecKeyCreateDecryptedData
@abstract Decrypt a block of ciphertext.
@param key Private key with which to decrypt the data.
@param algorithm One of SecKeyAlgorithm constants suitable to perform decryption with this key.
@param ciphertext The data to decrypt. The length and format of the data must conform to chosen algorithm,
typically be less or equal to the value returned by SecKeyGetBlockSize().
@param error On error, will be populated with an error object describing the failure.
See "Security Error Codes" (SecBase.h).
@result The plaintext represented as a CFData, or NULL on failure.
@discussion Decrypts ciphertext data using specified key. The exact type of the operation including the format
of input and output data is specified by decryption algorithm.
*/
CFDataRef _Nullable SecKeyCreateDecryptedData(SecKeyRef key, SecKeyAlgorithm algorithm, CFDataRef ciphertext,
CFErrorRef *error)
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
/*!
@enum SecKeyKeyExchangeParameter SecKey Key Exchange parameters
@constant kSecKeyKeyExchangeParameterRequestedSize Contains CFNumberRef with requested result size in bytes.
@constant kSecKeyKeyExchangeParameterSharedInfo Contains CFDataRef with additional shared info
for KDF (key derivation function).
*/
typedef CFStringRef SecKeyKeyExchangeParameter CF_STRING_ENUM
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyKeyExchangeParameter kSecKeyKeyExchangeParameterRequestedSize
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
extern const SecKeyKeyExchangeParameter kSecKeyKeyExchangeParameterSharedInfo
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
/*!
@function SecKeyCopyKeyExchangeResult
@abstract Perform Diffie-Hellman style of key exchange operation, optionally with additional key-derivation steps.
@param algorithm One of SecKeyAlgorithm constants suitable to perform this operation.
@param publicKey Remote party's public key.
@param parameters Dictionary with parameters, see SecKeyKeyExchangeParameter constants. Used algorithm
determines the set of required and optional parameters to be used.
@param error Pointer to an error object on failure.
See "Security Error Codes" (SecBase.h).
@result Result of key exchange operation as a CFDataRef, or NULL on failure.
*/
CFDataRef _Nullable SecKeyCopyKeyExchangeResult(SecKeyRef privateKey, SecKeyAlgorithm algorithm, SecKeyRef publicKey, CFDictionaryRef parameters, CFErrorRef *error)
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
/*!
@enum SecKeyOperationType
@abstract Defines types of cryptographic operations available with SecKey instance.
@constant kSecKeyOperationTypeSign
Represents SecKeyCreateSignature()
@constant kSecKeyOperationTypeVerify
Represents SecKeyVerifySignature()
@constant kSecKeyOperationTypeEncrypt
Represents SecKeyCreateEncryptedData()
@constant kSecKeyOperationTypeDecrypt
Represents SecKeyCreateDecryptedData()
@constant kSecKeyOperationTypeKeyExchange
Represents SecKeyCopyKeyExchangeResult()
*/
typedef CF_ENUM(CFIndex, SecKeyOperationType) {
kSecKeyOperationTypeSign = 0,
kSecKeyOperationTypeVerify = 1,
kSecKeyOperationTypeEncrypt = 2,
kSecKeyOperationTypeDecrypt = 3,
kSecKeyOperationTypeKeyExchange = 4,
} API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
/*!
@function SecKeyIsAlgorithmSupported
@abstract Checks whether key supports specified algorithm for specified operation.
@param key Key to query
@param operation Operation type for which the key is queried
@param algorithm Algorithm which is queried
@return True if key supports specified algorithm for specified operation, False otherwise.
*/
Boolean SecKeyIsAlgorithmSupported(SecKeyRef key, SecKeyOperationType operation, SecKeyAlgorithm algorithm)
API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0));
CF_IMPLICIT_BRIDGING_DISABLED
CF_ASSUME_NONNULL_END
__END_DECLS
#endif /* !_SECURITY_SECKEY_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecACL.h | /*
* Copyright (c) 2002-2011 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
@header SecACL
The functions provided in SecACL are for managing entries in the access control list.
*/
#ifndef _SECURITY_SECACL_H_
#define _SECURITY_SECACL_H_
#include <Security/SecBase.h>
#include <Security/cssmtype.h>
#include <Security/cssmapple.h>
#include <Security/SecAccess.h>
#include <CoreFoundation/CoreFoundation.h>
#if defined(__cplusplus)
extern "C" {
#endif
CF_ASSUME_NONNULL_BEGIN
CF_IMPLICIT_BRIDGING_ENABLED
#if SEC_OS_OSX
typedef CF_OPTIONS(uint16, SecKeychainPromptSelector)
{
kSecKeychainPromptRequirePassphase = 0x0001, /* require re-entering of passphrase */
/* the following bits are ignored by 10.4 and earlier */
kSecKeychainPromptUnsigned = 0x0010, /* prompt for unsigned clients */
kSecKeychainPromptUnsignedAct = 0x0020, /* UNSIGNED bit overrides system default */
kSecKeychainPromptInvalid = 0x0040, /* prompt for invalid signed clients */
kSecKeychainPromptInvalidAct = 0x0080,
};
/*!
@function SecACLGetTypeID
@abstract Returns the type identifier of SecACL instances.
@result The CFTypeID of SecACL instances.
*/
CFTypeID SecACLGetTypeID(void)
__OSX_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_NA);
/*!
@function SecACLCreateFromSimpleContents
@abstract Creates a new access control list entry from the application list, description, and prompt selector provided and adds it to an item's access.
@param access An access reference.
@param applicationList An array of SecTrustedApplication instances that will be allowed access without prompting.
@param description The human readable name that will be used to refer to this item when the user is prompted.
@param promptSelector A pointer to a CSSM prompt selector.
@param newAcl A pointer to an access control list entry. On return, this points to the reference of the new access control list entry.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This function is deprecated in 10.7 and later;
use SecACLCreateWithSimpleContents instead.
*/
OSStatus SecACLCreateFromSimpleContents(SecAccessRef access,
CFArrayRef __nullable applicationList,
CFStringRef description,
const CSSM_ACL_KEYCHAIN_PROMPT_SELECTOR *promptSelector,
SecACLRef * __nonnull CF_RETURNS_RETAINED newAcl)
CSSM_DEPRECATED;
/*!
@function SecACLCreateWithSimpleContents
@abstract Creates a new access control list entry from the application list, description, and prompt selector provided and adds it to an item's access.
@param access An access reference.
@param applicationList An array of SecTrustedApplication instances that will be allowed access without prompting.
@param description The human readable name that will be used to refer to this item when the user is prompted.
@param promptSelector A SecKeychainPromptSelector selector.
@param newAcl A pointer to an access control list entry. On return, this points to the reference of the new access control list entry.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecACLCreateWithSimpleContents(SecAccessRef access,
CFArrayRef __nullable applicationList,
CFStringRef description,
SecKeychainPromptSelector promptSelector,
SecACLRef * __nonnull CF_RETURNS_RETAINED newAcl)
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
/*!
@function SecACLRemove
@abstract Removes the access control list entry specified.
@param aclRef The reference to the access control list entry to remove.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecACLRemove(SecACLRef aclRef)
__OSX_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_NA);
/*!
@function SecACLCopySimpleContents
@abstract Returns the application list, description, and CSSM prompt selector for a given access control list entry.
@param acl An access control list entry reference.
@param applicationList On return, An array of SecTrustedApplication instances that will be allowed access without prompting, for the given access control list entry. The caller needs to call CFRelease on this array when it's no longer needed.
@param description On return, the human readable name that will be used to refer to this item when the user is prompted, for the given access control list entry. The caller needs to call CFRelease on this string when it's no longer needed.
@param promptSelector A pointer to a CSSM prompt selector. On return, this points to the CSSM prompt selector for the given access control list entry.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This function is deprecated in 10.7 and later;
use SecACLCopyContents instead.
*/
OSStatus SecACLCopySimpleContents(SecACLRef acl,
CFArrayRef * __nonnull CF_RETURNS_RETAINED applicationList,
CFStringRef * __nonnull CF_RETURNS_RETAINED description,
CSSM_ACL_KEYCHAIN_PROMPT_SELECTOR *promptSelector)
CSSM_DEPRECATED;
/*!
@function SecACLCopyContents
@abstract Returns the application list, description, and prompt selector for a given access control list entry.
@param acl An access control list entry reference.
@param applicationList On return, An array of SecTrustedApplication instances that will be allowed access without prompting, for the given access control list entry. The caller needs to call CFRelease on this array when it's no longer needed.
@param description On return, the human readable name that will be used to refer to this item when the user is prompted, for the given access control list entry. The caller needs to call CFRelease on this string when it's no longer needed.
@param promptSelector A pointer to a SecKeychainPromptSelector. On return, this points to the SecKeychainPromptSelector for the given access control list entry.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecACLCopyContents(SecACLRef acl,
CFArrayRef * __nonnull CF_RETURNS_RETAINED applicationList,
CFStringRef * __nonnull CF_RETURNS_RETAINED description,
SecKeychainPromptSelector *promptSelector)
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
/*!
@function SecACLSetSimpleContents
@abstract Sets the application list, description, and CSSM prompt selector for a given access control list entry.
@param acl A reference to the access control list entry to edit.
@param applicationList An application list reference.
@param description The human readable name that will be used to refer to this item when the user is prompted.
@param promptSelector A pointer to a CSSM prompt selector.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This function is deprecated in 10.7 and later;
use SecACLSetContents instead.
*/
OSStatus SecACLSetSimpleContents(SecACLRef acl,
CFArrayRef __nullable applicationList,
CFStringRef description,
const CSSM_ACL_KEYCHAIN_PROMPT_SELECTOR *promptSelector)
CSSM_DEPRECATED;
/*!
@function SecACLSetContents
@abstract Sets the application list, description, and prompt selector for a given access control list entry.
@param acl A reference to the access control list entry to edit.
@param applicationList An application list reference.
@param description The human readable name that will be used to refer to this item when the user is prompted.
@param promptSelector A SecKeychainPromptSelector selector.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecACLSetContents(SecACLRef acl,
CFArrayRef __nullable applicationList,
CFStringRef description,
SecKeychainPromptSelector promptSelector)
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
#endif // SEC_OS_OSX
/*!
@function SecACLGetAuthorizations
@abstract Retrieve the CSSM authorization tags of a given access control list entry.
@param acl An access control list entry reference.
@param tags On return, this points to the first item in an array of CSSM authorization tags.
@param tagCount On return, this points to the number of tags in the CSSM authorization tag array.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This function is deprecated in 10.7 and later;
use SecACLCopyAuthorizations instead.
*/
OSStatus SecACLGetAuthorizations(SecACLRef acl,
CSSM_ACL_AUTHORIZATION_TAG *tags, uint32 *tagCount)
CSSM_DEPRECATED;
/*!
@function SecACLCopyAuthorizations
@abstract Retrieve the authorization tags of a given access control list entry.
@param acl An access control list entry reference.
@result On return, a CFArrayRef of the authorizations for this ACL.
*/
CFArrayRef SecACLCopyAuthorizations(SecACLRef acl)
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
/*!
@function SecACLSetAuthorizations
@abstract Sets the CSSM authorization tags of a given access control list entry.
@param acl An access control list entry reference.
@param tags A pointer to the first item in an array of CSSM authorization tags.
@param tagCount The number of tags in the CSSM authorization tag array.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This function is deprecated in 10.7 and later;
use SecACLUpdateAuthorizations instead.
*/
OSStatus SecACLSetAuthorizations(SecACLRef acl,
CSSM_ACL_AUTHORIZATION_TAG *tags, uint32 tagCount)
CSSM_DEPRECATED;
/*!
@function SecACLUpdateAuthorizations
@abstract Sets the authorization tags of a given access control list entry.
@param acl An access control list entry reference.
@param authorizations A pointer to an array of authorization tags.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecACLUpdateAuthorizations(SecACLRef acl, CFArrayRef authorizations)
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
CF_IMPLICIT_BRIDGING_DISABLED
CF_ASSUME_NONNULL_END
#if defined(__cplusplus)
}
#endif
#endif /* !_SECURITY_SECACL_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/mds.h | /*
* Copyright (c) 2000-2001,2011,2014 Apple Inc. All Rights Reserved.
*
* The contents of this file constitute Original Code as defined in and are
* subject to the Apple Public Source License Version 1.2 (the 'License').
* You may not use this file except in compliance with the License. Please obtain
* a copy of the License at http://www.apple.com/publicsource and read it before
* using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
* OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
* LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
* specific language governing rights and limitations under the License.
*/
/*
File: mds.h
Contains: Module Directory Services Data Types and API.
Copyright (c) 1999-2000,2011,2014 Apple Inc. All Rights Reserved.
*/
#ifndef _MDS_H_
#define _MDS_H_ 1
#include <Security/cssmtype.h>
#ifdef __cplusplus
extern "C" {
#endif
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
typedef CSSM_DL_HANDLE MDS_HANDLE;
typedef CSSM_DL_DB_HANDLE MDS_DB_HANDLE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER mds_funcs {
CSSM_RETURN (CSSMAPI *DbOpen)
(MDS_HANDLE MdsHandle,
const char *DbName,
const CSSM_NET_ADDRESS *DbLocation,
CSSM_DB_ACCESS_TYPE AccessRequest,
const CSSM_ACCESS_CREDENTIALS *AccessCred,
const void *OpenParameters,
CSSM_DB_HANDLE *hMds);
CSSM_RETURN (CSSMAPI *DbClose)
(MDS_DB_HANDLE MdsDbHandle);
CSSM_RETURN (CSSMAPI *GetDbNames)
(MDS_HANDLE MdsHandle,
CSSM_NAME_LIST_PTR *NameList);
CSSM_RETURN (CSSMAPI *GetDbNameFromHandle)
(MDS_DB_HANDLE MdsDbHandle,
char **DbName);
CSSM_RETURN (CSSMAPI *FreeNameList)
(MDS_HANDLE MdsHandle,
CSSM_NAME_LIST_PTR NameList);
CSSM_RETURN (CSSMAPI *DataInsert)
(MDS_DB_HANDLE MdsDbHandle,
CSSM_DB_RECORDTYPE RecordType,
const CSSM_DB_RECORD_ATTRIBUTE_DATA *Attributes,
const CSSM_DATA *Data,
CSSM_DB_UNIQUE_RECORD_PTR *UniqueId);
CSSM_RETURN (CSSMAPI *DataDelete)
(MDS_DB_HANDLE MdsDbHandle,
const CSSM_DB_UNIQUE_RECORD *UniqueRecordIdentifier);
CSSM_RETURN (CSSMAPI *DataModify)
(MDS_DB_HANDLE MdsDbHandle,
CSSM_DB_RECORDTYPE RecordType,
CSSM_DB_UNIQUE_RECORD_PTR UniqueRecordIdentifier,
const CSSM_DB_RECORD_ATTRIBUTE_DATA *AttributesToBeModified,
const CSSM_DATA *DataToBeModified,
CSSM_DB_MODIFY_MODE ModifyMode);
CSSM_RETURN (CSSMAPI *DataGetFirst)
(MDS_DB_HANDLE MdsDbHandle,
const CSSM_QUERY *Query,
CSSM_HANDLE_PTR ResultsHandle,
CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
CSSM_DATA_PTR Data,
CSSM_DB_UNIQUE_RECORD_PTR *UniqueId);
CSSM_RETURN (CSSMAPI *DataGetNext)
(MDS_DB_HANDLE MdsDbHandle,
CSSM_HANDLE ResultsHandle,
CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
CSSM_DATA_PTR Data,
CSSM_DB_UNIQUE_RECORD_PTR *UniqueId);
CSSM_RETURN (CSSMAPI *DataAbortQuery)
(MDS_DB_HANDLE MdsDbHandle,
CSSM_HANDLE ResultsHandle);
CSSM_RETURN (CSSMAPI *DataGetFromUniqueRecordId)
(MDS_DB_HANDLE MdsDbHandle,
const CSSM_DB_UNIQUE_RECORD *UniqueRecord,
CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
CSSM_DATA_PTR Data);
CSSM_RETURN (CSSMAPI *FreeUniqueRecord)
(MDS_DB_HANDLE MdsDbHandle,
CSSM_DB_UNIQUE_RECORD_PTR UniqueRecord);
CSSM_RETURN (CSSMAPI *CreateRelation)
(MDS_DB_HANDLE MdsDbHandle,
CSSM_DB_RECORDTYPE RelationID,
const char *RelationName,
uint32 NumberOfAttributes,
const CSSM_DB_SCHEMA_ATTRIBUTE_INFO *pAttributeInfo,
uint32 NumberOfIndexes,
const CSSM_DB_SCHEMA_INDEX_INFO *pIndexInfo);
CSSM_RETURN (CSSMAPI *DestroyRelation)
(MDS_DB_HANDLE MdsDbHandle,
CSSM_DB_RECORDTYPE RelationID);
} MDS_FUNCS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *MDS_FUNCS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* MDS Context APIs */
CSSM_RETURN CSSMAPI
MDS_Initialize (const CSSM_GUID *pCallerGuid,
const CSSM_MEMORY_FUNCS *pMemoryFunctions,
MDS_FUNCS_PTR pDlFunctions,
MDS_HANDLE *hMds)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
CSSM_RETURN CSSMAPI
MDS_Terminate (MDS_HANDLE MdsHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
CSSM_RETURN CSSMAPI
MDS_Install (MDS_HANDLE MdsHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
CSSM_RETURN CSSMAPI
MDS_Uninstall (MDS_HANDLE MdsHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
#pragma clang diagnostic pop
#ifdef __cplusplus
}
#endif
#endif /* _MDS_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecTrustedApplication.h | /*
* Copyright (c) 2002-2004,2011-2012,2014 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
@header SecTrustedApplication
The functions provided in SecTrustedApplication implement an object representing an application in a
SecAccess object.
*/
#ifndef _SECURITY_SECTRUSTEDAPPLICATION_H_
#define _SECURITY_SECTRUSTEDAPPLICATION_H_
#include <Security/SecBase.h>
#include <CoreFoundation/CoreFoundation.h>
#if defined(__cplusplus)
extern "C" {
#endif
CF_ASSUME_NONNULL_BEGIN
/*!
@function SecTrustedApplicationGetTypeID
@abstract Returns the type identifier of SecTrustedApplication instances.
@result The CFTypeID of SecTrustedApplication instances.
*/
CFTypeID SecTrustedApplicationGetTypeID(void);
/*!
@function SecTrustedApplicationCreateFromPath
@abstract Creates a trusted application reference based on the trusted application specified by path.
@param path The path to the application or tool to trust. For application bundles, use the
path to the bundle directory. Pass NULL to refer to yourself, i.e. the application or tool
making this call.
@param app On return, a pointer to the trusted application reference.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecTrustedApplicationCreateFromPath(const char * __nullable path, SecTrustedApplicationRef * __nonnull CF_RETURNS_RETAINED app)
API_DEPRECATED("No longer supported", macos(10.0, 10.15))
API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
/*!
@function SecTrustedApplicationCopyData
@abstract Retrieves the data of a given trusted application reference
@param appRef A trusted application reference to retrieve data from
@param data On return, a pointer to a data reference of the trusted application.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecTrustedApplicationCopyData(SecTrustedApplicationRef appRef, CFDataRef * __nonnull CF_RETURNS_RETAINED data)
API_DEPRECATED("No longer supported", macos(10.0, 10.15))
API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
/*!
@function SecTrustedApplicationSetData
@abstract Sets the data of a given trusted application reference
@param appRef A trusted application reference.
@param data A reference to the data to set in the trusted application.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecTrustedApplicationSetData(SecTrustedApplicationRef appRef, CFDataRef data)
API_DEPRECATED("No longer supported", macos(10.0, 10.15))
API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
CF_ASSUME_NONNULL_END
#if defined(__cplusplus)
}
#endif
#endif /* !_SECURITY_SECTRUSTEDAPPLICATION_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecAsn1Coder.h | /*
* Copyright (c) 2003-2006,2008-2013 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*
* SecAsn1Coder.h: ANS1 encode/decode object.
*
* A SecAsn1Coder is capable of encoding and decoding both DER and BER data
* streams, based on caller-supplied templates which in turn are based
* upon ASN.1 specifications. A SecAsn1Coder allocates memory during encode
* and decode using a memory pool which is owned and managed by the SecAsn1Coder
* object, and which is freed when the SecAsn1Coder object os released.
*/
#ifndef _SEC_ASN1_CODER_H_
#define _SEC_ASN1_CODER_H_
#include <sys/types.h>
#include <Security/SecAsn1Types.h>
#include <TargetConditionals.h>
#include <Security/SecBase.h> /* error codes */
#ifdef __cplusplus
extern "C" {
#endif
CF_ASSUME_NONNULL_BEGIN
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
/*
* Opaque reference to a SecAsn1Coder object.
*/
typedef struct SecAsn1Coder *SecAsn1CoderRef SEC_ASN1_API_DEPRECATED;
/*
* Create/destroy SecAsn1Coder object.
*/
OSStatus SecAsn1CoderCreate(
SecAsn1CoderRef __nullable * __nonnull coder) SEC_ASN1_API_DEPRECATED;
OSStatus SecAsn1CoderRelease(
SecAsn1CoderRef coder) SEC_ASN1_API_DEPRECATED;
/*
* DER decode an untyped item per the specified template array.
* The result is allocated in this SecAsn1Coder's memory pool and
* is freed when this object is released.
*
* The templates argument points to a an array of SecAsn1Templates
* defining the object to be decoded; the end of the array is
* indicated by a SecAsn1Template with file kind equalling 0.
*
* The dest pointer is a template-specific struct allocated by the caller
* and must be zeroed by the caller.
*
* Returns errSecUnknownFormat on decode-specific error.
*/
OSStatus SecAsn1Decode(
SecAsn1CoderRef coder,
const void *src, // DER-encoded source
size_t len,
const SecAsn1Template *templates,
void *dest) SEC_ASN1_API_DEPRECATED;
/*
* Convenience routine, decode from a SecAsn1Item.
*/
OSStatus SecAsn1DecodeData(
SecAsn1CoderRef coder,
const SecAsn1Item *src,
const SecAsn1Template *templ,
void *dest) SEC_ASN1_API_DEPRECATED;
/*
* DER encode. The encoded data (in dest.Data) is allocated in this
* SecAsn1Coder's memory pool and is freed when this object is released.
*
* The src pointer is a template-specific struct.
*
* The templates argument points to a an array of SecAsn1Templates
* defining the object to be decoded; the end of the array is
* indicated by a SecAsn1Template with file kind equalling 0.
*/
OSStatus SecAsn1EncodeItem(
SecAsn1CoderRef coder,
const void *src,
const SecAsn1Template *templates,
SecAsn1Item *dest) SEC_ASN1_API_DEPRECATED;
/*
* Some alloc-related methods which come in handy when using
* this object. All memory is allocated using this object's
* memory pool. Caller never has to free it. Used for
* temp allocs of memory which only needs a scope which is the
* same as this object.
*
* All except SecAsn1Malloc return a errSecAllocate in the highly
* unlikely event of a malloc failure.
*
* SecAsn1Malloc() returns a pointer to allocated memory, like
* malloc().
*/
void *SecAsn1Malloc(
SecAsn1CoderRef coder,
size_t len) SEC_ASN1_API_DEPRECATED;
/* Allocate item.Data, set item.Length */
OSStatus SecAsn1AllocItem(
SecAsn1CoderRef coder,
SecAsn1Item *item,
size_t len) SEC_ASN1_API_DEPRECATED;
/* Allocate and copy, various forms */
OSStatus SecAsn1AllocCopy(
SecAsn1CoderRef coder,
const void *src, /* memory copied from here */
size_t len, /* length to allocate & copy */
SecAsn1Item *dest) /* dest->Data allocated and copied to;
* dest->Length := len */
SEC_ASN1_API_DEPRECATED;
OSStatus SecAsn1AllocCopyItem(
SecAsn1CoderRef coder,
const SecAsn1Item *src, /* src->Length bytes allocated and copied from
* src->Data */
SecAsn1Item *dest) /* dest->Data allocated and copied to;
* dest->Length := src->Length */
SEC_ASN1_API_DEPRECATED;
/* Compare two decoded OIDs. Returns true iff they are equivalent. */
bool SecAsn1OidCompare(const SecAsn1Oid *oid1, const SecAsn1Oid *oid2) SEC_ASN1_API_DEPRECATED;
#pragma clang diagnostic pop
CF_ASSUME_NONNULL_END
#ifdef __cplusplus
}
#endif
#endif /* _SEC_ASN1_CODER_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/AuthorizationDB.h | /*
* Copyright (c) 2003,2011,2014 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
* AuthorizationDB.h -- APIs for managing the authorization policy database
* and daemons.
*/
#ifndef _SECURITY_AUTHORIZATIONDB_H_
#define _SECURITY_AUTHORIZATIONDB_H_
#include <Security/Authorization.h>
#include <CoreFoundation/CoreFoundation.h>
#if defined(__cplusplus)
extern "C" {
#endif
CF_ASSUME_NONNULL_BEGIN
/*!
@header AuthorizationDB
Version 1.0
This API allows for any programs to get, modify, delete and add new right definitions to the policy database. Meta-rights specify whether and what authorization is required to make these modifications.
AuthorizationRightSet(authRef, "com.ifoo.ifax.send", CFSTR(kRuleIsAdmin), CFSTR("You must authenticate to send a fax."), NULL, NULL)
add a rule for letting admins send faxes using a canned rule, delegating to a pre-specified rule that authorizes everyone who is an admin.
AuthorizationRightSet(authRef, "com.ifoo.ifax.send", [[CFSTR(kRightRule), CFSTR(kRuleIsAdmin)], [CFSTR(kRightComment), CFSTR("authorizes sending of 1 fax message")]], CFSTR("Authorize sending of a fax"), NULL, NULL)
add identical rule, but specify additional attributes this time.
Keep in mind while specifying a comment to be specific about what you need to authorize for (1 fax), in terms of a general message for user. The means of proof required for kRuleIsAdmin (enter username/password for example) should not be included here, since it could be configured differently. Also note that the "authRef" variable used in each of the above examples must be a vaild AuthorizationRef obtained from AuthorizationCreate().
*/
/*! @define kRightRule
rule delegation key. Instead of specifying exact behavior some canned rules
are shipped that may be switched by configurable security.
*/
#define kAuthorizationRightRule "rule"
/*! @defined kRuleIsAdmin
canned rule values for use with rule delegation definitions: require user to be an admin.
*/
#define kAuthorizationRuleIsAdmin "is-admin"
/*! @defined kRuleAuthenticateAsSessionUser
canned rule value for use with rule delegation definitions: require user to authenticate as the session owner (logged-in user).
*/
#define kAuthorizationRuleAuthenticateAsSessionUser "authenticate-session-owner"
/*! @defined kRuleAuthenticateAsAdmin
Canned rule value for use with rule delegation definitions: require user to authenticate as admin.
*/
#define kAuthorizationRuleAuthenticateAsAdmin "authenticate-admin"
/*! @defined kAuthorizationRuleClassAllow
Class that allows anything.
*/
#define kAuthorizationRuleClassAllow "allow"
/*! @defined kAuthorizationRuleClassDeny
Class that denies anything.
*/
#define kAuthorizationRuleClassDeny "deny"
/*! @defined kAuthorizationComment
comments for the administrator on what is being customized here;
as opposed to (localized) descriptions presented to the user.
*/
#define kAuthorizationComment "comment"
/*!
@function AuthorizationRightGet
Retrieves a right definition as a dictionary. There are no restrictions to keep anyone from retrieving these definitions.
@param rightName (input) the rightname (ASCII). Wildcard rightname definitions are okay.
@param rightDefinition (output/optional) the dictionary with all keys defining the right. See documented keys. Passing in NULL will just check if there is a definition. The caller is responsible for releasing the returned dictionary.
@result errAuthorizationSuccess 0 No error.
errAuthorizationDenied -60005 No definition found.
*/
OSStatus AuthorizationRightGet(const char *rightName,
CFDictionaryRef * __nullable CF_RETURNS_RETAINED rightDefinition);
/*!
@function AuthorizationRightSet
Create or update a right entry. Only normal rights can be registered (wildcard rights are denied); wildcard rights are considered to be put in by an administrator putting together a site configuration.
@param authRef (input) authRef to authorize modifications.
@param rightName (input) the rightname (ASCII). Wildcard rightnames are not okay.
@param rightDefinition (input) a CFString of the name of a rule to use (delegate) or CFDictionary containing keys defining one.
@param descriptionKey (input/optional) a CFString to use as a key for looking up localized descriptions. If no localization is found this will be the description itself.
@param bundle (input/optional) a bundle to get localizations from if not the main bundle.
@param localeTableName (input/optional) stringtable name to get localizations from.
@result errAuthorizationSuccess 0 added right definition successfully.
errAuthorizationDenied -60005 Unable to create or update right definition.
errAuthorizationCanceled -60006 Authorization was canceled by user.
errAuthorizationInteractionNotAllowed -60007 Interaction was required but not possible.
*/
OSStatus AuthorizationRightSet(AuthorizationRef authRef,
const char *rightName,
CFTypeRef rightDefinition,
CFStringRef __nullable descriptionKey,
CFBundleRef __nullable bundle,
CFStringRef __nullable localeTableName);
/*!
@function AuthorizationRightRemove
Request to remove a right from the policy database.
@param authRef (input) authRef, to be used to authorize this action.
@param rightName (input) the rightname (ASCII). Wildcard rightnames are not okay.
*/
OSStatus AuthorizationRightRemove(AuthorizationRef authRef,
const char *rightName);
CF_ASSUME_NONNULL_END
#if defined(__cplusplus)
}
#endif
#endif /* !_SECURITY_AUTHORIZATIONDB_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/CodeSigning.h | /*
* Copyright (c) 2006,2011,2014 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _H_CODESIGNING
#define _H_CODESIGNING
/*!
@header CodeSigning
This header file includes all the headers that are needed to use
the client interface to Code Signing.
It does not include headers for the other Code Signing related interfaces.
*/
#include <Security/SecStaticCode.h>
#include <Security/SecCode.h>
#include <Security/SecRequirement.h>
#endif //_H_CODESIGNING
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecCodeHost.h | /*
* Copyright (c) 2006-2007,2011,2013 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _H_SECCODEHOST
#define _H_SECCODEHOST
#include <Security/CSCommon.h>
#ifdef __cplusplus
extern "C" {
#endif
CF_ASSUME_NONNULL_BEGIN
CF_ENUM(uint32_t) {
kSecCSDedicatedHost = 1 << 0,
kSecCSGenerateGuestHash = 1 << 1,
};
OSStatus SecHostCreateGuest(SecGuestRef host,
uint32_t status, CFURLRef path, CFDictionaryRef __nullable attributes,
SecCSFlags flags, SecGuestRef * __nonnull newGuest)
AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6;
OSStatus SecHostRemoveGuest(SecGuestRef host, SecGuestRef guest, SecCSFlags flags)
AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6;
OSStatus SecHostSelectGuest(SecGuestRef guestRef, SecCSFlags flags)
AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6;
OSStatus SecHostSelectedGuest(SecCSFlags flags, SecGuestRef * __nonnull guestRef)
AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6;
OSStatus SecHostSetGuestStatus(SecGuestRef guestRef,
uint32_t status, CFDictionaryRef __nullable attributes,
SecCSFlags flags)
AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6;
OSStatus SecHostSetHostingPort(mach_port_t hostingPort, SecCSFlags flags)
AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6;
CF_ASSUME_NONNULL_END
#ifdef __cplusplus
}
#endif
#endif //_H_SECCODEHOST
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecCode.h | /*
* Copyright (c) 2006-2014 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
@header SecCode
SecCode represents separately indentified running code in the system.
In addition to UNIX processes, this can also include (with suitable support)
scripts, applets, widgets, etc.
*/
#ifndef _H_SECCODE
#define _H_SECCODE
#include <Security/CSCommon.h>
#include <CoreFoundation/CFBase.h>
#include <xpc/xpc.h>
#ifdef __cplusplus
extern "C" {
#endif
CF_ASSUME_NONNULL_BEGIN
/*!
@function SecCodeGetTypeID
Returns the type identifier of all SecCode instances.
*/
CFTypeID SecCodeGetTypeID(void);
/*!
@function SecCodeCopySelf
Obtains a SecCode object for the code making the call.
The calling code is determined in a way that is subject to modification over
time, but obeys the following rules. If it is a UNIX process, its process id (pid)
is always used.
@param flags Optional flags. Pass kSecCSDefaultFlags for standard behavior.
@param self Upon successful return, contains a SecCodeRef representing the caller.
@result Upon success, errSecSuccess. Upon error, an OSStatus value documented in
CSCommon.h or certain other Security framework headers.
*/
OSStatus SecCodeCopySelf(SecCSFlags flags, SecCodeRef * __nonnull CF_RETURNS_RETAINED self);
/*!
@function SecCodeCopyStaticCode
Given a SecCode object, locate its origin in the file system and return
a SecStaticCode object representing it.
The link established by this call is generally reliable but is NOT guaranteed
to be secure.
Many API functions taking SecStaticCodeRef arguments will also directly
accept a SecCodeRef and apply this translation implicitly, operating on
its result or returning its error code if any. Each of these functions
calls out that behavior in its documentation.
If the code was obtained from a universal (aka "fat") program file,
the resulting SecStaticCodeRef will refer only to the architecture actually
being used. This means that multiple running codes started from the same file
may conceivably result in different static code references if they ended up
using different execution architectures. (This is unusual but possible.)
@param code A valid SecCode object reference representing code running
on the system.
@param flags Optional flags. Pass kSecCSDefaultFlags for standard behavior.
@constant kSecCSUseAllArchitectures
If code refers to a single architecture of a universal binary, return a SecStaticCodeRef
that refers to the entire universal code with all its architectures. By default, the
returned static reference identifies only the actual architecture of the running program.
@param staticCode On successful return, a SecStaticCode object reference representing
the file system origin of the given SecCode. On error, unchanged.
@result Upon success, errSecSuccess. Upon error, an OSStatus value documented in
CSCommon.h or certain other Security framework headers.
*/
CF_ENUM(uint32_t) {
kSecCSUseAllArchitectures = 1 << 0,
};
OSStatus SecCodeCopyStaticCode(SecCodeRef code, SecCSFlags flags, SecStaticCodeRef * __nonnull CF_RETURNS_RETAINED staticCode);
/*!
@function SecCodeCopyHost
Given a SecCode object, identify the (different) SecCode object that acts
as its host. A SecCode's host acts as a supervisor and controller,
and is the ultimate authority on the its dynamic validity and status.
The host relationship is securely established (absent reported errors).
@param guest A valid SecCode object reference representing code running
on the system.
@param flags Optional flags. Pass kSecCSDefaultFlags for standard behavior.
@param host On successful return, a SecCode object reference identifying
the code's host.
@result Upon success, errSecSuccess. Upon error, an OSStatus value documented in
CSCommon.h or certain other Security framework headers.
*/
OSStatus SecCodeCopyHost(SecCodeRef guest, SecCSFlags flags, SecCodeRef * __nonnull CF_RETURNS_RETAINED host);
extern const CFStringRef kSecGuestAttributeCanonical;
extern const CFStringRef kSecGuestAttributeHash;
extern const CFStringRef kSecGuestAttributeMachPort;
extern const CFStringRef kSecGuestAttributePid;
extern const CFStringRef kSecGuestAttributeAudit;
extern const CFStringRef kSecGuestAttributeDynamicCode;
extern const CFStringRef kSecGuestAttributeDynamicCodeInfoPlist;
extern const CFStringRef kSecGuestAttributeArchitecture;
extern const CFStringRef kSecGuestAttributeSubarchitecture;
#if TARGET_OS_OSX
/*!
@function SecCodeCopyGuestWithAttributes
This is the omnibus API function for obtaining dynamic code references.
In general, it asks a particular code acting as a code host to locate
and return a guest with given attributes. Different hosts support
different combinations of attributes and values for guest selection.
Asking the NULL host invokes system default procedures for obtaining
any running code in the system with the attributes given. The returned
code may be anywhere in the system.
The methods a host uses to identify, separate, and control its guests
are specific to each type of host. This call provides a generic abstraction layer
that allows uniform interrogation of all hosts. A SecCode that does not
act as a host will always return errSecCSNoSuchCode. A SecCode that does
support hosting may return itself to signify that the attribute refers to
itself rather than one of its hosts.
@param host A valid SecCode object reference representing code running
on the system that acts as a Code Signing host. As a special case, passing
NULL indicates that the Code Signing root of trust should be used as a starting
point. Currently, that is the system kernel.
@param attributes A CFDictionary containing zero or more attribute selector
values. Each selector has a CFString key and associated CFTypeRef value.
The key name identifies the attribute being specified; the associated value,
whose type depends on the the key name, selects a particular value or other
constraint on that attribute. Each host only supports particular combinations
of keys and values, and errors will be returned if any unsupported set is requested.
As a special case, NULL is taken to mean an empty attribute set.
Note that some hosts that support hosting chains (guests being hosts)
may return sub-guests in this call. In other words, do not assume that
a SecCodeRef returned by this call is a direct guest of the queried host
(though it will be a proximate guest, i.e. a guest's guest some way down).
Asking the NULL host for NULL attributes returns a code reference for the system root
of trust (at present, the running Darwin kernel).
@param flags Optional flags. Pass kSecCSDefaultFlags for standard behavior.
@param guest On successful return, a SecCode object reference identifying
the particular guest of the host that owns the attribute value(s) specified.
This argument will not be changed if the call fails (does not return errSecSuccess).
@result Upon success, errSecSuccess. Upon error, an OSStatus value documented in
CSCommon.h or certain other Security framework headers. In particular:
@error errSecCSUnsupportedGuestAttributes The host does not support the attribute
type given by attributeType.
@error errSecCSInvalidAttributeValues The type of value given for a guest
attribute is not supported by the host.
@error errSecCSNoSuchCode The host has no guest with the attribute value given
by attributeValue, even though the value is of a supported type. This may also
be returned if the host code does not currently act as a Code Signing host.
@error errSecCSNotAHost The specified host cannot, in fact, act as a code
host. (It is missing the kSecCodeSignatureHost option flag in its code
signature.)
@error errSecCSMultipleGuests The attributes specified do not uniquely identify
a guest (the specification is ambiguous).
*/
OSStatus SecCodeCopyGuestWithAttributes(SecCodeRef __nullable host,
CFDictionaryRef __nullable attributes, SecCSFlags flags, SecCodeRef * __nonnull CF_RETURNS_RETAINED guest);
/*!
@function SecCodeCreateWithXPCMessage
Creates a SecCode reference to the process that sent the provided XPC message, using the
associated audit token.
@param message The xpc_object_t of a message recieved via xpc to look up the audit token
of the process that sent the message.
@param flags Optional flags. Pass kSecCSDefaultFlags for standard behavior.
@param processRef On successful return, a SecCode object reference identifying
the particular guest of the process from the audit token. This argument will not be
changed if the call fails (does not return errSecSuccess).
@result Upon success, errSecSuccess. Upon error, an OSStatus value documented in
CSCommon.h or certain other Security framework headers. In particular:
@error errSecCSInvalidObjectRef The xpc_object_t was not of type XPC_TYPE_DICTIONARY.
@error errSecCSInvalidObjectRef The xpc_object_t was not an xpc message with an associated
connection.
For a complete list of errors, please see {@link SecCodeCopyGuestWithAttributes}.
*/
OSStatus SecCodeCreateWithXPCMessage(xpc_object_t message, SecCSFlags flags,
SecCodeRef * __nonnull CF_RETURNS_RETAINED target);
#endif // TARGET_OS_OSX
/*!
@function SecCodeCheckValidity
Performs dynamic validation of the given SecCode object. The call obtains and
verifies the signature on the code object. It checks the validity of only those
sealed components required to establish identity. It checks the SecCode's
dynamic validity status as reported by its host. It ensures that the SecCode's
host is in turn valid. Finally, it validates the code against a SecRequirement
if one is given. The call succeeds if all these conditions are satisfactory.
It fails otherwise.
This call is secure against attempts to modify the file system source of the
SecCode.
@param code The code object to be validated.
@param flags Optional flags. Pass kSecCSDefaultFlags for standard behavior.
@param requirement An optional code requirement specifying additional conditions
the code object must satisfy to be considered valid. If NULL, no additional
requirements are imposed.
@result If validation passes, errSecSuccess. If validation fails, an OSStatus value
documented in CSCommon.h or certain other Security framework headers.
*/
OSStatus SecCodeCheckValidity(SecCodeRef code, SecCSFlags flags,
SecRequirementRef __nullable requirement);
/*!
@function SecCodeCheckValidityWithErrors
Performs dynamic validation of the given SecCode object. The call obtains and
verifies the signature on the code object. It checks the validity of only those
sealed components required to establish identity. It checks the SecCode's
dynamic validity status as reported by its host. It ensures that the SecCode's
host is in turn valid. Finally, it validates the code against a SecRequirement
if one is given. The call succeeds if all these conditions are satisfactory.
It fails otherwise.
This call is secure against attempts to modify the file system source of the
SecCode.
@param code The code object to be validated.
@param flags Optional flags. Pass kSecCSDefaultFlags for standard behavior.
@param requirement An optional code requirement specifying additional conditions
the code object must satisfy to be considered valid. If NULL, no additional
requirements are imposed.
@param errors An optional pointer to a CFErrorRef variable. If the call fails
(and something other than errSecSuccess is returned), and this argument is non-NULL,
a CFErrorRef is stored there further describing the nature and circumstances
of the failure. The caller must CFRelease() this error object when done with it.
@result If validation passes, errSecSuccess. If validation fails, an OSStatus value
documented in CSCommon.h or certain other Security framework headers.
*/
OSStatus SecCodeCheckValidityWithErrors(SecCodeRef code, SecCSFlags flags,
SecRequirementRef __nullable requirement, CFErrorRef *errors);
/*!
@function SecCodeCopyPath
For a given Code or StaticCode object, returns a URL to a location on disk where the
code object can be found. For single files, the URL points to that file.
For bundles, it points to the directory containing the entire bundle.
@param staticCode The Code or StaticCode object to be located. For a Code
argument, its StaticCode is processed as per SecCodeCopyStaticCode.
@param flags Optional flags. Pass kSecCSDefaultFlags for standard behavior.
@param path On successful return, contains a CFURL identifying the location
on disk of the staticCode object.
@result On success, errSecSuccess. On error, an OSStatus value
documented in CSCommon.h or certain other Security framework headers.
*/
OSStatus SecCodeCopyPath(SecStaticCodeRef staticCode, SecCSFlags flags,
CFURLRef * __nonnull CF_RETURNS_RETAINED path);
/*!
@function SecCodeCopyDesignatedRequirement
For a given Code or StaticCode object, determines its Designated Code Requirement.
The Designated Requirement is the SecRequirement that the code believes
should be used to properly identify it in the future.
If the SecCode contains an explicit Designated Requirement, a copy of that
is returned. If it does not, a SecRequirement is implicitly constructed from
its signing authority and its embedded unique identifier. No Designated
Requirement can be obtained from code that is unsigned. Code that is modified
after signature, improperly signed, or has become invalid, may or may not yield
a Designated Requirement. This call does not validate the SecStaticCode argument.
@param code The Code or StaticCode object to be interrogated. For a Code
argument, its StaticCode is processed as per SecCodeCopyStaticCode.
@param flags Optional flags. Pass kSecCSDefaultFlags for standard behavior.
@param requirement On successful return, contains a copy of a SecRequirement
object representing the code's Designated Requirement. On error, unchanged.
@result On success, errSecSuccess. On error, an OSStatus value
documented in CSCommon.h or certain other Security framework headers.
*/
OSStatus SecCodeCopyDesignatedRequirement(SecStaticCodeRef code, SecCSFlags flags,
SecRequirementRef * __nonnull CF_RETURNS_RETAINED requirement);
/*
@function SecCodeCopySigningInformation
For a given Code or StaticCode object, extract various pieces of information
from its code signature and return them in the form of a CFDictionary. The amount
and detail level of the data is controlled by the flags passed to the call. For
Code objects, some of the signing information returned will be from disk. You can
call one of the CheckValidity functions to check that the content on disk matches
the signing information attached to the running Code.
If the code exists but is not signed at all, this call will succeed and return
a dictionary that does NOT contain the kSecCodeInfoIdentifier key. This is the
recommended way to check quickly whether a code is signed.
If the signing data for the code is corrupt or invalid, this call may fail or it
may return partial data. To ensure that only valid data is returned (and errors
are raised for invalid data), you must successfully call one of the CheckValidity
functions on the code before calling CopySigningInformation.
@param code The Code or StaticCode object to be interrogated. For a Code
argument, its StaticCode is processed as per SecCodeCopyStaticCode.
Note that dynamic information (kSecCSDynamicInformation) cannot be obtained
for a StaticCode argument.
@param flags Optional flags. Use any or all of the kSecCS*Information flags
to select what information to return. A generic set of entries is returned
regardless; you may specify kSecCSDefaultFlags for just those.
@param information A CFDictionary containing information about the code is stored
here on successful completion. The contents of the dictionary depend on
the flags passed. Regardless of flags, the kSecCodeInfoIdentifier key is
always present if the code is signed, and always absent if the code is
unsigned.
Note that some of the objects returned are (retained) "live" API objects
used by the code signing infrastructure. Making changes to these objects
is unsupported and may cause subsequent code signing operations on the
affected code to behave in undefined ways.
@result On success, errSecSuccess. On error, an OSStatus value
documented in CSCommon.h or certain other Security framework headers.
Flags:
@constant kSecCSSigningInformation Return cryptographic signing information,
including the certificate chain and CMS data (if any). For ad-hoc signed
code, there are no certificates and the CMS data is empty.
@constant kSecCSRequirementInformation Return information about internal code
requirements embedded in the code. This includes the Designated Requirement.
@constant kSecCSInternalInformation Return internal code signing information.
This information is for use by Apple, and is subject to change without notice.
It will not be further documented here.
@constant kSecCSDynamicInformation Return dynamic validity information about
the Code. The subject code must be a SecCodeRef (not a SecStaticCodeRef).
@constant kSecCSContentInformation Return more information about the file system
contents making up the signed code on disk. It is not generally advisable to
make use of this information, but some utilities (such as software-update
tools) may find it useful.
Dictionary keys:
@constant kSecCodeInfoCertificates A CFArray of SecCertificates identifying the
certificate chain of the signing certificate as seen by the system. Absent
for ad-hoc signed code. May be partial or absent in error cases.
@constant kSecCodeInfoChangedFiles A CFArray of CFURLs identifying all files in
the code that may have been modified by the process of signing it. (In other
words, files not in this list will not have been touched by the signing operation.)
@constant kSecCodeInfoCMS A CFData containing the CMS cryptographic object that
secures the code signature. Empty for ad-hoc signed code.
@constant kSecCodeInfoDesignatedRequirement A SecRequirement describing the
actual Designated Requirement of the code.
@constant kSecCodeInfoEntitlements A CFData containing the embedded entitlement
blob of the code, if any.
@constant kSecCodeInfoEntitlementsDict A CFDictionary containing the embedded entitlements
of the code if it has entitlements and they are in standard dictionary form.
Absent if the code has no entitlements, or they are in a different format (in which
case, see kSecCodeInfoEntitlements).
@constant kSecCodeInfoFlags A CFNumber with the static (on-disk) state of the object.
Contants are defined by the type SecCodeSignatureFlags.
@constant kSecCodeInfoFormat A CFString characterizing the type and format of
the code. Suitable for display to a (knowledeable) user.
@constant kSecCodeInfoDigestAlgorithm A CFNumber indicating the kind of cryptographic
hash function chosen to establish integrity of the signature on this system, which
is the best supported algorithm from kSecCodeInfoDigestAlgorithms.
@constant kSecCodeInfoDigestAlgorithms A CFArray of CFNumbers indicating the kinds of
cryptographic hash functions available within the signature. The ordering of those items
has no significance in terms of priority, but determines the order in which
the hashes appear in kSecCodeInfoCdHashes.
@constant kSecCodeInfoPlatformIdentifier If this code was signed as part of an operating
system release, this value identifies that release.
@constant kSecCodeInfoIdentifier A CFString with the actual signing identifier
sealed into the signature. Absent for unsigned code.
@constant kSecCodeInfoImplicitDesignatedRequirement A SecRequirement describing
the designated requirement that the system did generate, or would have generated,
for the code. If the Designated Requirement was implicitly generated, this is
the same object as kSecCodeInfoDesignatedRequirement; this can be used to test
for an explicit Designated Requirement.
@constant kSecCodeInfoMainExecutable A CFURL identifying the main executable file
of the code. For single files, that is the file itself. For bundles, it is the
main executable as identified by its Info.plist.
@constant kSecCodeInfoPList A retained CFDictionary referring to the secured Info.plist
as seen by code signing. Absent if no Info.plist is known to the code signing
subsystem. Note that this is not the same dictionary as the one CFBundle would
give you (CFBundle is free to add entries to the on-disk plist).
@constant kSecCodeInfoRequirements A CFString describing the internal requirements
of the code in canonical syntax.
@constant kSecCodeInfoRequirementsData A CFData containing the internal requirements
of the code as a binary blob.
@constant kSecCodeInfoSource A CFString describing the source of the code signature
used for the code object. The values are meant to be shown in informational
displays; do not rely on the precise value returned.
@constant kSecCodeInfoStatus A CFNumber containing the dynamic status word of the
(running) code. This is a snapshot at the time the API is executed and may be
out of date by the time you examine it. Do note however that most of the bits
are sticky and thus some values are permanently reliable. Be careful.
@constant kSecCodeInfoTime A CFDate describing the signing date (securely) embedded
in the code signature. Note that a signer is able to omit this date or pre-date
it. Nobody certifies that this was really the date the code was signed; however,
you do know that this is the date the signer wanted you to see.
Ad-hoc signatures have no CMS and thus never have secured signing dates.
@constant kSecCodeInfoTimestamp A CFDate describing the signing date as (securely)
certified by a timestamp authority service. This time cannot be falsified by the
signer; you trust the timestamp authority's word on this.
Ad-hoc signatures have no CMS and thus never have secured signing dates.
@constant kSecCodeInfoTrust The (retained) SecTrust object the system uses to
evaluate the validity of the code's signature. You may use the SecTrust API
to extract detailed information, particularly for reasons why certificate
validation may have failed. This object may continue to be used for further
evaluations of this code; if you make any changes to it, behavior is undefined.
@constant kSecCodeInfoUnique A CFData binary identifier that uniquely identifies
the static code in question. It can be used to recognize this particular code
(and none other) now or in the future. Compare to kSecCodeInfoIdentifier, which
remains stable across (developer-approved) updates.
The algorithm used may change from time to time. However, for any existing signature,
the value is stable.
@constant kSecCodeInfoCdHashes An array containing the values of the kSecCodeInfoUnique
binary identifier for every digest algorithm supported in the signature, in the same
order as in the kSecCodeInfoDigestAlgorithms array. The kSecCodeInfoUnique value
will be contained in this array, and be the one corresponding to the
kSecCodeInfoDigestAlgorithm value.
*/
CF_ENUM(uint32_t) {
kSecCSInternalInformation = 1 << 0,
kSecCSSigningInformation = 1 << 1,
kSecCSRequirementInformation = 1 << 2,
kSecCSDynamicInformation = 1 << 3,
kSecCSContentInformation = 1 << 4,
kSecCSSkipResourceDirectory = 1 << 5,
kSecCSCalculateCMSDigest = 1 << 6,
};
/* flag required to get this value */
extern const CFStringRef kSecCodeInfoCertificates; /* Signing */
extern const CFStringRef kSecCodeInfoChangedFiles; /* Content */
extern const CFStringRef kSecCodeInfoCMS; /* Signing */
extern const CFStringRef kSecCodeInfoDesignatedRequirement; /* Requirement */
extern const CFStringRef kSecCodeInfoEntitlements; /* generic */
extern const CFStringRef kSecCodeInfoEntitlementsDict; /* generic */
extern const CFStringRef kSecCodeInfoFlags; /* generic */
extern const CFStringRef kSecCodeInfoFormat; /* generic */
extern const CFStringRef kSecCodeInfoDigestAlgorithm; /* generic */
extern const CFStringRef kSecCodeInfoDigestAlgorithms; /* generic */
extern const CFStringRef kSecCodeInfoPlatformIdentifier; /* generic */
extern const CFStringRef kSecCodeInfoIdentifier; /* generic */
extern const CFStringRef kSecCodeInfoImplicitDesignatedRequirement; /* Requirement */
extern const CFStringRef kSecCodeInfoMainExecutable; /* generic */
extern const CFStringRef kSecCodeInfoPList; /* generic */
extern const CFStringRef kSecCodeInfoRequirements; /* Requirement */
extern const CFStringRef kSecCodeInfoRequirementData; /* Requirement */
extern const CFStringRef kSecCodeInfoSource; /* generic */
extern const CFStringRef kSecCodeInfoStatus; /* Dynamic */
extern const CFStringRef kSecCodeInfoTeamIdentifier; /* Signing */
extern const CFStringRef kSecCodeInfoTime; /* Signing */
extern const CFStringRef kSecCodeInfoTimestamp; /* Signing */
extern const CFStringRef kSecCodeInfoTrust; /* Signing */
extern const CFStringRef kSecCodeInfoUnique; /* generic */
extern const CFStringRef kSecCodeInfoCdHashes; /* generic */
extern const CFStringRef kSecCodeInfoRuntimeVersion; /*generic */
OSStatus SecCodeCopySigningInformation(SecStaticCodeRef code, SecCSFlags flags,
CFDictionaryRef * __nonnull CF_RETURNS_RETAINED information);
/*
@function SecCodeMapMemory
For a given Code or StaticCode object, ask the kernel to accept the signing information
currently attached to it in the caller and use it to validate memory page-ins against it,
updating dynamic validity state accordingly. This change affects all processes that have
the main executable of this code mapped.
@param code A Code or StaticCode object representing the signed code whose main executable
should be subject to page-in validation.
@param flags Optional flags. Pass kSecCSDefaultFlags for standard behavior.
*/
OSStatus SecCodeMapMemory(SecStaticCodeRef code, SecCSFlags flags);
CF_ASSUME_NONNULL_END
#ifdef __cplusplus
}
#endif
#endif //_H_SECCODE
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecPolicy.h | /*
* Copyright (c) 2002-2016 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
@header SecPolicy
The functions provided in SecPolicy.h provide an interface to various
X.509 certificate trust policies.
*/
#ifndef _SECURITY_SECPOLICY_H_
#define _SECURITY_SECPOLICY_H_
#include <CoreFoundation/CFBase.h>
#include <CoreFoundation/CFDictionary.h>
#include <Security/SecBase.h>
__BEGIN_DECLS
CF_ASSUME_NONNULL_BEGIN
CF_IMPLICIT_BRIDGING_ENABLED
/*!
@enum Policy Constants
@discussion Predefined constants used to specify a policy.
@constant kSecPolicyAppleX509Basic
@constant kSecPolicyAppleSSL
@constant kSecPolicyAppleSMIME
@constant kSecPolicyAppleEAP
@constant kSecPolicyAppleiChat
@constant kSecPolicyAppleIPsec
@constant kSecPolicyApplePKINITClient
@constant kSecPolicyApplePKINITServer
@constant kSecPolicyAppleCodeSigning
@constant kSecPolicyMacAppStoreReceipt
@constant kSecPolicyAppleIDValidation
@constant kSecPolicyAppleTimeStamping
@constant kSecPolicyAppleRevocation
@constant kSecPolicyApplePassbookSigning
@constant kSecPolicyApplePayIssuerEncryption
*/
extern const CFStringRef kSecPolicyAppleX509Basic
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_7_0);
extern const CFStringRef kSecPolicyAppleSSL
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_7_0);
extern const CFStringRef kSecPolicyAppleSMIME
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_7_0);
extern const CFStringRef kSecPolicyAppleEAP
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_7_0);
extern const CFStringRef kSecPolicyAppleIPsec
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_7_0);
#if TARGET_OS_OSX
extern const CFStringRef kSecPolicyAppleiChat
__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_7, __MAC_10_9, __IPHONE_NA, __IPHONE_NA);
#endif
extern const CFStringRef kSecPolicyApplePKINITClient
API_AVAILABLE(macos(10.7)) API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
extern const CFStringRef kSecPolicyApplePKINITServer
API_AVAILABLE(macos(10.7)) API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
extern const CFStringRef kSecPolicyAppleCodeSigning
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_7_0);
extern const CFStringRef kSecPolicyMacAppStoreReceipt
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_9_0);
extern const CFStringRef kSecPolicyAppleIDValidation
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_7_0);
extern const CFStringRef kSecPolicyAppleTimeStamping
__OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_7_0);
extern const CFStringRef kSecPolicyAppleRevocation
__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
extern const CFStringRef kSecPolicyApplePassbookSigning
__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
extern const CFStringRef kSecPolicyApplePayIssuerEncryption
__OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_9_0);
/*!
@enum Policy Value Constants
@abstract Predefined property key constants used to get or set values in
a dictionary for a policy instance.
@discussion
All policies will have the following read-only value:
kSecPolicyOid (the policy object identifier)
Additional policy values which your code can optionally set:
kSecPolicyName (name which must be matched)
kSecPolicyClient (evaluate for client, rather than server)
kSecPolicyRevocationFlags (only valid for a revocation policy)
kSecPolicyTeamIdentifier (only valid for a Passbook signing policy)
@constant kSecPolicyOid Specifies the policy OID (value is a CFStringRef)
@constant kSecPolicyName Specifies a CFStringRef (or CFArrayRef of same)
containing a name which must be matched in the certificate to satisfy
this policy. For SSL/TLS, EAP, and IPSec policies, this specifies the
server name which must match the common name of the certificate.
For S/MIME, this specifies the RFC822 email address. For Passbook
signing, this specifies the pass signer.
@constant kSecPolicyClient Specifies a CFBooleanRef value that indicates
this evaluation should be for a client certificate. If not set (or
false), the policy evaluates the certificate as a server certificate.
@constant kSecPolicyRevocationFlags Specifies a CFNumberRef that holds a
kCFNumberCFIndexType bitmask value. See "Revocation Policy Constants"
for a description of individual bits in this value.
@constant kSecPolicyTeamIdentifier Specifies a CFStringRef containing a
team identifier which must be matched in the certificate to satisfy
this policy. For the Passbook signing policy, this string must match
the Organizational Unit field of the certificate subject.
*/
extern const CFStringRef kSecPolicyOid
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_7_0);
extern const CFStringRef kSecPolicyName
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_7_0);
extern const CFStringRef kSecPolicyClient
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_7_0);
extern const CFStringRef kSecPolicyRevocationFlags
__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
extern const CFStringRef kSecPolicyTeamIdentifier
__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
/*!
@function SecPolicyGetTypeID
@abstract Returns the type identifier of SecPolicy instances.
@result The CFTypeID of SecPolicy instances.
*/
CFTypeID SecPolicyGetTypeID(void)
__OSX_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_2_0);
/*!
@function SecPolicyCopyProperties
@abstract Returns a dictionary of this policy's properties.
@param policyRef A policy reference.
@result A properties dictionary. See "Policy Value Constants" for a list
of currently defined property keys. It is the caller's responsibility to
CFRelease this reference when it is no longer needed.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This function returns the properties for a policy, as set by the
policy's construction function or by a prior call to SecPolicySetProperties.
*/
__nullable
CFDictionaryRef SecPolicyCopyProperties(SecPolicyRef policyRef)
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_7_0);
/*!
@function SecPolicyCreateBasicX509
@abstract Returns a policy object for the default X.509 policy.
@result A policy object. The caller is responsible for calling CFRelease
on this when it is no longer needed.
*/
SecPolicyRef SecPolicyCreateBasicX509(void)
__OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_2_0);
/*!
@function SecPolicyCreateSSL
@abstract Returns a policy object for evaluating SSL certificate chains.
@param server Passing true for this parameter creates a policy for SSL
server certificates.
@param hostname (Optional) If present, the policy will require the specified
hostname to match the hostname in the leaf certificate.
@result A policy object. The caller is responsible for calling CFRelease
on this when it is no longer needed.
*/
SecPolicyRef SecPolicyCreateSSL(Boolean server, CFStringRef __nullable hostname)
__OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_2_0);
/*!
@enum Revocation Policy Constants
@abstract Predefined constants which allow you to specify how revocation
checking will be performed for a trust evaluation.
@constant kSecRevocationOCSPMethod If this flag is set, perform revocation
checking using OCSP (Online Certificate Status Protocol).
@constant kSecRevocationCRLMethod If this flag is set, perform revocation
checking using the CRL (Certificate Revocation List) method.
@constant kSecRevocationPreferCRL If this flag is set, then CRL revocation
checking will be preferred over OCSP (by default, OCSP is preferred.)
Note that this flag only matters if both revocation methods are specified.
@constant kSecRevocationRequirePositiveResponse If this flag is set, then
the policy will fail unless a verified positive response is obtained. If
the flag is not set, revocation checking is done on a "best attempt" basis,
where failure to reach the server is not considered fatal.
@constant kSecRevocationNetworkAccessDisabled If this flag is set, then
no network access is performed; only locally cached replies are consulted.
This constant disallows network access for both revocation checks and
intermediate CA issuer fetching.
@constant kSecRevocationUseAnyAvailableMethod Specifies that either
OCSP or CRL may be used, depending on the method(s) specified in the
certificate and the value of kSecRevocationPreferCRL.
*/
CF_ENUM(CFOptionFlags) {
kSecRevocationOCSPMethod = (1 << 0),
kSecRevocationCRLMethod = (1 << 1),
kSecRevocationPreferCRL = (1 << 2),
kSecRevocationRequirePositiveResponse = (1 << 3),
kSecRevocationNetworkAccessDisabled = (1 << 4),
kSecRevocationUseAnyAvailableMethod = (kSecRevocationOCSPMethod |
kSecRevocationCRLMethod)
};
/*!
@function SecPolicyCreateRevocation
@abstract Returns a policy object for checking revocation of certificates.
@result A policy object. The caller is responsible for calling CFRelease
on this when it is no longer needed.
@param revocationFlags Flags to specify revocation checking options.
@discussion Use this function to create a revocation policy with behavior
specified by revocationFlags. See the "Revocation Policy Constants" section
for a description of these flags. Note: it is usually not necessary to
create a revocation policy yourself unless you wish to override default
system behavior (e.g. to force a particular method, or to disable
revocation checking entirely.)
*/
__nullable
SecPolicyRef SecPolicyCreateRevocation(CFOptionFlags revocationFlags)
__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
/*!
@function SecPolicyCreateWithProperties
@abstract Returns a policy object based on an object identifier for the
policy type. See the "Policy Constants" section for a list of defined
policy object identifiers.
@param policyIdentifier The identifier for the desired policy type.
@param properties (Optional) A properties dictionary. See "Policy Value
Constants" for a list of currently defined property keys.
@result The returned policy reference, or NULL if the policy could not be
created.
*/
__nullable
SecPolicyRef SecPolicyCreateWithProperties(CFTypeRef policyIdentifier,
CFDictionaryRef __nullable properties)
__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
CF_IMPLICIT_BRIDGING_DISABLED
CF_ASSUME_NONNULL_END
/*
* Legacy functions (OS X only)
*/
#if TARGET_OS_OSX
#include <Security/cssmtype.h>
CF_ASSUME_NONNULL_BEGIN
CF_IMPLICIT_BRIDGING_ENABLED
/*!
@enum Policy Value Constants (OS X)
@discussion Predefined property key constants used to get or set values in
a dictionary for a policy instance.
Some policy values may specify CFBooleanRef key usage constraints:
kSecPolicyKU_DigitalSignature
kSecPolicyKU_NonRepudiation
kSecPolicyKU_KeyEncipherment
kSecPolicyKU_DataEncipherment
kSecPolicyKU_KeyAgreement
kSecPolicyKU_KeyCertSign
kSecPolicyKU_CRLSign
kSecPolicyKU_EncipherOnly
kSecPolicyKU_DecipherOnly
kSecPolicyKU policy values define certificate-level key purposes,
in contrast to the key-level definitions in SecItem.h
For example, a key in a certificate might be acceptable to use for
signing a CRL, but not for signing another certificate. In either
case, this key would have the ability to sign (i.e. kSecAttrCanSign
is true), but may only sign for specific purposes allowed by these
policy constants. Similarly, a public key might have the capability
to perform encryption or decryption, but the certificate in which it
resides might have a decipher-only certificate policy.
These constants correspond to values defined in RFC 5280, section
4.2.1.3 (Key Usage) which define the purpose of a key contained in a
certificate, in contrast to section 4.1.2.7 which define the uses that
a key is capable of.
Note: these constants are not available on iOS. Your code should
avoid direct reliance on these values for making policy decisions
and use higher level policies where possible.
@constant kSecPolicyKU_DigitalSignature Specifies that the certificate must
have a key usage that allows it to be used for signing.
@constant kSecPolicyKU_NonRepudiation Specifies that the certificate must
have a key usage that allows it to be used for non-repudiation.
@constant kSecPolicyKU_KeyEncipherment Specifies that the certificate must
have a key usage that allows it to be used for key encipherment.
@constant kSecPolicyKU_DataEncipherment Specifies that the certificate must
have a key usage that allows it to be used for data encipherment.
@constant kSecPolicyKU_KeyAgreement Specifies that the certificate must
have a key usage that allows it to be used for key agreement.
@constant kSecPolicyKU_KeyCertSign Specifies that the certificate must
have a key usage that allows it to be used for signing certificates.
@constant kSecPolicyKU_CRLSign Specifies that the certificate must
have a key usage that allows it to be used for signing CRLs.
@constant kSecPolicyKU_EncipherOnly Specifies that the certificate must
have a key usage that permits it to be used for encryption only.
@constant kSecPolicyKU_DecipherOnly Specifies that the certificate must
have a key usage that permits it to be used for decryption only.
*/
extern const CFStringRef kSecPolicyKU_DigitalSignature
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecPolicyKU_NonRepudiation
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecPolicyKU_KeyEncipherment
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecPolicyKU_DataEncipherment
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecPolicyKU_KeyAgreement
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecPolicyKU_KeyCertSign
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecPolicyKU_CRLSign
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecPolicyKU_EncipherOnly
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecPolicyKU_DecipherOnly
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
/*!
@function SecPolicyCreateWithOID
@abstract Returns a policy object based on an object identifier for the
policy type. See the "Policy Constants" section for a list of defined
policy object identifiers.
@param policyOID The OID of the desired policy.
@result The returned policy reference, or NULL if the policy could not be
created.
@discussion This function is deprecated in Mac OS X 10.9 and later;
use SecPolicyCreateWithProperties (or a more specific policy creation
function) instead.
*/
__nullable
SecPolicyRef SecPolicyCreateWithOID(CFTypeRef policyOID)
__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_7, __MAC_10_9, __IPHONE_NA, __IPHONE_NA);
/*!
@function SecPolicyGetOID
@abstract Returns a policy's object identifier.
@param policyRef A policy reference.
@param oid On return, a pointer to the policy's object identifier.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This function is deprecated in Mac OS X 10.7 and later;
use SecPolicyCopyProperties instead.
*/
OSStatus SecPolicyGetOID(SecPolicyRef policyRef, CSSM_OID *oid)
__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_7, __IPHONE_NA, __IPHONE_NA);
/*!
@function SecPolicyGetValue
@abstract Returns a policy's value.
@param policyRef A policy reference.
@param value On return, a pointer to the policy's value.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This function is deprecated in Mac OS X 10.7 and later;
use SecPolicyCopyProperties instead.
*/
OSStatus SecPolicyGetValue(SecPolicyRef policyRef, CSSM_DATA *value)
__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_7, __IPHONE_NA, __IPHONE_NA);
/*!
@function SecPolicySetValue
@abstract Sets a policy's value.
@param policyRef A policy reference.
@param value The value to be set into the policy object, replacing any
previous value.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This function is deprecated in Mac OS X 10.7 and later. Policy
instances should be considered read-only; in cases where your code would
consider changing properties of a policy, it should instead create a new
policy instance with the desired properties.
*/
OSStatus SecPolicySetValue(SecPolicyRef policyRef, const CSSM_DATA *value)
__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_7, __IPHONE_NA, __IPHONE_NA);
/*!
@function SecPolicySetProperties
@abstract Sets a policy's properties.
@param policyRef A policy reference.
@param properties A properties dictionary. See "Policy Value Constants"
for a list of currently defined property keys. This dictionary replaces the
policy's existing properties, if any. Note that the policy OID (specified
by kSecPolicyOid) is a read-only property of the policy and cannot be set.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This function is deprecated in Mac OS X 10.9 and later. Policy
instances should be considered read-only; in cases where your code would
consider changing properties of a policy, it should instead create a new
policy instance with the desired properties.
*/
OSStatus SecPolicySetProperties(SecPolicyRef policyRef,
CFDictionaryRef properties)
__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_7, __MAC_10_9, __IPHONE_NA, __IPHONE_NA);
/*!
@function SecPolicyGetTPHandle
@abstract Returns the CSSM trust policy handle for the given policy.
@param policyRef A policy reference.
@param tpHandle On return, a pointer to a value of type CSSM_TP_HANDLE.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This function is deprecated in Mac OS X 10.7 and later.
*/
OSStatus SecPolicyGetTPHandle(SecPolicyRef policyRef, CSSM_TP_HANDLE *tpHandle)
__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_7, __IPHONE_NA, __IPHONE_NA);
CF_IMPLICIT_BRIDGING_DISABLED
CF_ASSUME_NONNULL_END
#endif /* TARGET_OS_MAC && !TARGET_OS_IPHONE */
__END_DECLS
#endif /* !_SECURITY_SECPOLICY_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/oidsalg.h | /*
* Copyright (c) 1999-2004,2008-2015 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*
* oidsalg.h -- OIDs defining crypto algorithms
*/
#ifndef _OIDS_ALG_H_
#define _OIDS_ALG_H_
#include <Security/SecAsn1Types.h>
#ifdef __cplusplus
extern "C" {
#endif
extern const SecAsn1Oid
CSSMOID_MD2 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_MD4 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_MD5 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_RSA DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_MD2WithRSA DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_MD4WithRSA DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_MD5WithRSA DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_SHA1WithRSA DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_SHA224WithRSA DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_SHA256WithRSA DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_SHA384WithRSA DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_SHA512WithRSA DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_SHA1WithRSA_OIW DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_RSAWithOAEP DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_OAEP_MGF1 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_OAEP_ID_PSPECIFIED DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_DES_CBC DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ANSI_DH_PUB_NUMBER DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ANSI_DH_STATIC DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ANSI_DH_ONE_FLOW DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ANSI_DH_EPHEM DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ANSI_DH_HYBRID1 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ANSI_DH_HYBRID2 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ANSI_DH_HYBRID_ONEFLOW DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ANSI_MQV1 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ANSI_MQV2 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ANSI_DH_STATIC_SHA1 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ANSI_DH_ONE_FLOW_SHA1 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ANSI_DH_EPHEM_SHA1 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ANSI_DH_HYBRID1_SHA1 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ANSI_DH_HYBRID2_SHA1 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ANSI_MQV1_SHA1 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ANSI_MQV2_SHA1 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKCS3 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_DH DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_DSA DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, // BSAFE only
CSSMOID_DSA_CMS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, // X509/CMS
CSSMOID_DSA_JDK DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, // JDK 1.1
CSSMOID_SHA1WithDSA DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, // BSAFE
CSSMOID_SHA1WithDSA_CMS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, // X509/CMS
CSSMOID_SHA1WithDSA_JDK DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, // JDK 1.1
CSSMOID_SHA1 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_SHA224 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_SHA256 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_SHA384 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_SHA512 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ecPublicKey DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ECDSA_WithSHA1 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ECDSA_WithSHA224 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ECDSA_WithSHA256 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ECDSA_WithSHA384 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ECDSA_WithSHA512 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_ECDSA_WithSpecified DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_ISIGN DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_X509_BASIC DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_TP_SSL DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_TP_LOCAL_CERT_GEN DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_TP_CSR_GEN DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_TP_REVOCATION_CRL DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_TP_REVOCATION_OCSP DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_TP_SMIME DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_TP_EAP DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_TP_CODE_SIGN DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_TP_SW_UPDATE_SIGNING DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_TP_IP_SEC DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_TP_ICHAT DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_TP_RESOURCE_SIGN DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_TP_PKINIT_CLIENT DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_TP_PKINIT_SERVER DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_TP_CODE_SIGNING DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_TP_PACKAGE_SIGNING DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_TP_MACAPPSTORE_RECEIPT DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_TP_APPLEID_SHARING DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_TP_TIMESTAMPING DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_TP_REVOCATION DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_TP_PASSBOOK_SIGNING DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_TP_MOBILE_STORE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_TP_ESCROW_SERVICE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_TP_PROFILE_SIGNING DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_TP_QA_PROFILE_SIGNING DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_TP_TEST_MOBILE_STORE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_TP_PCS_ESCROW_SERVICE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_TP_PROVISIONING_PROFILE_SIGNING DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_FEE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_ASC DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_FEE_MD5 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_FEE_SHA1 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_FEED DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_FEEDEXP DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_APPLE_ECDSA DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_DOTMAC_CERT DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_DOTMAC_CERT_REQ DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_DOTMAC_CERT_REQ_IDENTITY DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_DOTMAC_CERT_REQ_EMAIL_SIGN DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_DOTMAC_CERT_REQ_EMAIL_ENCRYPT DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_DOTMAC_CERT_REQ_ARCHIVE_LIST DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_DOTMAC_CERT_REQ_ARCHIVE_STORE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_DOTMAC_CERT_REQ_ARCHIVE_FETCH DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_DOTMAC_CERT_REQ_ARCHIVE_REMOVE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_DOTMAC_CERT_REQ_SHARED_SERVICES DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_DOTMAC_CERT_REQ_VALUE_USERNAME DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_DOTMAC_CERT_REQ_VALUE_PASSWORD DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_DOTMAC_CERT_REQ_VALUE_HOSTNAME DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_DOTMAC_CERT_REQ_VALUE_RENEW DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_DOTMAC_CERT_REQ_VALUE_ASYNC DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_DOTMAC_CERT_REQ_VALUE_IS_PENDING DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKCS5_DIGEST_ALG DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKCS5_ENCRYPT_ALG DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKCS5_HMAC_SHA1 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKCS5_pbeWithMD2AndDES DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKCS5_pbeWithMD2AndRC2 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKCS5_pbeWithMD5AndDES DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKCS5_pbeWithMD5AndRC2 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKCS5_pbeWithSHA1AndDES DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKCS5_pbeWithSHA1AndRC2 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKCS5_PBKDF2 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKCS5_PBES2 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKCS5_PBMAC1 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKCS5_RC2_CBC DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKCS5_DES_EDE3_CBC DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKCS5_RC5_CBC DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKCS12_pbeWithSHAAnd128BitRC4 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKCS12_pbeWithSHAAnd40BitRC4 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKCS12_pbeWithSHAAnd3Key3DESCBC DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKCS12_pbeWithSHAAnd2Key3DESCBC DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKCS12_pbeWithSHAAnd128BitRC2CBC DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER,
CSSMOID_PKCS12_pbewithSHAAnd40BitRC2CBC DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
#ifdef __cplusplus
}
#endif
#endif /* _OIDS_ALG_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/cssmcspi.h | /*
* Copyright (c) 1999-2001,2004,2011,2014 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*
* cssmcspi.h -- Service Provider Interface for
* Cryptographic Service Provider Modules
*/
#ifndef _CSSMCSPI_H_
#define _CSSMCSPI_H_ 1
#include <Security/cssmspi.h>
#ifdef __cplusplus
extern "C" {
#endif
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_spi_csp_funcs {
CSSM_RETURN (CSSMCSPI *EventNotify)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CONTEXT_EVENT Event,
CSSM_CC_HANDLE CCHandle,
const CSSM_CONTEXT *Context);
CSSM_RETURN (CSSMCSPI *QuerySize)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_CONTEXT *Context,
CSSM_BOOL Encrypt,
uint32 QuerySizeCount,
CSSM_QUERY_SIZE_DATA_PTR DataBlock);
CSSM_RETURN (CSSMCSPI *SignData)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_CONTEXT *Context,
const CSSM_DATA *DataBufs,
uint32 DataBufCount,
CSSM_ALGORITHMS DigestAlgorithm,
CSSM_DATA_PTR Signature);
CSSM_RETURN (CSSMCSPI *SignDataInit)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_CONTEXT *Context);
CSSM_RETURN (CSSMCSPI *SignDataUpdate)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *DataBufs,
uint32 DataBufCount);
CSSM_RETURN (CSSMCSPI *SignDataFinal)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
CSSM_DATA_PTR Signature);
CSSM_RETURN (CSSMCSPI *VerifyData)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_CONTEXT *Context,
const CSSM_DATA *DataBufs,
uint32 DataBufCount,
CSSM_ALGORITHMS DigestAlgorithm,
const CSSM_DATA *Signature);
CSSM_RETURN (CSSMCSPI *VerifyDataInit)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_CONTEXT *Context);
CSSM_RETURN (CSSMCSPI *VerifyDataUpdate)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *DataBufs,
uint32 DataBufCount);
CSSM_RETURN (CSSMCSPI *VerifyDataFinal)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *Signature);
CSSM_RETURN (CSSMCSPI *DigestData)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_CONTEXT *Context,
const CSSM_DATA *DataBufs,
uint32 DataBufCount,
CSSM_DATA_PTR Digest);
CSSM_RETURN (CSSMCSPI *DigestDataInit)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_CONTEXT *Context);
CSSM_RETURN (CSSMCSPI *DigestDataUpdate)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *DataBufs,
uint32 DataBufCount);
CSSM_RETURN (CSSMCSPI *DigestDataClone)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
CSSM_CC_HANDLE ClonedCCHandle);
CSSM_RETURN (CSSMCSPI *DigestDataFinal)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
CSSM_DATA_PTR Digest);
CSSM_RETURN (CSSMCSPI *GenerateMac)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_CONTEXT *Context,
const CSSM_DATA *DataBufs,
uint32 DataBufCount,
CSSM_DATA_PTR Mac);
CSSM_RETURN (CSSMCSPI *GenerateMacInit)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_CONTEXT *Context);
CSSM_RETURN (CSSMCSPI *GenerateMacUpdate)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *DataBufs,
uint32 DataBufCount);
CSSM_RETURN (CSSMCSPI *GenerateMacFinal)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
CSSM_DATA_PTR Mac);
CSSM_RETURN (CSSMCSPI *VerifyMac)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_CONTEXT *Context,
const CSSM_DATA *DataBufs,
uint32 DataBufCount,
const CSSM_DATA *Mac);
CSSM_RETURN (CSSMCSPI *VerifyMacInit)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_CONTEXT *Context);
CSSM_RETURN (CSSMCSPI *VerifyMacUpdate)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *DataBufs,
uint32 DataBufCount);
CSSM_RETURN (CSSMCSPI *VerifyMacFinal)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *Mac);
CSSM_RETURN (CSSMCSPI *EncryptData)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_CONTEXT *Context,
const CSSM_DATA *ClearBufs,
uint32 ClearBufCount,
CSSM_DATA_PTR CipherBufs,
uint32 CipherBufCount,
CSSM_SIZE *bytesEncrypted,
CSSM_DATA_PTR RemData,
CSSM_PRIVILEGE Privilege);
CSSM_RETURN (CSSMCSPI *EncryptDataInit)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_CONTEXT *Context,
CSSM_PRIVILEGE Privilege);
CSSM_RETURN (CSSMCSPI *EncryptDataUpdate)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *ClearBufs,
uint32 ClearBufCount,
CSSM_DATA_PTR CipherBufs,
uint32 CipherBufCount,
CSSM_SIZE *bytesEncrypted);
CSSM_RETURN (CSSMCSPI *EncryptDataFinal)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
CSSM_DATA_PTR RemData);
CSSM_RETURN (CSSMCSPI *DecryptData)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_CONTEXT *Context,
const CSSM_DATA *CipherBufs,
uint32 CipherBufCount,
CSSM_DATA_PTR ClearBufs,
uint32 ClearBufCount,
CSSM_SIZE *bytesDecrypted,
CSSM_DATA_PTR RemData,
CSSM_PRIVILEGE Privilege);
CSSM_RETURN (CSSMCSPI *DecryptDataInit)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_CONTEXT *Context,
CSSM_PRIVILEGE Privilege);
CSSM_RETURN (CSSMCSPI *DecryptDataUpdate)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *CipherBufs,
uint32 CipherBufCount,
CSSM_DATA_PTR ClearBufs,
uint32 ClearBufCount,
CSSM_SIZE *bytesDecrypted);
CSSM_RETURN (CSSMCSPI *DecryptDataFinal)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
CSSM_DATA_PTR RemData);
CSSM_RETURN (CSSMCSPI *QueryKeySizeInBits)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_CONTEXT *Context,
const CSSM_KEY *Key,
CSSM_KEY_SIZE_PTR KeySize);
CSSM_RETURN (CSSMCSPI *GenerateKey)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_CONTEXT *Context,
uint32 KeyUsage,
uint32 KeyAttr,
const CSSM_DATA *KeyLabel,
const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry,
CSSM_KEY_PTR Key,
CSSM_PRIVILEGE Privilege);
CSSM_RETURN (CSSMCSPI *GenerateKeyPair)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_CONTEXT *Context,
uint32 PublicKeyUsage,
uint32 PublicKeyAttr,
const CSSM_DATA *PublicKeyLabel,
CSSM_KEY_PTR PublicKey,
uint32 PrivateKeyUsage,
uint32 PrivateKeyAttr,
const CSSM_DATA *PrivateKeyLabel,
const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry,
CSSM_KEY_PTR PrivateKey,
CSSM_PRIVILEGE Privilege);
CSSM_RETURN (CSSMCSPI *GenerateRandom)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_CONTEXT *Context,
CSSM_DATA_PTR RandomNumber);
CSSM_RETURN (CSSMCSPI *GenerateAlgorithmParams)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_CONTEXT *Context,
uint32 ParamBits,
CSSM_DATA_PTR Param,
uint32 *NumberOfUpdatedAttibutes,
CSSM_CONTEXT_ATTRIBUTE_PTR *UpdatedAttributes);
CSSM_RETURN (CSSMCSPI *WrapKey)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_CONTEXT *Context,
const CSSM_ACCESS_CREDENTIALS *AccessCred,
const CSSM_KEY *Key,
const CSSM_DATA *DescriptiveData,
CSSM_WRAP_KEY_PTR WrappedKey,
CSSM_PRIVILEGE Privilege);
CSSM_RETURN (CSSMCSPI *UnwrapKey)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_CONTEXT *Context,
const CSSM_KEY *PublicKey,
const CSSM_WRAP_KEY *WrappedKey,
uint32 KeyUsage,
uint32 KeyAttr,
const CSSM_DATA *KeyLabel,
const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry,
CSSM_KEY_PTR UnwrappedKey,
CSSM_DATA_PTR DescriptiveData,
CSSM_PRIVILEGE Privilege);
CSSM_RETURN (CSSMCSPI *DeriveKey)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_CONTEXT *Context,
CSSM_DATA_PTR Param,
uint32 KeyUsage,
uint32 KeyAttr,
const CSSM_DATA *KeyLabel,
const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry,
CSSM_KEY_PTR DerivedKey);
CSSM_RETURN (CSSMCSPI *FreeKey)
(CSSM_CSP_HANDLE CSPHandle,
const CSSM_ACCESS_CREDENTIALS *AccessCred,
CSSM_KEY_PTR KeyPtr,
CSSM_BOOL Delete);
CSSM_RETURN (CSSMCSPI *PassThrough)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_CONTEXT *Context,
uint32 PassThroughId,
const void *InData,
void **OutData);
CSSM_RETURN (CSSMCSPI *Login)
(CSSM_CSP_HANDLE CSPHandle,
const CSSM_ACCESS_CREDENTIALS *AccessCred,
const CSSM_DATA *LoginName,
const void *Reserved);
CSSM_RETURN (CSSMCSPI *Logout)
(CSSM_CSP_HANDLE CSPHandle);
CSSM_RETURN (CSSMCSPI *ChangeLoginAcl)
(CSSM_CSP_HANDLE CSPHandle,
const CSSM_ACCESS_CREDENTIALS *AccessCred,
const CSSM_ACL_EDIT *AclEdit);
CSSM_RETURN (CSSMCSPI *ObtainPrivateKeyFromPublicKey)
(CSSM_CSP_HANDLE CSPHandle,
const CSSM_KEY *PublicKey,
CSSM_KEY_PTR PrivateKey);
CSSM_RETURN (CSSMCSPI *RetrieveUniqueId)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_DATA_PTR UniqueID);
CSSM_RETURN (CSSMCSPI *RetrieveCounter)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_DATA_PTR Counter);
CSSM_RETURN (CSSMCSPI *VerifyDevice)
(CSSM_CSP_HANDLE CSPHandle,
const CSSM_DATA *DeviceCert);
CSSM_RETURN (CSSMCSPI *GetTimeValue)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_ALGORITHMS TimeAlgorithm,
CSSM_DATA *TimeData);
CSSM_RETURN (CSSMCSPI *GetOperationalStatistics)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_CSP_OPERATIONAL_STATISTICS *Statistics);
CSSM_RETURN (CSSMCSPI *GetLoginAcl)
(CSSM_CSP_HANDLE CSPHandle,
const CSSM_STRING *SelectionTag,
uint32 *NumberOfAclInfos,
CSSM_ACL_ENTRY_INFO_PTR *AclInfos);
CSSM_RETURN (CSSMCSPI *GetKeyAcl)
(CSSM_CSP_HANDLE CSPHandle,
const CSSM_KEY *Key,
const CSSM_STRING *SelectionTag,
uint32 *NumberOfAclInfos,
CSSM_ACL_ENTRY_INFO_PTR *AclInfos);
CSSM_RETURN (CSSMCSPI *ChangeKeyAcl)
(CSSM_CSP_HANDLE CSPHandle,
const CSSM_ACCESS_CREDENTIALS *AccessCred,
const CSSM_ACL_EDIT *AclEdit,
const CSSM_KEY *Key);
CSSM_RETURN (CSSMCSPI *GetKeyOwner)
(CSSM_CSP_HANDLE CSPHandle,
const CSSM_KEY *Key,
CSSM_ACL_OWNER_PROTOTYPE_PTR Owner);
CSSM_RETURN (CSSMCSPI *ChangeKeyOwner)
(CSSM_CSP_HANDLE CSPHandle,
const CSSM_ACCESS_CREDENTIALS *AccessCred,
const CSSM_KEY *Key,
const CSSM_ACL_OWNER_PROTOTYPE *NewOwner);
CSSM_RETURN (CSSMCSPI *GetLoginOwner)
(CSSM_CSP_HANDLE CSPHandle,
CSSM_ACL_OWNER_PROTOTYPE_PTR Owner);
CSSM_RETURN (CSSMCSPI *ChangeLoginOwner)
(CSSM_CSP_HANDLE CSPHandle,
const CSSM_ACCESS_CREDENTIALS *AccessCred,
const CSSM_ACL_OWNER_PROTOTYPE *NewOwner);
} CSSM_SPI_CSP_FUNCS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_SPI_CSP_FUNCS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
#pragma clang diagnostic pop
#ifdef __cplusplus
}
#endif
#endif /* _CSSMCSPI_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/emmspi.h | /*
* Copyright (c) 1999-2001,2004,2011,2014 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*
* emmspi.h -- Service Provider Interface for Elective Module Managers
*/
#ifndef _EMMSPI_H_
#define _EMMSPI_H_ 1
#include <Security/cssmtype.h>
#include <Security/emmtype.h> /* CSSM_MANAGER_EVENT_NOTIFICATION */
#include <Security/cssmspi.h> /* CSSM_UPCALLS_PTR */
#ifdef __cplusplus
extern "C" {
#endif
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_state_funcs {
CSSM_RETURN (CSSMAPI *cssm_GetAttachFunctions)
(CSSM_MODULE_HANDLE hAddIn,
CSSM_SERVICE_MASK AddinType,
void **SPFunctions,
CSSM_GUID_PTR Guid,
CSSM_BOOL *Serialized);
CSSM_RETURN (CSSMAPI *cssm_ReleaseAttachFunctions)
(CSSM_MODULE_HANDLE hAddIn);
CSSM_RETURN (CSSMAPI *cssm_GetAppMemoryFunctions)
(CSSM_MODULE_HANDLE hAddIn,
CSSM_UPCALLS_PTR UpcallTable);
CSSM_RETURN (CSSMAPI *cssm_IsFuncCallValid)
(CSSM_MODULE_HANDLE hAddin,
CSSM_PROC_ADDR SrcAddress,
CSSM_PROC_ADDR DestAddress,
CSSM_PRIVILEGE InPriv,
CSSM_PRIVILEGE *OutPriv,
CSSM_BITMASK Hints,
CSSM_BOOL *IsOK);
CSSM_RETURN (CSSMAPI *cssm_DeregisterManagerServices)
(const CSSM_GUID *GUID);
CSSM_RETURN (CSSMAPI *cssm_DeliverModuleManagerEvent)
(const CSSM_MANAGER_EVENT_NOTIFICATION *EventDescription);
} CSSM_STATE_FUNCS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_STATE_FUNCS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_manager_registration_info {
/* loading, unloading, dispatch table, and event notification */
CSSM_RETURN (CSSMAPI *Initialize)
(uint32 VerMajor,
uint32 VerMinor);
CSSM_RETURN (CSSMAPI *Terminate) (void);
CSSM_RETURN (CSSMAPI *RegisterDispatchTable)
(CSSM_STATE_FUNCS_PTR CssmStateCallTable);
CSSM_RETURN (CSSMAPI *DeregisterDispatchTable) (void);
CSSM_RETURN (CSSMAPI *EventNotifyManager)
(const CSSM_MANAGER_EVENT_NOTIFICATION *EventDescription);
CSSM_RETURN (CSSMAPI *RefreshFunctionTable)
(CSSM_FUNC_NAME_ADDR_PTR FuncNameAddrPtr,
uint32 NumOfFuncNameAddr);
} CSSM_MANAGER_REGISTRATION_INFO DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_MANAGER_REGISTRATION_INFO_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
enum {
CSSM_HINT_NONE = 0,
CSSM_HINT_ADDRESS_APP = 1 << 0,
CSSM_HINT_ADDRESS_SP = 1 << 1
};
#pragma clang diagnostic pop
#ifdef __cplusplus
}
#endif
#endif /* _EMMSPI_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecDecodeTransform.h | #ifndef __SECDECODETRANSFORM_H__
#define __SECDECODETRANSFORM_H__
/*
* Copyright (c) 2010-2011 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#include <Security/SecEncodeTransform.h>
#ifdef __cplusplus
extern "C" {
#endif
CF_ASSUME_NONNULL_BEGIN
CF_IMPLICIT_BRIDGING_ENABLED
/*!
@constant kSecDecodeTypeAttribute
Used with SecTransformGetAttribute to query the attribute type.
Returns one of the strings defined in the previous section.
*/
extern const CFStringRef kSecDecodeTypeAttribute;
/*!
@function SecDecodeTransformCreate
@abstract Creates an decode computation object.
@param DecodeType The type of digest to decode. You may pass NULL
for this parameter, in which case an appropriate
algorithm will be chosen for you.
@param error A pointer to a CFErrorRef. This pointer will be set
if an error occurred. This value may be NULL if you
do not want an error returned.
@result A pointer to a SecTransformRef object. This object must
be released with CFRelease when you are done with
it. This function will return NULL if an error
occurred.
@discussion This function creates a transform which computes a
decode.
*/
// See SecEncodeTransformCreate for encoding...
__nullable
SecTransformRef SecDecodeTransformCreate(CFTypeRef DecodeType,
CFErrorRef* error
)
__OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_NA);
CF_IMPLICIT_BRIDGING_DISABLED
CF_ASSUME_NONNULL_END
#ifdef __cplusplus
}
#endif
#endif
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecureTransport.h | /*
* Copyright (c) 1999-2002,2005-2019 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
* SecureTransport.h - Public API for Apple SSL/TLS Implementation
*/
#ifndef _SECURITY_SECURETRANSPORT_H_
#define _SECURITY_SECURETRANSPORT_H_
/*
* This file describes the public API for an implementation of the
* Secure Socket Layer, V. 3.0, Transport Layer Security, V. 1.0 to V. 1.2
* and Datagram Transport Layer Security V. 1.0
*
* There are no transport layer dependencies in this library;
* it can be used with sockets, Open Transport, etc. Applications using
* this library provide callback functions which do the actual I/O
* on underlying network connections. Applications are also responsible
* for setting up raw network connections; the application passes in
* an opaque reference to the underlying (connected) entity at the
* start of an SSL session in the form of an SSLConnectionRef.
*
* Some terminology:
*
* A "client" is the initiator of an SSL Session. The canonical example
* of a client is a web browser, when it's talking to an https URL.
*
* A "server" is an entity which accepts requests for SSL sessions made
* by clients. E.g., a secure web server.
* An "SSL Session", or "session", is bounded by calls to SSLHandshake()
* and SSLClose(). An "Active session" is in some state between these
* two calls, inclusive.
*
* An SSL Session Context, or SSLContextRef, is an opaque reference in this
* library to the state associated with one session. A SSLContextRef cannot
* be reused for multiple sessions.
*/
#include <CoreFoundation/CFArray.h>
#include <Security/SecProtocolOptions.h>
#include <Security/CipherSuite.h>
#include <Security/SecTrust.h>
#include <Security/SecBase.h>
#include <sys/types.h>
#include <Availability.h>
#ifdef __cplusplus
extern "C" {
#endif
CF_ASSUME_NONNULL_BEGIN
CF_IMPLICIT_BRIDGING_ENABLED
#define __SECURETRANSPORT_API_DEPRECATED(...) \
__API_DEPRECATED("No longer supported. Use Network.framework.", __VA_ARGS__)
/***********************
*** Common typedefs ***
***********************/
/* Opaque reference to an SSL session context */
struct SSLContext;
typedef struct CF_BRIDGED_TYPE(id) SSLContext *SSLContextRef;
/* Opaque reference to an I/O connection (socket, endpoint, etc.) */
typedef const void *SSLConnectionRef;
/* SSL session options */
typedef CF_ENUM(int, SSLSessionOption) {
/*
* Set this option to enable returning from SSLHandshake (with a result of
* errSSLServerAuthCompleted) when the server authentication portion of the
* handshake is complete. This disable certificate verification and
* provides an opportunity to perform application-specific server
* verification before deciding to continue.
*/
kSSLSessionOptionBreakOnServerAuth CF_ENUM_DEPRECATED(10_2, 10_15, 2_0, 13_0) = 0,
/*
* Set this option to enable returning from SSLHandshake (with a result of
* errSSLClientCertRequested) when the server requests a client certificate.
*/
kSSLSessionOptionBreakOnCertRequested CF_ENUM_DEPRECATED(10_2, 10_15, 2_0, 13_0) = 1,
/*
* This option is the same as kSSLSessionOptionBreakOnServerAuth but applies
* to the case where SecureTransport is the server and the client has presented
* its certificates allowing the server to verify whether these should be
* allowed to authenticate.
*/
kSSLSessionOptionBreakOnClientAuth CF_ENUM_DEPRECATED(10_2, 10_15, 2_0, 13_0) = 2,
/*
* Enable/Disable TLS False Start
* When enabled, False Start will only be performed if a adequate cipher-suite is
* negotiated.
*/
kSSLSessionOptionFalseStart CF_ENUM_DEPRECATED(10_2, 10_15, 2_0, 13_0) = 3,
/*
* Enable/Disable 1/n-1 record splitting for BEAST attack mitigation.
* When enabled, record splitting will only be performed for TLS 1.0 connections
* using a block cipher.
*/
kSSLSessionOptionSendOneByteRecord CF_ENUM_DEPRECATED(10_2, 10_15, 2_0, 13_0) = 4,
/*
* Allow/Disallow server identity change on renegotiation. Disallow by default
* to avoid Triple Handshake attack.
*/
kSSLSessionOptionAllowServerIdentityChange CF_ENUM_DEPRECATED(10_2, 10_15, 2_0, 13_0) = 5,
/*
* Enable fallback countermeasures. Use this option when retyring a SSL connection
* with a lower protocol version because of failure to connect.
*/
kSSLSessionOptionFallback CF_ENUM_DEPRECATED(10_2, 10_15, 2_0, 13_0) = 6,
/*
* Set this option to break from a client hello in order to check for SNI
*/
kSSLSessionOptionBreakOnClientHello CF_ENUM_DEPRECATED(10_2, 10_15, 2_0, 13_0) = 7,
/*
* Set this option to Allow renegotations. False by default.
*/
kSSLSessionOptionAllowRenegotiation CF_ENUM_DEPRECATED(10_2, 10_15, 2_0, 13_0) = 8,
/*
* Set this option to enable session tickets. False by default.
*/
kSSLSessionOptionEnableSessionTickets CF_ENUM_DEPRECATED(10_2, 10_15, 2_0, 13_0) = 9,
};
/* State of an SSLSession */
typedef CF_CLOSED_ENUM(int, SSLSessionState) {
kSSLIdle CF_ENUM_DEPRECATED(10_2, 10_15, 2_0, 13_0), /* no I/O performed yet */
kSSLHandshake CF_ENUM_DEPRECATED(10_2, 10_15, 2_0, 13_0), /* SSL handshake in progress */
kSSLConnected CF_ENUM_DEPRECATED(10_2, 10_15, 2_0, 13_0), /* Handshake complete, ready for normal I/O */
kSSLClosed CF_ENUM_DEPRECATED(10_2, 10_15, 2_0, 13_0), /* connection closed normally */
kSSLAborted CF_ENUM_DEPRECATED(10_2, 10_15, 2_0, 13_0) /* connection aborted */
};
/*
* Status of client certificate exchange (which is optional
* for both server and client).
*/
typedef CF_ENUM(int, SSLClientCertificateState) {
/* Server hasn't asked for a cert. Client hasn't sent one. */
kSSLClientCertNone CF_ENUM_DEPRECATED(10_2, 10_15, 2_0, 13_0),
/* Server has asked for a cert, but client didn't send it. */
kSSLClientCertRequested CF_ENUM_DEPRECATED(10_2, 10_15, 2_0, 13_0),
/*
* Server side: We asked for a cert, client sent one, we validated
* it OK. App can inspect the cert via
* SSLCopyPeerCertificates().
* Client side: server asked for one, we sent it.
*/
kSSLClientCertSent CF_ENUM_DEPRECATED(10_2, 10_15, 2_0, 13_0),
/*
* Client sent a cert but failed validation. Server side only.
* Server app can inspect the cert via SSLCopyPeerCertificates().
*/
kSSLClientCertRejected CF_ENUM_DEPRECATED(10_2, 10_15, 2_0, 13_0)
};
/*
* R/W functions. The application using this library provides
* these functions via SSLSetIOFuncs().
*
* Data's memory is allocated by caller; on entry to these two functions
* the *length argument indicates both the size of the available data and the
* requested byte count. Number of bytes actually transferred is returned in
* *length.
*
* The application may configure the underlying connection to operate
* in a non-blocking manner; in such a case, a read operation may
* well return errSSLWouldBlock, indicating "I transferred less data than
* you requested (maybe even zero bytes), nothing is wrong, except
* requested I/O hasn't completed". This will be returned back up to
* the application as a return from SSLRead(), SSLWrite(), SSLHandshake(),
* etc.
*/
typedef OSStatus
(*SSLReadFunc) (SSLConnectionRef connection,
void *data, /* owned by
* caller, data
* RETURNED */
size_t *dataLength); /* IN/OUT */
typedef OSStatus
(*SSLWriteFunc) (SSLConnectionRef connection,
const void *data,
size_t *dataLength); /* IN/OUT */
/* DEPRECATED aliases for errSSLPeerAuthCompleted */
#define errSSLServerAuthCompleted errSSLPeerAuthCompleted
#define errSSLClientAuthCompleted errSSLPeerAuthCompleted
/* DEPRECATED alias for the end of the error range */
#define errSSLLast errSSLUnexpectedRecord
typedef CF_CLOSED_ENUM(int, SSLProtocolSide)
{
kSSLServerSide CF_ENUM_DEPRECATED(10_2, 10_15, 2_0, 13_0),
kSSLClientSide CF_ENUM_DEPRECATED(10_2, 10_15, 2_0, 13_0)
};
typedef CF_ENUM(int, SSLConnectionType)
{
kSSLStreamType CF_ENUM_DEPRECATED(10_2, 10_15, 2_0, 13_0),
kSSLDatagramType CF_ENUM_DEPRECATED(10_2, 10_15, 2_0, 13_0)
};
/*
* Predefined TLS configuration constants
*/
/* Default configuration (has 3DES, no RC4) */
extern const CFStringRef kSSLSessionConfig_default
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.13), ios(5.0, 11.0));
/* ATS v1 Config: TLS v1.2, only PFS ciphersuites */
extern const CFStringRef kSSLSessionConfig_ATSv1
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/* ATS v1 Config without PFS: TLS v1.2, include non PFS ciphersuites */
extern const CFStringRef kSSLSessionConfig_ATSv1_noPFS
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/* TLS v1.2 to TLS v1.0, with default ciphersuites (no 3DES, no RC4) */
extern const CFStringRef kSSLSessionConfig_standard
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/* TLS v1.2 to TLS v1.0, with default ciphersuites + RC4 + 3DES */
extern const CFStringRef kSSLSessionConfig_RC4_fallback
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.13), ios(5.0, 11.0));
/* TLS v1.0 only, with default ciphersuites + fallback SCSV */
extern const CFStringRef kSSLSessionConfig_TLSv1_fallback
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/* TLS v1.0, with default ciphersuites + RC4 + 3DES + fallback SCSV */
extern const CFStringRef kSSLSessionConfig_TLSv1_RC4_fallback
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.13), ios(5.0, 11.0));
/* TLS v1.2 to TLS v1.0, defaults + RC4 + DHE ciphersuites */
extern const CFStringRef kSSLSessionConfig_legacy
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/* TLS v1.2 to TLS v1.0, default + RC4 + DHE ciphersuites */
extern const CFStringRef kSSLSessionConfig_legacy_DHE
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/* TLS v1.2, anonymous ciphersuites only */
extern const CFStringRef kSSLSessionConfig_anonymous
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/* TLS v1.2 to TLS v1.0, has 3DES, no RC4 */
extern const CFStringRef kSSLSessionConfig_3DES_fallback
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.13), ios(5.0, 11.0));
/* TLS v1.0, with default ciphersuites + 3DES, no RC4 */
extern const CFStringRef kSSLSessionConfig_TLSv1_3DES_fallback
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.13), ios(5.0, 11.0));
/******************
*** Public API ***
******************/
/*
* Secure Transport APIs require a SSLContextRef, which is an opaque
* reference to the SSL session and its parameters. On Mac OS X 10.7
* and earlier versions, a new context is created using SSLNewContext,
* and is disposed by calling SSLDisposeContext.
*
* On i0S 5.0 and later, as well as Mac OS X versions after 10.7, the
* SSLContextRef is a true CFType object with retain-release semantics.
* New code should create a new context using SSLCreateContext (instead
* of SSLNewContext), and dispose the context by calling CFRelease
* (instead of SSLDisposeContext) when finished with it.
*/
/*
* @function SSLContextGetTypeID
* @abstract Return the CFTypeID for SSLContext objects.
* @return CFTypeId for SSLContext objects.
*/
CFTypeID
SSLContextGetTypeID(void)
__SECURETRANSPORT_API_DEPRECATED(macos(10.8, 10.15), ios(5.0, 13.0));
/*
* @function SSLCreateContext
* @abstract Create a new instance of an SSLContextRef using the specified allocator.
* @param alloc Allocator to use for memory.
* @param protooclSide Client or server indication.
* @param connectionType Type of connection.
* @return A newly allocated SSLContextRef, or NULL on error.
*/
__nullable
SSLContextRef
SSLCreateContext(CFAllocatorRef __nullable alloc, SSLProtocolSide protocolSide, SSLConnectionType connectionType)
__SECURETRANSPORT_API_DEPRECATED(macos(10.8, 10.15), ios(5.0, 13.0));
#if TARGET_OS_OSX
/*
* @function SSLNewContext
* @abstract Create a new session context.
* @note
*
* ==========================
* MAC OS X ONLY (DEPRECATED)
* ==========================
* NOTE: this function is not available on iOS, and should be considered
* deprecated on Mac OS X. Your code should use SSLCreateContext instead.
*
* @param isServer Flag indicating if the context is for the server (true) or client (false).
* @param contextPtr Pointer to SSLContextRef where result will be stored.
* @return errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLNewContext (Boolean isServer,
SSLContextRef * __nonnull CF_RETURNS_RETAINED contextPtr) /* RETURNED */
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.9));
/*
* @function SSLDisposeContext
* @abstract Dispose of a session context.
* @note
*
* ==========================
* MAC OS X ONLY (DEPRECATED)
* ==========================
* NOTE: this function is not available on iOS, and should be considered
* deprecated on Mac OS X. Your code should use CFRelease to dispose a session
* created with SSLCreateContext.
*
* @param context A SSLContextRef to deallocate and destroy.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLDisposeContext (SSLContextRef context)
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.9));
#endif /* MAC OS X */
/*
* @function SSLGetSessionState
* @abstract Determine the state of an SSL/DTLS session.
* @param context A valid SSLContextRef.
* @param state Output pointer to store the SSLSessionState.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLGetSessionState (SSLContextRef context,
SSLSessionState *state) /* RETURNED */
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/*
* @function SSLSetSessionOption
* @abstract Set options for an SSL session. Must be called prior to SSLHandshake();
* subsequently cannot be called while session is active.
* @param context A valid SSLContextRef.
* @param option An option enumeration value.
* @param value Value of the SSLSessionOption.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLSetSessionOption (SSLContextRef context,
SSLSessionOption option,
Boolean value)
__SECURETRANSPORT_API_DEPRECATED(macos(10.6, 10.15), ios(5.0, 13.0));
/*
* @function SSLGetSessionOption
* @abstract Determine current value for the specified option in a given SSL session.
* @param context A valid SSLContextRef.
* @param option An option enumeration value.
* @param value Pointer to a Boolean where the SSLSessionOption value is stored.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLGetSessionOption (SSLContextRef context,
SSLSessionOption option,
Boolean *value)
__SECURETRANSPORT_API_DEPRECATED(macos(10.6, 10.15), ios(5.0, 13.0));
/********************************************************************
*** Session context configuration, common to client and servers. ***
********************************************************************/
/*
* @function SSLSetIOFuncs
* @abstract Specify functions which do the network I/O. Must be called prior
* to SSLHandshake(); subsequently cannot be called while a session is
* active.
* @param context A valid SSLContextRef.
* @param readFunc Pointer to a SSLReadFunc.
* @param writeFunc Pointer to a SSLWriteFunc.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLSetIOFuncs (SSLContextRef context,
SSLReadFunc readFunc,
SSLWriteFunc writeFunc)
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/*
* @function SSLSetSessionConfig
* @absttact Set a predefined configuration for the SSL Session
* @note This currently affect enabled protocol versions,
* enabled ciphersuites, and the kSSLSessionOptionFallback
* session option.
* @param context A valid SSLContextRef.
* @param config String name of constant TLS handshake configuration, e.g., kSSLSessionConfig_standard.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLSetSessionConfig(SSLContextRef context,
CFStringRef config)
__SECURETRANSPORT_API_DEPRECATED(macos(10.12, 10.15), ios(10.0, 13.0));
/*
* @function SSLSetProtocolVersionMin
* @abstract Set the minimum SSL protocol version allowed. Optional.
* The default is the lower supported protocol.
* @note This can only be called when no session is active.
*
* For TLS contexts, legal values for minVersion are :
* kSSLProtocol3
* kTLSProtocol1
* kTLSProtocol11
* kTLSProtocol12
*
* For DTLS contexts, legal values for minVersion are :
* kDTLSProtocol1
* @param context A valid SSLContextRef.
* @param minVersion Minimum TLS protocol version.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLSetProtocolVersionMin (SSLContextRef context,
SSLProtocol minVersion)
__SECURETRANSPORT_API_DEPRECATED(macos(10.8, 10.15), ios(5.0, 13.0));
/*
* @function SSLGetProtocolVersionMin
* @abstract Get minimum protocol version allowed
* @param context A valid SSLContextRef.
* @param minVersion Pointer to SSLProtocol value where the minimum protocol version is stored.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLGetProtocolVersionMin (SSLContextRef context,
SSLProtocol *minVersion)
__SECURETRANSPORT_API_DEPRECATED(macos(10.8, 10.15), ios(5.0, 13.0));
/*
* @function SSLSetProtocolVersionMax
* @abstract Set the maximum SSL protocol version allowed. Optional.
* The default is the highest supported protocol.
* @note
* This can only be called when no session is active.
*
* For TLS contexts, legal values for maxVersion are :
* kSSLProtocol3
* kTLSProtocol1
* kTLSProtocol11
* kTLSProtocol12
*
* For DTLS contexts, legal values for maxVersion are :
* kDTLSProtocol1
* @param context A valid SSLContextRef.
* @param maxVersion Maximum TLS protocol version.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLSetProtocolVersionMax (SSLContextRef context,
SSLProtocol maxVersion)
__SECURETRANSPORT_API_DEPRECATED(macos(10.8, 10.15), ios(5.0, 13.0));
/*
* @function SSLGetProtocolVersionMax
* @abstract Get maximum protocol version allowed
* @param context A valid SSLContextRef.
* @param maxVersion Pointer to SSLProtocol value where the maximum protocol version is stored.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLGetProtocolVersionMax (SSLContextRef context,
SSLProtocol *maxVersion)
__SECURETRANSPORT_API_DEPRECATED(macos(10.8, 10.15), ios(5.0, 13.0));
#if TARGET_OS_OSX
/*
* @function SSLSetProtocolVersionEnabled
* @abstract Set allowed SSL protocol versions. Optional.
* @discussion Specifying kSSLProtocolAll for SSLSetProtocolVersionEnabled results in
* specified 'enable' boolean to be applied to all supported protocols.
* The default is "all supported protocols are enabled".
* This can only be called when no session is active.
*
* Legal values for protocol are :
* kSSLProtocol2
* kSSLProtocol3
* kTLSProtocol1
* kSSLProtocolAll
*
* ==========================
* MAC OS X ONLY (DEPRECATED)
* ==========================
* @note this function is not available on iOS, and should be considered
* deprecated on Mac OS X. You can use SSLSetProtocolVersionMin and/or
* SSLSetProtocolVersionMax to specify which protocols are enabled.
* @param context A valid SSLContextRef.
* @param protocol A SSLProtocol enumerated value.
* @param enable Boolean to enable or disable the designated protocol.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLSetProtocolVersionEnabled (SSLContextRef context,
SSLProtocol protocol,
Boolean enable)
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.9));
/*
* Obtain a value specified in SSLSetProtocolVersionEnabled.
*
* ==========================
* MAC OS X ONLY (DEPRECATED)
* ==========================
* NOTE: this function is not available on iOS, and should be considered
* deprecated on Mac OS X. You can use SSLGetProtocolVersionMin and/or
* SSLGetProtocolVersionMax to check whether a protocol is enabled.
*/
OSStatus
SSLGetProtocolVersionEnabled(SSLContextRef context,
SSLProtocol protocol,
Boolean *enable) /* RETURNED */
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.9));
/*
* @function SSLSetProtocolVersion
* @abstract Get/set SSL protocol version; optional. Default is kSSLProtocolUnknown,
* in which case the highest possible version is attempted, but a lower
* version is accepted if the peer requires it.
* @discussion SSLSetProtocolVersion cannot be called when a session is active.
*
* ==========================
* MAC OS X ONLY (DEPRECATED)
* ==========================
* @note this function is not available on iOS, and deprecated on Mac OS X 10.8.
* Use SSLSetProtocolVersionMin and/or SSLSetProtocolVersionMax to specify
* which protocols are enabled.
* @param context A valid SSLContextRef.
* @param protocol A SSLProtocol enumerated value.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLSetProtocolVersion (SSLContextRef context,
SSLProtocol version)
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.8));
/*
* @function SSLGetProtocolVersion
* @abstract Obtain the protocol version specified in SSLSetProtocolVersion.
* @discussion If SSLSetProtocolVersionEnabled() has been called for this session,
* SSLGetProtocolVersion() may return errSecParam if the protocol enable
* state can not be represented by the SSLProtocol enums (e.g.,
* SSL2 and TLS1 enabled, SSL3 disabled).
*
* ==========================
* MAC OS X ONLY (DEPRECATED)
* ==========================
* @note this function is not available on iOS, and deprecated on Mac OS X 10.8.
* Use SSLGetProtocolVersionMin and/or SSLGetProtocolVersionMax to check
* whether a protocol is enabled.
* @param context A valid SSLContextRef.
* @param protocol A SSLProtocol enumerated value pointer to store the protocol version.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLGetProtocolVersion (SSLContextRef context,
SSLProtocol *protocol) /* RETURNED */
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.8));
#endif /* MAC OS X */
/*
* @function SSLSetCertificate
* @abstract Specify this connection's certificate(s).
* @discussion This is mandatory for server connections,and optional for
* clients. Specifying a certificate for a client enables SSL client-side
* authentication. The end-entity cert is in certRefs[0]. Specifying a root
* cert is optional; if it's not specified, the root cert which verifies the
* cert chain specified here must be present in the system-wide set of trusted
* anchor certs.
*
* The certRefs argument is a CFArray containing SecCertificateRefs,
* except for certRefs[0], which is a SecIdentityRef.
*
* Must be called prior to SSLHandshake(), or immediately after
* SSLHandshake has returned errSSLClientCertRequested (i.e. before the
* handshake is resumed by calling SSLHandshake again.)
*
* SecureTransport assumes the following:
*
* -- The certRef references remain valid for the lifetime of the session.
* -- The certificate specified in certRefs[0] is capable of signing.
* -- The required capabilities of the certRef[0], and of the optional cert
* specified in SSLSetEncryptionCertificate (see below), are highly
* dependent on the application. For example, to work as a server with
* Netscape clients, the cert specified here must be capable of both
* signing and encrypting.
* @param context A valid SSLContextRef.
* @param certRefs An array of SecCertificateRef instances.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLSetCertificate (SSLContextRef context,
CFArrayRef _Nullable certRefs)
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/*
* @function SSLSetConnection
* @abstract Specify I/O connection - a socket, endpoint, etc., which is
* managed by caller.
* @discussion On the client side, it's assumed that communication
* has been established with the desired server on this connection.
* On the server side, it's assumed that an incoming client request
* has been established.
*
* Must be called prior to SSLHandshake(); subsequently can only be
* called when no session is active.
* @param context A valid SSLContextRef.
* @param connection A SSLConnectionRef.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLSetConnection (SSLContextRef context,
SSLConnectionRef __nullable connection)
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/*
* @function SSLGetConnection
* @abstract Retrieve the I/O connection managed managed by the caller.
* @param context A valid SSLContextRef.
* @param connection A SSLConnectionRef pointer.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLGetConnection (SSLContextRef context,
SSLConnectionRef * __nonnull CF_RETURNS_NOT_RETAINED connection)
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/*
* @function SSLSetPeerDomainName
* @abstract Specify the fully qualified doman name of the peer, e.g., "store.apple.com."
* @discussion Optional; used to verify the common name field in peer's certificate.
* Name is in the form of a C string; NULL termination optional, i.e.,
* peerName[peerNameLen+1] may or may not have a NULL. In any case peerNameLen
* is the number of bytes of the peer domain name.
* @param context A valid SSLContextRef.
* @param peerName A C string carrying the peer domain name.
* @param peerNameLen Length of the peer domain name string.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLSetPeerDomainName (SSLContextRef context,
const char * __nullable peerName,
size_t peerNameLen)
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/*
* @function SSLGetPeerDomainNameLength
* @abstract Determine the buffer size needed for SSLGetPeerDomainName().
* @param context A valid SSLContextRef.
* @param peerNameLen Pointer to where the length of the peer domain name string is stored
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLGetPeerDomainNameLength (SSLContextRef context,
size_t *peerNameLen) // RETURNED
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/*
* @function SSLGetPeerDomainName
* @abstract Obtain the value specified in SSLSetPeerDomainName().
* @param context A valid SSLContextRef.
* @param peerName Pointer to where the peer domain name is stored.
* @param peerNameLen Pointer to where the length of the peer domain name string is stored,
* up to the length specified by peerNameLen (on input).
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLGetPeerDomainName (SSLContextRef context,
char *peerName, // returned here
size_t *peerNameLen) // IN/OUT
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/*
* @function SSLCopyRequestedPeerNameLength
* @abstract [Server Only] obtain the hostname specified by the client in the ServerName extension (SNI)
* @param context A valid SSLContextRef.
* @param peerNameLen Pointer to where the length of the requested peer domain name string
* is stored, up to the length specified by peerNameLen (on input).
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLCopyRequestedPeerNameLength (SSLContextRef ctx,
size_t *peerNameLen)
__SECURETRANSPORT_API_DEPRECATED(macos(10.11, 10.15), ios(9.0, 13.0));
/*
* @function SSLCopyRequestedPeerName
* @abstract Determine the buffer size needed for SSLCopyRequestedPeerNameLength().
* @param context A valid SSLContextRef.
* @param peerName Pointer to where the requested peer domain name is stored.
* @param peerNameLen Pointer to where the length of the requested peer domain name string
* is stored, up to the length specified by peerNameLen (on input).
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLCopyRequestedPeerName (SSLContextRef context,
char *peerName,
size_t *peerNameLen)
__SECURETRANSPORT_API_DEPRECATED(macos(10.11, 10.15), ios(9.0, 13.0));
/*
* @function SSLSetDatagramHelloCookie
* @abstract Specify the Datagram TLS Hello Cookie.
* @discussion This is to be called for server side only and is optional.
* The default is a zero len cookie. The maximum cookieLen is 32 bytes.
* @param context A valid SSLContextRef.
* @param cookie Pointer to opaque cookie data.
* @param cookieLen Length of cookie data.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLSetDatagramHelloCookie (SSLContextRef dtlsContext,
const void * __nullable cookie,
size_t cookieLen)
__SECURETRANSPORT_API_DEPRECATED(macos(10.8, 10.15), ios(5.0, 13.0));
/*
* @function SSLSetMaxDatagramRecordSize
* @abstract Specify the maximum record size, including all DTLS record headers.
* @discussion This should be set appropriately to avoid fragmentation
* of Datagrams during handshake, as fragmented datagrams may
* be dropped by some network.
* @note This is for Datagram TLS only
* @param context A valid SSLContextRef.
* @param maxSize Maximum size of datagram record(s).
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLSetMaxDatagramRecordSize (SSLContextRef dtlsContext,
size_t maxSize)
__SECURETRANSPORT_API_DEPRECATED(macos(10.8, 10.15), ios(5.0, 13.0));
/*
* @function SSLGetMaxDatagramRecordSize
* @abstract Get the maximum record size, including all Datagram TLS record headers.
* @note This is for Datagram TLS only
* @param context A valid SSLContextRef.
* @param maxSize Pointer where maximum size of datagram record(s) is stored.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLGetMaxDatagramRecordSize (SSLContextRef dtlsContext,
size_t *maxSize)
__SECURETRANSPORT_API_DEPRECATED(macos(10.8, 10.15), ios(5.0, 13.0));
/*
* @function SSLGetNegotiatedProtocolVersion
* @abstract Obtain the actual negotiated protocol version of the active
* session, which may be different that the value specified in
* SSLSetProtocolVersion(). Returns kSSLProtocolUnknown if no
* SSL session is in progress.
* @param context A valid SSLContextRef.
* @param protocol Pointer where negotiated SSLProtocol is stored.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLGetNegotiatedProtocolVersion (SSLContextRef context,
SSLProtocol *protocol) /* RETURNED */
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/*
* @function SSLGetNumberSupportedCiphers
* @abstract Determine number and values of all of the SSLCipherSuites we support.
* Caller allocates output buffer for SSLGetSupportedCiphers() and passes in
* its size in *numCiphers. If supplied buffer is too small, errSSLBufferOverflow
* will be returned.
* @param context A valid SSLContextRef.
* @param numCiphers Pointer where number of supported ciphers is stored.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLGetNumberSupportedCiphers (SSLContextRef context,
size_t *numCiphers)
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/*
* @function SSLGetSupportedCiphers
* @abstract Get the supported ciphers.
* @param context A valid SSLContextRef.
* @param ciphers Pointer to array of SSLCipherSuite values where supported ciphersuites
* are stored. This array size is specified by the input value of numCiphers.
* @param numCiphers Pointer where number of supported ciphers is stored.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLGetSupportedCiphers (SSLContextRef context,
SSLCipherSuite *ciphers, /* RETURNED */
size_t *numCiphers) /* IN/OUT */
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/*
* @function SSLGetNumberEnabledCiphers
* @abstract Determine number and values of all of the SSLCipherSuites currently enabled.
* Caller allocates output buffer for SSLGetEnabledCiphers() and passes in
* its size in *numCiphers. If supplied buffer is too small, errSSLBufferOverflow
* will be returned.
* @param context A valid SSLContextRef.
* @param numCiphers Pointer where number of enabled ciphers is stored.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLGetNumberEnabledCiphers (SSLContextRef context,
size_t *numCiphers)
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/*
* @function SSLSetEnabledCiphers
* @abstract Specify a (typically) restricted set of SSLCipherSuites to be enabled by
* the current SSLContext. Can only be called when no session is active. Default
* set of enabled SSLCipherSuites is the same as the complete set of supported
* SSLCipherSuites as obtained by SSLGetSupportedCiphers().
* @param context A valid SSLContextRef.
* @param ciphers Array of enabled SSLCipherSuite values. This array size is specified
* by the input value of numCiphers.
* @param numCiphers Pointer where number of enabled ciphers is stored.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLSetEnabledCiphers (SSLContextRef context,
const SSLCipherSuite *ciphers,
size_t numCiphers)
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/*
* @function SSLGetEnabledCiphers
* @abstract Get the set of supported ciphersuites.
* @param context A valid SSLContextRef.
* @param ciphers Pointer to array of SSLCipherSuite values where enabled ciphersuites
* are stored. This array size is specified by the input value of numCiphers.
* @param numCiphers Pointer where number of enabled ciphers is stored.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLGetEnabledCiphers (SSLContextRef context,
SSLCipherSuite *ciphers, /* RETURNED */
size_t *numCiphers) /* IN/OUT */
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/*
* @function SSLSetSessionTicketsEnabled
* @abstract Forcibly enable or disable session ticket resumption.
* @note By default, session tickets are disabled.
* @param context A valid SSLContextRef.
* @param enabled Boolean indicating if ticket support is enabled (true) or not (false).
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLSetSessionTicketsEnabled (SSLContextRef context,
Boolean enabled)
__SECURETRANSPORT_API_DEPRECATED(macos(10.13, 10.15), ios(11.0, 13.0));
#if TARGET_OS_OSX
/*
* @function SSLSetEnableCertVerify
* @abstract Enable/disable peer certificate chain validation. Default is enabled.
* @discussion If caller disables, it is the caller's responsibility to call
* SSLCopyPeerCertificates() upon successful completion of the handshake
* and then to perform external validation of the peer certificate
* chain before proceeding with data transfer.
*
* ==========================
* MAC OS X ONLY (DEPRECATED)
* ==========================
* @note This function is not available on iOS, and should be considered
* deprecated on Mac OS X. To disable peer certificate chain validation, you
* can instead use SSLSetSessionOption to set kSSLSessionOptionBreakOnServerAuth
* to true. This will disable verification and cause SSLHandshake to return with
* an errSSLServerAuthCompleted result when the peer certificates have been
* received; at that time, you can choose to evaluate peer trust yourself, or
* simply call SSLHandshake again to proceed with the handshake.
* @param context A valid SSLContextRef.
* @param enableVerify Boolean indicating if certificate verifiation is enabled (true) or disabled (false).
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLSetEnableCertVerify (SSLContextRef context,
Boolean enableVerify)
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.9));
/*
* @function SSLGetEnableCertVerify
* @abstract Check whether peer certificate chain validation is enabled.
*
* ==========================
* MAC OS X ONLY (DEPRECATED)
* ==========================
* @note This function is not available on iOS, and should be considered
* deprecated on Mac OS X. To check whether peer certificate chain validation
* is enabled in a context, call SSLGetSessionOption to obtain the value of
* the kSSLSessionOptionBreakOnServerAuth session option flag. If the value
* of this option flag is true, then verification is disabled.
* @param context A valid SSLContextRef.
* @param enableVerify Pointer to Boolean where enable bit is stored.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLGetEnableCertVerify (SSLContextRef context,
Boolean *enableVerify) /* RETURNED */
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.9));
/*
* @function SSLSetAllowsExpiredCerts
* @abstract Specify the option of ignoring certificates' "expired" times.
* @discussion This is a common failure in the real SSL world. Default setting for this
* flag is false, meaning expired certs result in an errSSLCertExpired error.
*
* ==========================
* MAC OS X ONLY (DEPRECATED)
* ==========================
* @note This function is not available on iOS, and should be considered
* deprecated on Mac OS X. To ignore expired certificate errors, first disable
* Secure Transport's automatic verification of peer certificates by calling
* SSLSetSessionOption to set kSSLSessionOptionBreakOnServerAuth to true. When
* SSLHandshake subsequently returns an errSSLServerAuthCompleted result,
* your code should obtain the SecTrustRef for the peer's certificates and
* perform a custom trust evaluation with SecTrust APIs (see SecTrust.h).
* The SecTrustSetOptions function allows you to specify that the expiration
* status of certificates should be ignored for this evaluation.
*
* Example:
*
* status = SSLSetSessionOption(ctx, kSSLSessionOptionBreakOnServerAuth, true);
* do {
* status = SSLHandshake(ctx);
*
* if (status == errSSLServerAuthCompleted) {
* SecTrustRef peerTrust = NULL;
* status = SSLCopyPeerTrust(ctx, &peerTrust);
* if (status == errSecSuccess) {
* SecTrustResultType trustResult;
* // set flag to allow expired certificates
* SecTrustSetOptions(peerTrust, kSecTrustOptionAllowExpired);
* status = SecTrustEvaluate(peerTrust, &trustResult);
* if (status == errSecSuccess) {
* // A "proceed" result means the cert is explicitly trusted,
* // e.g. "Always Trust" was clicked;
* // "Unspecified" means the cert has no explicit trust settings,
* // but is implicitly OK since it chains back to a trusted root.
* // Any other result means the cert is not trusted.
* //
* if (trustResult == kSecTrustResultProceed ||
* trustResult == kSecTrustResultUnspecified) {
* // certificate is trusted
* status = errSSLWouldBlock; // so we call SSLHandshake again
* } else if (trustResult == kSecTrustResultRecoverableTrustFailure) {
* // not trusted, for some reason other than being expired;
* // could ask the user whether to allow the connection here
* //
* status = errSSLXCertChainInvalid;
* } else {
* // cannot use this certificate (fatal)
* status = errSSLBadCert;
* }
* }
* if (peerTrust) {
* CFRelease(peerTrust);
* }
* }
* } // errSSLServerAuthCompleted
*
* } while (status == errSSLWouldBlock);
* @param context A valid SSLContextRef.
* @param allowsExpired Boolean indicating if expired certificates are allowed (true) or not (false).
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLSetAllowsExpiredCerts (SSLContextRef context,
Boolean allowsExpired)
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.9));
/*
* @function SSLGetAllowsExpiredCerts
* @abstract Obtain the current value of an SSLContext's "allowExpiredCerts" flag.
*
* ==========================
* MAC OS X ONLY (DEPRECATED)
* ==========================
* @note This function is not available on iOS, and should be considered
* deprecated on Mac OS X.
* @param context A valid SSLContextRef.
* @param allowsExpired Pointer to Boolean where the expired certificate allowance Boolean is stored.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLGetAllowsExpiredCerts (SSLContextRef context,
Boolean *allowsExpired) /* RETURNED */
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.9));
/*
* @function SSLSetAllowsExpiredRoots
* @abstract Similar to SSLSetAllowsExpiredCerts, SSLSetAllowsExpiredRoots allows the
* option of ignoring "expired" status for root certificates only.
* @discussion Default setting is false, i.e., expired root certs result in an
* errSSLCertExpired error.
*
* ==========================
* MAC OS X ONLY (DEPRECATED)
* ==========================
* @note This function is not available on iOS, and should be considered
* deprecated on Mac OS X. To ignore expired certificate errors, first disable
* Secure Transport's automatic verification of peer certificates by calling
* SSLSetSessionOption to set kSSLSessionOptionBreakOnServerAuth to true. When
* SSLHandshake subsequently returns an errSSLServerAuthCompleted result,
* your code should obtain the SecTrustRef for the peer's certificates and
* perform a custom trust evaluation with SecTrust APIs (see SecTrust.h).
* The SecTrustSetOptions function allows you to specify that the expiration
* status of certificates should be ignored for this evaluation.
*
* See the description of the SSLSetAllowsExpiredCerts function (above)
* for a code example. The kSecTrustOptionAllowExpiredRoot option can be used
* instead of kSecTrustOptionAllowExpired to allow expired roots only.
* @param context A valid SSLContextRef.
* @param allowsExpired Boolean indicating if expired roots are allowed.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLSetAllowsExpiredRoots (SSLContextRef context,
Boolean allowsExpired)
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.9));
/*
* @function SSLGetAllowsExpiredRoots
* @abstract Obtain the current value of an SSLContext's "allow expired roots" flag.
*
* ==========================
* MAC OS X ONLY (DEPRECATED)
* ==========================
* @note This function is not available on iOS, and should be considered
* deprecated on Mac OS X.
* @param context A valid SSLContextRef.
* @param allowsExpired Pointer to Boolean where the expired root certificate allowance
* Boolean is stored.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLGetAllowsExpiredRoots (SSLContextRef context,
Boolean *allowsExpired) /* RETURNED */
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.9));
/*
* @function SSLSetAllowsAnyRoot
* @abstract Specify option of allowing for an unknown root cert, i.e., one which
* this software can not verify as one of a list of known good root certs.
* @discussion Default for this flag is false, in which case one of the following two
* errors may occur:
* -- The peer returns a cert chain with a root cert, and the chain
* verifies to that root, but the root is not one of our trusted
* roots. This results in errSSLUnknownRootCert on handshake.
* -- The peer returns a cert chain which does not contain a root cert,
* and we can't verify the chain to one of our trusted roots. This
* results in errSSLNoRootCert on handshake.
*
* Both of these error conditions are ignored when the AllowAnyRoot flag is
* true, allowing connection to a totally untrusted peer.
*
* ==========================
* MAC OS X ONLY (DEPRECATED)
* ==========================
* @note This function is not available on iOS, and should be considered
* deprecated on Mac OS X. To ignore unknown root cert errors, first disable
* Secure Transport's automatic verification of peer certificates by calling
* SSLSetSessionOption to set kSSLSessionOptionBreakOnServerAuth to true. When
* SSLHandshake subsequently returns an errSSLServerAuthCompleted result,
* your code should obtain the SecTrustRef for the peer's certificates and
* perform a custom trust evaluation with SecTrust APIs (see SecTrust.h).
*
* See the description of the SSLSetAllowsExpiredCerts function (above)
* for a code example. Note that an unknown root certificate will cause
* SecTrustEvaluate to report kSecTrustResultRecoverableTrustFailure as the
* trust result.
* @param context A valid SSLContextRef.
* @param anyRoot Boolean indicating if any root is allowed (true) or not (false).
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLSetAllowsAnyRoot (SSLContextRef context,
Boolean anyRoot)
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.9));
/*
* @function SSLGetAllowsAnyRoot
* @abstract Obtain the current value of an SSLContext's "allow any root" flag.
*
* ==========================
* MAC OS X ONLY (DEPRECATED)
* ==========================
* @note This function is not available on iOS, and should be considered
* deprecated on Mac OS X.
* @param context A valid SSLContextRef.
* @param anyRoot Pointer to Boolean to store any root allowance Boolean.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLGetAllowsAnyRoot (SSLContextRef context,
Boolean *anyRoot) /* RETURNED */
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.9));
/*
* @function SSLSetTrustedRoots
* @abstract Augment or replace the system's default trusted root certificate set
* for this session.
* @discussion If replaceExisting is true, the specified roots will
* be the only roots which are trusted during this session. If replaceExisting
* is false, the specified roots will be added to the current set of trusted
* root certs. If this function has never been called, the current trusted
* root set is the same as the system's default trusted root set.
* Successive calls with replaceExisting false result in accumulation
* of additional root certs.
*
* The trustedRoots array contains SecCertificateRefs.
*
* ==========================
* MAC OS X ONLY (DEPRECATED)
* ==========================
* @note This function is not available on iOS, and should be considered
* deprecated on Mac OS X. To trust specific roots in a session, first disable
* Secure Transport's automatic verification of peer certificates by calling
* SSLSetSessionOption to set kSSLSessionOptionBreakOnServerAuth to true. When
* SSLHandshake subsequently returns an errSSLServerAuthCompleted result,
* your code should obtain the SecTrustRef for the peer's certificates and
* perform a custom trust evaluation with SecTrust APIs (see SecTrust.h).
*
* See the description of the SSLSetAllowsExpiredCerts function (above)
* for a code example. You can call SecTrustSetAnchorCertificates to
* augment the system's trusted root set, or SecTrustSetAnchorCertificatesOnly
* to make these the only trusted roots, prior to calling SecTrustEvaluate.
* @param context A valid SSLContextRef.
* @param trustedRoots Array of SecCertificateRef roots.
* @param replaceExisting Boolean indicating if provided roots should override all others for this connection.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLSetTrustedRoots (SSLContextRef context,
CFArrayRef trustedRoots,
Boolean replaceExisting)
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.9));
/*
* @function SSLCopyTrustedRoots
* @abstract Obtain an array of SecCertificateRefs representing the current
* set of trusted roots.
* @discussion If SSLSetTrustedRoots() has never been called
* for this session, this returns the system's default root set.
* Caller must CFRelease the returned CFArray.
*
* ==========================
* MAC OS X ONLY (DEPRECATED)
* ==========================
* @note This function is not available on iOS, and should be considered
* deprecated on Mac OS X. To get the current set of trusted roots, call the
* SSLCopyPeerTrust function to obtain the SecTrustRef for the peer certificate
* chain, then SecTrustCopyCustomAnchorCertificates (see SecTrust.h).
* @param context A valid SSLContextRef.
* @param trustedRoots Array of SecCertificateRef roots.
* @param replaceExisting Boolean indicating if provided roots should override all others for this connection.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLCopyTrustedRoots (SSLContextRef context,
CFArrayRef * __nonnull CF_RETURNS_RETAINED trustedRoots) /* RETURNED */
__SECURETRANSPORT_API_DEPRECATED(macos(10.5, 10.9));
/*
* @function SSLCopyPeerCertificates
* @abstract Request peer certificates. Valid anytime, subsequent to a handshake attempt.
* @discussion The certs argument is a CFArray containing SecCertificateRefs.
* Caller must CFRelease the returned array.
*
* The cert at index 0 of the returned array is the subject (end
* entity) cert; the root cert (or the closest cert to it) is at
* the end of the returned array.
*
* ==========================
* MAC OS X ONLY (DEPRECATED)
* ==========================
* @note This function is not available on iOS, and should be considered
* deprecated on Mac OS X. To get peer certificates, call SSLCopyPeerTrust
* to obtain the SecTrustRef for the peer certificate chain, then use the
* SecTrustCopyCertificateChain to retrieve individual certificates in
* the chain (see SecTrust.h).
* @param context A valid SSLContextRef.
* @param certs Pointer to CFArrayRef that will store a reference to the peer's certificates.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLCopyPeerCertificates (SSLContextRef context,
CFArrayRef * __nonnull CF_RETURNS_RETAINED certs) /* RETURNED */
__SECURETRANSPORT_API_DEPRECATED(macos(10.5, 10.9));
#endif /* MAC OS X */
/*
* @function SSLCopyPeerTrust
* @abstract Obtain a SecTrustRef representing peer certificates. Valid anytime,
* subsequent to a handshake attempt. Caller must CFRelease the returned
* trust reference.
* @discussion The returned trust reference will have already been evaluated for
* you, unless one of the following is true:
* - Your code has disabled automatic certificate verification, by calling
* SSLSetSessionOption to set kSSLSessionOptionBreakOnServerAuth to true.
* - Your code has called SSLSetPeerID, and this session has been resumed
* from an earlier cached session.
*
* In these cases, your code should call SecTrustEvaluate prior to
* examining the peer certificate chain or trust results (see SecTrust.h).
*
* @note If you have not called SSLHandshake at least once prior to
* calling this function, the returned trust reference will be NULL.
* @param context A valid SSLContextRef.
* @param trust Pointer to SecTrustRef where peer's SecTrustRef is copied (retained).
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLCopyPeerTrust (SSLContextRef context,
SecTrustRef * __nonnull CF_RETURNS_RETAINED trust) /* RETURNED */
__SECURETRANSPORT_API_DEPRECATED(macos(10.6, 10.15), ios(5.0, 13.0));
/*
* @function SSLSetPeerID
* @discussion Specify some data, opaque to this library, which is sufficient
* to uniquely identify the peer of the current session. An example
* would be IP address and port, stored in some caller-private manner.
* To be optionally called prior to SSLHandshake for the current
* session. This is mandatory if this session is to be resumable.
*
* SecureTransport allocates its own copy of the incoming peerID. The
* data provided in *peerID, while opaque to SecureTransport, is used
* in a byte-for-byte compare to other previous peerID values set by the
* current application. Matching peerID blobs result in SecureTransport
* attempting to resume an SSL session with the same parameters as used
* in the previous session which specified the same peerID bytes.
* @param context A valid SSLContextRef.
* @param peerID Opaque peer ID.
* @param peerIDLen Length of opaque peer ID.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLSetPeerID (SSLContextRef context,
const void * __nullable peerID,
size_t peerIDLen)
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/*
* @function SSLGetPeerID
* @abstract Obtain current PeerID. Returns NULL pointer, zero length if
* SSLSetPeerID has not been called for this context.
* @param context A valid SSLContextRef.
* @param peerID Pointer to storage for the peer ID.
* @param peerIDLen Pointer to storage for the peer ID length.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLGetPeerID (SSLContextRef context,
const void * __nullable * __nonnull peerID,
size_t *peerIDLen)
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/*
* @function SSLGetNegotiatedCipher
* @abstract Obtain the SSLCipherSuite (e.g., SSL_RSA_WITH_DES_CBC_SHA) negotiated
* for this session. Only valid when a session is active.
* @param context A valid SSLContextRef.
* @param cipherSuite Pointer to storage for negotiated SSLCipherSuite.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLGetNegotiatedCipher (SSLContextRef context,
SSLCipherSuite *cipherSuite)
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/*
* @function SSLSetALPNProtocols
* @abstract Set the ALPN protocols to be passed in the ALPN negotiation.
* @discussion This is the list of supported application-layer protocols supported.
*
* The protocols parameter must be an array of CFStringRef values
* with ASCII-encoded reprensetations of the supported protocols, e.g., "http/1.1".
*
* @note See RFC 7301 for more information.
* @param context A valid SSLContextRef.
* @param protocols Array of CFStringRefs carrying application protocols.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLSetALPNProtocols (SSLContextRef context,
CFArrayRef protocols)
__SECURETRANSPORT_API_DEPRECATED(macos(10.13, 10.15), ios(11.0, 13.0));
/*
* @function SSLCopyALPNProtocols
* @abstract Get the ALPN protocols associated with this SSL context.
* @discussion This is the list of supported application-layer protocols supported.
*
* The resultant protocols array will contain CFStringRef values containing
* ASCII-encoded representations of the supported protocols, e.g., "http/1.1".
*
* See RFC 7301 for more information.
*
* @note The `protocols` pointer must be NULL, otherwise the copy will fail.
* This function will allocate memory for the CFArrayRef container
* if there is data to provide. Otherwise, the pointer will remain NULL.
* @param context A valid SSLContextRef.
* @param protocols Pointer to a CFArrayRef where peer ALPN protocols are stored.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLCopyALPNProtocols (SSLContextRef context,
CFArrayRef __nullable * __nonnull protocols) /* RETURNED */
__SECURETRANSPORT_API_DEPRECATED(macos(10.13, 10.15), ios(11.0, 13.0));
/*
* @function SSLSetOCSPResponse
* @abstract Set the OCSP response for the given SSL session.
* @discussion The response parameter must be a non-NULL CFDataRef containing the
* bytes of the OCSP response.
* @param context A valid SSLContextRef.
* @param response CFDataRef carrying OCSP response.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLSetOCSPResponse (SSLContextRef context,
CFDataRef __nonnull response)
__SECURETRANSPORT_API_DEPRECATED(macos(10.13, 10.15), ios(11.0, 13.0));
/********************************************************
*** Session context configuration, server side only. ***
********************************************************/
/*
* @function SSLSetEncryptionCertificate
* @discussion This function is deprecated in OSX 10.11 and iOS 9.0 and
* has no effect on the TLS handshake since OSX 10.10 and
* iOS 8.0. Using separate RSA certificates for encryption
* and signing is no longer supported.
* @param context A valid SSLContextRef.
* @param certRefs Array of certificates.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLSetEncryptionCertificate (SSLContextRef context,
CFArrayRef certRefs)
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.11), ios(5.0, 9.0));
/*
* @enum SSLAuthenticate
* @discussion Optional; Default is kNeverAuthenticate.
* Can only be called when no session is active.
*/
typedef CF_ENUM(int, SSLAuthenticate) {
kNeverAuthenticate, /* skip client authentication */
kAlwaysAuthenticate, /* require it */
kTryAuthenticate /* try to authenticate, but not an error if client doesn't have a cert */
};
/*
* @function SSLSetClientSideAuthenticate
* @abstract Specify requirements for client-side authentication.
* @param context A valid SSLContextRef.
* @param auth A SSLAuthenticate enumeration value.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLSetClientSideAuthenticate (SSLContextRef context,
SSLAuthenticate auth)
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/*
* @function SSLAddDistinguishedName
* @abstract Add a DER-encoded distinguished name to list of acceptable names
* to be specified in requests for client certificates.
* @param context A valid SSLContextRef.
* @param derDN A DER-encoded Distinguished Name blob.
* @param derDNLen Length of the Distinguished Name blob.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLAddDistinguishedName (SSLContextRef context,
const void * __nullable derDN,
size_t derDNLen)
__SECURETRANSPORT_API_DEPRECATED(macos(10.4, 10.15), ios(5.0, 13.0));
#if TARGET_OS_OSX
/*
* @function SSLSetCertificateAuthorities
* @abstract Add a SecCertificateRef, or a CFArray of them, to a server's list
* of acceptable Certificate Authorities (CAs) to present to the client
* when client authentication is performed.
* @discussion If replaceExisting is true, the specified certificate(s) will
* replace a possible existing list of acceptable CAs. If replaceExisting
* is false, the specified certificate(s) will be appended to the existing
* list of acceptable CAs, if any.
*
* Returns errSecParam if this is called on a SSLContextRef which
* is configured as a client, or when a session is active.
*
* @note this function is currently not available on iOS.
* @param context A valid SSLContextRef.
* @param certificateOrARray Either a SecCertificateRef (or CFArrayRef of them).
* @param replaceExisting Boolean indicating if existing CAs should be overruled for this connection.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLSetCertificateAuthorities(SSLContextRef context,
CFTypeRef certificateOrArray,
Boolean replaceExisting)
__SECURETRANSPORT_API_DEPRECATED(macos(10.5, 10.15));
/*
* @function SSLCopyCertificateAuthorities
* @abstract Obtain the certificates specified in SSLSetCertificateAuthorities(),
* if any. Returns a NULL array if SSLSetCertificateAuthorities() has not been called.
* @discussion Caller must CFRelease the returned array.
*
* @note This function is currently not available on iOS.
* @param context A valid SSLContextRef.
* @param certificates Pointer to CFArrayRef storage for retained copy of CAs for this connection.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLCopyCertificateAuthorities(SSLContextRef context,
CFArrayRef * __nonnull CF_RETURNS_RETAINED certificates) /* RETURNED */
__SECURETRANSPORT_API_DEPRECATED(macos(10.5, 10.15));
#endif /* MAC OS X */
/*
* @function SSLCopyDistinguishedNames
* @abstract Obtain the list of acceptable distinguished names as provided by
* a server (if the SSLContextRef is configured as a client), or as
* specified by SSLSetCertificateAuthorities (if the SSLContextRef
* is configured as a server).
* @discussion The returned array contains CFDataRefs, each of which represents
* one DER-encoded RDN. Caller must CFRelease the returned array.
* @param context A valid SSLContextRef.
* @param names Pointer to CFArrayRef storage for retained copy of Distinguished Names.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLCopyDistinguishedNames (SSLContextRef context,
CFArrayRef * __nonnull CF_RETURNS_RETAINED names)
__SECURETRANSPORT_API_DEPRECATED(macos(10.5, 10.15), ios(5.0, 13.0));
/*
* @function SSLGetClientCertificateState
* @abstract Obtain client certificate exchange status.
* @discussion Can be called any time.
* Reflects the *last* client certificate state change;
* subsequent to a renegotiation attempt by either peer, the state
* is reset to kSSLClientCertNone.
* @param context A valid SSLContextRef.
* @param clientState Pointer to SSLClientCertificateState storage.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLGetClientCertificateState (SSLContextRef context,
SSLClientCertificateState *clientState)
__SECURETRANSPORT_API_DEPRECATED(macos(10.3, 10.15), ios(5.0, 13.0));
#if TARGET_OS_OSX
/*
* @function SSLSetDiffieHellmanParams
* @abstract Specify Diffie-Hellman parameters.
* @discussion Optional; if we are configured to allow
* for D-H ciphers and a D-H cipher is negotiated, and this function has not
* been called, a set of process-wide parameters will be calculated. However
* that can take a long time (30 seconds).
* @note This function is currently not available on iOS.
* @param context A valid SSLContextRef.
* @param clientState Pointer to SSLClientCertificateState storage.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLSetDiffieHellmanParams (SSLContextRef context,
const void * __nullable dhParams,
size_t dhParamsLen)
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15));
/*
* @function SSLGetDiffieHellmanParams
* @abstract Return parameter block specified in SSLSetDiffieHellmanParams.
* @discussion Returned data is not copied and belongs to the SSLContextRef.
* @note This function is currently not available on iOS.
* @param context A valid SSLContextRef.
* @param dhParams Pointer to storage for DH parameters (if set), of at length most |*dhParamsLen|.
* @param dhParamsLen (Input and output) length of dhParams.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLGetDiffieHellmanParams (SSLContextRef context,
const void * __nullable * __nonnull dhParams,
size_t *dhParamsLen)
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15));
/*
* @function SSLSetRsaBlinding
* @abstract Enable/Disable RSA blinding.
* @discussion This feature thwarts a known timing
* attack to which RSA keys are vulnerable; enabling it is a tradeoff
* between performance and security. The default for RSA blinding is
* enabled.
*
* ==========================
* MAC OS X ONLY (DEPRECATED)
* ==========================
* @note This function is not available on iOS, and should be considered
* deprecated on Mac OS X. RSA blinding is enabled unconditionally, as
* it prevents a known way for an attacker to recover the private key,
* and the performance gain of disabling it is negligible.
* @param context A valid SSLContextRef.
* @param blinding Boolean indicating if RSA blinding is enabled.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLSetRsaBlinding (SSLContextRef context,
Boolean blinding)
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.9));
/*
* @function SSLGetRsaBlinding
* @abstract Get RSA blinding state.
* @discussion See SSLSetRsaBlinding().
*
* ==========================
* MAC OS X ONLY (DEPRECATED)
* ==========================
* @note This function is not available on iOS, and should be considered
* deprecated on Mac OS X.
* @param context A valid SSLContextRef.
* @param blinding Pointer to Boolean storage for RSA blinding state.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLGetRsaBlinding (SSLContextRef context,
Boolean *blinding)
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.9));
#endif /* MAC OS X */
/*******************************
******** I/O Functions ********
*******************************/
/*
* Note: depending on the configuration of the underlying I/O
* connection, all SSL I/O functions can return errSSLWouldBlock,
* indicating "not complete, nothing is wrong, except required
* I/O hasn't completed". Caller may need to repeat I/Os as necessary
* if the underlying connection has been configured to behave in
* a non-blocking manner.
*/
/*
* @function SSLHandshake
* @abstract Perform the SSL handshake.
* @discussion On successful return, session is ready for normal secure application
* I/O via SSLWrite and SSLRead.
*
* Interesting error returns:
*
* errSSLUnknownRootCert: Peer had a valid cert chain, but the root of
* the chain is unknown.
*
* errSSLNoRootCert: Peer had a cert chain which did not end in a root.
*
* errSSLCertExpired: Peer's cert chain had one or more expired certs.
*
* errSSLXCertChainInvalid: Peer had an invalid cert chain (i.e.,
* signature verification within the chain failed, or no certs
* were found).
*
* In all of the above errors, the handshake was aborted; the peer's
* cert chain is available via SSLCopyPeerTrust or SSLCopyPeerCertificates.
*
* Other interesting result codes:
*
* errSSLPeerAuthCompleted: Peer's cert chain is valid, or was ignored if
* cert verification was disabled via SSLSetEnableCertVerify. The application
* may decide to continue with the handshake (by calling SSLHandshake
* again), or close the connection at this point.
*
* errSSLClientCertRequested: The server has requested a client certificate.
* The client may choose to examine the server's certificate and
* distinguished name list, then optionally call SSLSetCertificate prior
* to resuming the handshake by calling SSLHandshake again.
*
* A return value of errSSLWouldBlock indicates that SSLHandshake has to be
* called again (and again and again until something else is returned).
* @param context A valid SSLContextRef.
* @result errSecSuccess on success, alternative error on failure or incomplete state.
*/
OSStatus
SSLHandshake (SSLContextRef context)
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/*
* @function SSLReHandshake
* @abstract Server Only: Request renegotation.
* @discussion This will return an error if the server is already renegotiating, or if the session is closed.
* After this return without error, the application should call SSLHandshake() and/or SSLRead() as
* for the original handshake.
* @param context A valid SSLContextRef.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLReHandshake (SSLContextRef context)
__SECURETRANSPORT_API_DEPRECATED(macos(10.12, 10.15), ios(10.0, 13.0));
/*
* @function SSLWrite
* @abstract Normal application-level write.
* @discussion On both of these, a errSSLWouldBlock return and a partially completed
* transfer - or even zero bytes transferred - are NOT mutually exclusive.
* @param context A valid SSLContextRef.
* @param data Pointer to data to write.
* @param dataLength Length of data to write.
* @param processed Pointer to storage indicating how much data was written.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLWrite (SSLContextRef context,
const void * __nullable data,
size_t dataLength,
size_t *processed) /* RETURNED */
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/*
* @function SSLRead
* @abstract * @abstract Normal application-level write.
* @discussion Data is mallocd by caller; available size specified in
* dataLength; actual number of bytes read returned in
* *processed.
* @param context A valid SSLContextRef.
* @param data Pointer to storage where data can be read.
* @param dataLength Length of data storage.
* @param processed Pointer to storage indicating how much data was read.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLRead (SSLContextRef context,
void * data, /* RETURNED */
size_t dataLength,
size_t *processed) /* RETURNED */
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/*
* @function SSLGetBufferedReadSize
* @abstract Determine how much data the client can be guaranteed to
* obtain via SSLRead() without blocking or causing any low-level
* read operations to occur.
* @param context A valid SSLContextRef.
* @param bufferSize Pointer to store the amount of buffered data to be read.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLGetBufferedReadSize (SSLContextRef context,
size_t *bufferSize) /* RETURNED */
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/*
* @function SSLGetDatagramWriteSize
* @abstract Determine how much data the application can be guaranteed to write
* with SSLWrite() without causing fragmentation. The value is based on
* the maximum Datagram Record size defined by the application with
* SSLSetMaxDatagramRecordSize(), minus the DTLS Record header size.
* @param context A valid SSLContextRef (for DTLS).
* @param bufferSize Pointer to store the amount of data that can be written.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLGetDatagramWriteSize (SSLContextRef dtlsContext,
size_t *bufSize)
__SECURETRANSPORT_API_DEPRECATED(macos(10.8, 10.15), ios(5.0, 13.0));
/*
* @function SSLClose
* @abstract Terminate current SSL session.
* @param context A valid SSLContextRef.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLClose (SSLContextRef context)
__SECURETRANSPORT_API_DEPRECATED(macos(10.2, 10.15), ios(5.0, 13.0));
/*
* @function SSLSetError
* @abstract Set the status of a SSLContextRef.
* @discussion This is to be done after handling steps of the SSL handshake such
* as server certificate validation.
* @param context A valid SSLContextRef.
* @param status Error status to set internally, which will be translated to an alert.
* @result errSecSuccess on success, alternative error on failure.
*/
OSStatus
SSLSetError (SSLContextRef context,
OSStatus status)
__SECURETRANSPORT_API_DEPRECATED(macos(10.13, 10.15), ios(11.0, 13.0));
#undef __SECURETRANSPORT_API_DEPRECATED
CF_IMPLICIT_BRIDGING_DISABLED
CF_ASSUME_NONNULL_END
#ifdef __cplusplus
}
#endif
#endif /* !_SECURITY_SECURETRANSPORT_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecAsn1Types.h | /*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Netscape security libraries.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1994-2000 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
* "GPL"), in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
* replace them with the notice and other provisions required by
* the GPL. If you do not delete the provisions above, a recipient
* may use your version of this file under either the MPL or the
* GPL.
*/
/*
* Types for encoding/decoding of ASN.1 using BER/DER (Basic/Distinguished
* Encoding Rules).
*/
#ifndef _SEC_ASN1_TYPES_H_
#define _SEC_ASN1_TYPES_H_
#include <CoreFoundation/CFBase.h> /* Boolean */
#include <sys/types.h>
#include <stdint.h>
#include <TargetConditionals.h>
#define SEC_ASN1_API_DEPRECATED API_DEPRECATED("SecAsn1 is not supported", macos(10.0, 12.0)) API_UNAVAILABLE(ios, watchos, tvos)
typedef struct cssm_data {
size_t Length;
uint8_t * __nullable Data;
} SecAsn1Item SEC_ASN1_API_DEPRECATED, SecAsn1Oid SEC_ASN1_API_DEPRECATED;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
typedef struct SEC_ASN1_API_DEPRECATED {
SecAsn1Oid algorithm;
SecAsn1Item parameters;
} SecAsn1AlgId SEC_ASN1_API_DEPRECATED;
typedef struct SEC_ASN1_API_DEPRECATED {
SecAsn1AlgId algorithm;
SecAsn1Item subjectPublicKey;
} SecAsn1PubKeyInfo SEC_ASN1_API_DEPRECATED;
#pragma clang diagnostic pop
CF_ASSUME_NONNULL_BEGIN
/*
* An array of these structures defines a BER/DER encoding for an object.
*
* The array usually starts with a dummy entry whose kind is SEC_ASN1_SEQUENCE;
* such an array is terminated with an entry where kind == 0. (An array
* which consists of a single component does not require a second dummy
* entry -- the array is only searched as long as previous component(s)
* instruct it.)
*/
typedef struct SecAsn1Template_struct {
/*
* Kind of item being decoded/encoded, including tags and modifiers.
*/
uint32_t kind;
/*
* This value is the offset from the base of the structure (i.e., the
* (void *) passed as 'src' to SecAsn1EncodeItem, or the 'dst' argument
* passed to SecAsn1CoderRef()) to the field that holds the value being
* decoded/encoded.
*/
uint32_t offset;
/*
* When kind suggests it (e.g., SEC_ASN1_POINTER, SEC_ASN1_GROUP,
* SEC_ASN1_INLINE, or a component that is *not* a SEC_ASN1_UNIVERSAL),
* this points to a sub-template for nested encoding/decoding.
* OR, iff SEC_ASN1_DYNAMIC is set, then this is a pointer to a pointer
* to a function which will return the appropriate template when called
* at runtime. NOTE! that explicit level of indirection, which is
* necessary because ANSI does not allow you to store a function
* pointer directly as a "void *" so we must store it separately and
* dereference it to get at the function pointer itself.
*/
const void *sub;
/*
* In the first element of a template array, the value is the size
* of the structure to allocate when this template is being referenced
* by another template via SEC_ASN1_POINTER or SEC_ASN1_GROUP.
* In all other cases, the value is ignored.
*/
uint32_t size;
} SecAsn1Template SEC_ASN1_API_DEPRECATED;
/*
* BER/DER values for ASN.1 identifier octets.
*/
#define SEC_ASN1_TAG_MASK 0xff
/*
* BER/DER universal type tag numbers.
*/
#define SEC_ASN1_TAGNUM_MASK 0x1f
#define SEC_ASN1_BOOLEAN 0x01
#define SEC_ASN1_INTEGER 0x02
#define SEC_ASN1_BIT_STRING 0x03
#define SEC_ASN1_OCTET_STRING 0x04
#define SEC_ASN1_NULL 0x05
#define SEC_ASN1_OBJECT_ID 0x06
#define SEC_ASN1_OBJECT_DESCRIPTOR 0x07
/* External type and instance-of type 0x08 */
#define SEC_ASN1_REAL 0x09
#define SEC_ASN1_ENUMERATED 0x0a
#define SEC_ASN1_EMBEDDED_PDV 0x0b
#define SEC_ASN1_UTF8_STRING 0x0c
/* not used 0x0d */
/* not used 0x0e */
/* not used 0x0f */
#define SEC_ASN1_SEQUENCE 0x10
#define SEC_ASN1_SET 0x11
#define SEC_ASN1_NUMERIC_STRING 0x12
#define SEC_ASN1_PRINTABLE_STRING 0x13
#define SEC_ASN1_T61_STRING 0x14
#define SEC_ASN1_VIDEOTEX_STRING 0x15
#define SEC_ASN1_IA5_STRING 0x16
#define SEC_ASN1_UTC_TIME 0x17
#define SEC_ASN1_GENERALIZED_TIME 0x18
#define SEC_ASN1_GRAPHIC_STRING 0x19
#define SEC_ASN1_VISIBLE_STRING 0x1a
#define SEC_ASN1_GENERAL_STRING 0x1b
#define SEC_ASN1_UNIVERSAL_STRING 0x1c
/* not used 0x1d */
#define SEC_ASN1_BMP_STRING 0x1e
#define SEC_ASN1_HIGH_TAG_NUMBER 0x1f
#define SEC_ASN1_TELETEX_STRING SEC_ASN1_T61_STRING
/*
* Modifiers to type tags. These are also specified by a/the
* standard, and must not be changed.
*/
#define SEC_ASN1_METHOD_MASK 0x20
#define SEC_ASN1_PRIMITIVE 0x00
#define SEC_ASN1_CONSTRUCTED 0x20
#define SEC_ASN1_CLASS_MASK 0xc0
#define SEC_ASN1_UNIVERSAL 0x00
#define SEC_ASN1_APPLICATION 0x40
#define SEC_ASN1_CONTEXT_SPECIFIC 0x80
#define SEC_ASN1_PRIVATE 0xc0
/*
* Our additions, used for templates.
* These are not defined by any standard; the values are used internally only.
* Just be careful to keep them out of the low 8 bits.
*/
#define SEC_ASN1_OPTIONAL 0x00100
#define SEC_ASN1_EXPLICIT 0x00200
#define SEC_ASN1_ANY 0x00400
#define SEC_ASN1_INLINE 0x00800
#define SEC_ASN1_POINTER 0x01000
#define SEC_ASN1_GROUP 0x02000 /* with SET or SEQUENCE means
* SET OF or SEQUENCE OF */
#define SEC_ASN1_DYNAMIC 0x04000 /* subtemplate is found by calling
* a function at runtime */
#define SEC_ASN1_SKIP 0x08000 /* skip a field; only for decoding */
#define SEC_ASN1_INNER 0x10000 /* with ANY means capture the
* contents only (not the id, len,
* or eoc); only for decoding */
#define SEC_ASN1_SAVE 0x20000 /* stash away the encoded bytes first;
* only for decoding */
#define SEC_ASN1_SKIP_REST 0x80000 /* skip all following fields;
* only for decoding */
#define SEC_ASN1_CHOICE 0x100000 /* pick one from a template */
/*
* Indicate that a type SEC_ASN1_INTEGER is actually signed.
* The default is unsigned, which causes a leading zero to be
* encoded if the MS bit of the source data is 1.
*/
#define SEC_ASN1_SIGNED_INT 0X800000
/* Shorthand/Aliases */
#define SEC_ASN1_SEQUENCE_OF (SEC_ASN1_GROUP | SEC_ASN1_SEQUENCE)
#define SEC_ASN1_SET_OF (SEC_ASN1_GROUP | SEC_ASN1_SET)
#define SEC_ASN1_ANY_CONTENTS (SEC_ASN1_ANY | SEC_ASN1_INNER)
/*
* Function used for SEC_ASN1_DYNAMIC.
* "arg" is a pointer to the top-level structure being encoded or
* decoded.
*
* "enc" when true, means that we are encoding (false means decoding)
*
* "buf" For decode only; points to the start of the decoded data for
* the current template. Callee can use the tag at this location
* to infer the returned template. Not used on encode.
*
* "len" For decode only; the length of buf.
*
* "Dest" points to the template-specific item being decoded to
* or encoded from. (This is as opposed to arg, which
* points to the start of the struct associated with the
* current array of templates).
*/
typedef const SecAsn1Template * SecAsn1TemplateChooser(
void *arg,
Boolean enc,
const char *buf,
size_t len,
void *dest) SEC_ASN1_API_DEPRECATED;
typedef SecAsn1TemplateChooser * SecAsn1TemplateChooserPtr SEC_ASN1_API_DEPRECATED;
CF_ASSUME_NONNULL_END
#endif /* _SEC_ASN1_TYPES_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecBase.h | /*
* Copyright (c) 2000-2016 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _SECURITY_SECBASE_H_
#define _SECURITY_SECBASE_H_
#include <TargetConditionals.h>
#include <CoreFoundation/CFBase.h>
#include <Availability.h>
#include <sys/cdefs.h>
// Truth table for following declarations:
//
// TARGET_OS_OSX TARGET_OS_OSX TARGET_OS_IPHONE TARGET_OS_IPHONE TARGET_OS_MACCATALYST
// SEC_IOS_ON_OSX SEC_IOS_ON_OSX
// =================================================================================================================
// SEC_OS_IPHONE 0 1 1 1 1
// SEC_OS_OSX 1 0 0 0 0
// SEC_OS_OSX_INCLUDES 1 1 0 0 0
#if TARGET_OS_OSX
#ifdef SEC_IOS_ON_OSX
#define SEC_OS_IPHONE 1
#define SEC_OS_OSX 0
#define SEC_OS_OSX_INCLUDES 1
#endif // SEC_IOS_ON_OSX
#endif // TARGET_OS_OSX
#if TARGET_OS_MACCATALYST
#define SEC_OS_IPHONE 1
#define SEC_OS_OSX 0
#define SEC_OS_OSX_INCLUDES 0
#endif // TARGET_OS_MACCATALYST
#ifndef SEC_OS_IPHONE
// block above did not fire; set flags to current platform
#define SEC_OS_IPHONE TARGET_OS_IPHONE
#define SEC_OS_OSX TARGET_OS_OSX
#define SEC_OS_OSX_INCLUDES TARGET_OS_OSX
#endif
#if defined(__clang__)
#define SEC_DEPRECATED_ATTRIBUTE DEPRECATED_ATTRIBUTE
#else
#define SEC_DEPRECATED_ATTRIBUTE
#endif
#define CSSM_DEPRECATED API_DEPRECATED("CSSM is not supported", macos(10.0, 10.7)) API_UNAVAILABLE(ios, watchos, tvos, macCatalyst)
__BEGIN_DECLS
CF_ASSUME_NONNULL_BEGIN
CF_IMPLICIT_BRIDGING_ENABLED
#define SECURITY_TYPE_UNIFICATION 1
/*!
@typedef SecCertificateRef
@abstract CFType representing a X.509 certificate.
See SecCertificate.h for details.
*/
typedef struct CF_BRIDGED_TYPE(id) __SecCertificate *SecCertificateRef;
#if TARGET_OS_OSX
typedef struct __SecCertificate OpaqueSecCertificateRef;
#endif
/*!
@typedef SecIdentityRef
@abstract CFType representing an identity, which contains
a SecKeyRef and an associated SecCertificateRef. See
SecIdentity.h for details.
*/
typedef struct CF_BRIDGED_TYPE(id) __SecIdentity *SecIdentityRef;
#if TARGET_OS_OSX
typedef struct __SecIdentity OpaqueSecIdentityRef;
#endif
/*!
@typedef SecKeyRef
@abstract CFType representing a cryptographic key. See
SecKey.h for details.
*/
typedef struct CF_BRIDGED_TYPE(id) __SecKey *SecKeyRef;
#if TARGET_OS_OSX
typedef struct __SecKey OpaqueSecKeyRef;
#endif
/*!
@typedef SecPolicyRef
@abstract CFType representing a X.509 certificate trust policy.
See SecPolicy.h for details.
*/
typedef struct CF_BRIDGED_TYPE(id) __SecPolicy *SecPolicyRef;
/*!
@typedef SecAccessControl
@abstract CFType representing access control for an item.
SecAccessControl.h for details.
*/
typedef struct CF_BRIDGED_TYPE(id) __SecAccessControl *SecAccessControlRef;
/*!
@typedef SecKeychainRef
@abstract Contains information about a keychain.
*/
typedef struct CF_BRIDGED_TYPE(id) __SecKeychain *SecKeychainRef
API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, tvos, watchos);
/*!
@typedef SecKeychainItemRef
@abstract Contains information about a keychain item.
*/
typedef struct CF_BRIDGED_TYPE(id) __SecKeychainItem *SecKeychainItemRef API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
/*!
@typedef SecKeychainSearchRef
@abstract Contains information about a keychain search.
*/
typedef struct CF_BRIDGED_TYPE(id) __SecKeychainSearch *SecKeychainSearchRef API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
/*!
@typedef SecKeychainAttrType
@abstract Represents a keychain attribute type.
*/
typedef OSType SecKeychainAttrType API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
/*!
@struct SecKeychainAttribute
@abstract Contains keychain attributes.
@field tag A 4-byte attribute tag.
@field length The length of the buffer pointed to by data.
@field data A pointer to the attribute data.
*/
struct API_UNAVAILABLE(ios, watchos, tvos, macCatalyst) SecKeychainAttribute
{
SecKeychainAttrType tag;
UInt32 length;
void * __nullable data;
};
typedef struct SecKeychainAttribute SecKeychainAttribute API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
/*!
@typedef SecKeychainAttributePtr
@abstract Represents a pointer to a keychain attribute structure.
*/
typedef SecKeychainAttribute *SecKeychainAttributePtr API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
/*!
@typedef SecKeychainAttributeList
@abstract Represents a list of keychain attributes.
@field count An unsigned 32-bit integer that represents the number of keychain attributes in the array.
@field attr A pointer to the first keychain attribute in the array.
*/
struct API_UNAVAILABLE(ios, watchos, tvos, macCatalyst) SecKeychainAttributeList
{
UInt32 count;
SecKeychainAttribute * __nullable attr;
};
typedef struct SecKeychainAttributeList SecKeychainAttributeList API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
/*!
@typedef SecKeychainStatus
@abstract Represents the status of a keychain.
*/
typedef UInt32 SecKeychainStatus API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
/*!
@typedef SecTrustedApplicationRef
@abstract Contains information about a trusted application.
*/
typedef struct CF_BRIDGED_TYPE(id) __SecTrustedApplication *SecTrustedApplicationRef API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
/*!
@typedef SecAccessRef
@abstract Contains information about an access.
*/
typedef struct CF_BRIDGED_TYPE(id) __SecAccess *SecAccessRef API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
#if TARGET_OS_OSX
typedef struct __SecAccess OpaqueSecAccessRef;
#endif
/*!
@typedef SecACLRef
@abstract Contains information about an access control list (ACL) entry.
*/
typedef struct CF_BRIDGED_TYPE(id) __SecACL *SecACLRef API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
/*!
@typedef SecPasswordRef
@abstract Contains information about a password.
*/
typedef struct CF_BRIDGED_TYPE(id) __SecPassword *SecPasswordRef API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
/*!
@typedef SecKeychainAttributeInfo
@abstract Represents an attribute.
@field count The number of tag-format pairs in the respective arrays.
@field tag A pointer to the first attribute tag in the array.
@field format A pointer to the first CSSM_DB_ATTRIBUTE_FORMAT in the array.
@discussion Each tag and format item form a pair.
*/
struct API_UNAVAILABLE(ios, watchos, tvos, macCatalyst) SecKeychainAttributeInfo
{
UInt32 count;
UInt32 *tag;
UInt32 * __nullable format;
};
typedef struct SecKeychainAttributeInfo SecKeychainAttributeInfo API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
/*!
@function SecCopyErrorMessageString
@abstract Returns a string describing the specified error result code.
@param status An error result code of type OSStatus or CSSM_RETURN, as returned by a Security or CSSM function.
@reserved Reserved for future use. Your code should pass NULL in this parameter.
@result A reference to an error string, or NULL if no error string is available for the specified result code. Your code must release this reference by calling the CFRelease function.
*/
__nullable
CFStringRef SecCopyErrorMessageString(OSStatus status, void * __nullable reserved)
__OSX_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_11_3);
/*!
@enum Security Error Codes
@abstract Result codes returned from Security framework functions.
@constant errSecSuccess No error.
@constant errSecUnimplemented Function or operation not implemented.
@constant errSecDiskFull Disk Full error.
@constant errSecIO I/O error.
@constant errSecParam One or more parameters passed to a function were not valid.
@constant errSecWrPerm Write permissions error.
@constant errSecAllocate Failed to allocate memory.
@constant errSecUserCanceled User canceled the operation.
@constant errSecBadReq Bad parameter or invalid state for operation.
@constant errSecInternalComponent
@constant errSecCoreFoundationUnknown
@constant errSecNotAvailable No keychain is available.
@constant errSecReadOnly Read only error.
@constant errSecAuthFailed Authorization/Authentication failed.
@constant errSecNoSuchKeychain The keychain does not exist.
@constant errSecInvalidKeychain The keychain is not valid.
@constant errSecDuplicateKeychain A keychain with the same name already exists.
@constant errSecDuplicateCallback The specified callback is already installed.
@constant errSecInvalidCallback The specified callback is not valid.
@constant errSecDuplicateItem The item already exists.
@constant errSecItemNotFound The item cannot be found.
@constant errSecBufferTooSmall The buffer is too small.
@constant errSecDataTooLarge The data is too large.
@constant errSecNoSuchAttr The attribute does not exist.
@constant errSecInvalidItemRef The item reference is invalid.
@constant errSecInvalidSearchRef The search reference is invalid.
@constant errSecNoSuchClass The keychain item class does not exist.
@constant errSecNoDefaultKeychain A default keychain does not exist.
@constant errSecInteractionNotAllowed User interaction is not allowed.
@constant errSecReadOnlyAttr The attribute is read only.
@constant errSecWrongSecVersion The version is incorrect.
@constant errSecKeySizeNotAllowed The key size is not allowed.
@constant errSecNoStorageModule There is no storage module available.
@constant errSecNoCertificateModule There is no certificate module available.
@constant errSecNoPolicyModule There is no policy module available.
@constant errSecInteractionRequired User interaction is required.
@constant errSecDataNotAvailable The data is not available.
@constant errSecDataNotModifiable The data is not modifiable.
@constant errSecCreateChainFailed The attempt to create a certificate chain failed.
@constant errSecACLNotSimple The access control list is not in standard simple form.
@constant errSecPolicyNotFound The policy specified cannot be found.
@constant errSecInvalidTrustSetting The specified trust setting is invalid.
@constant errSecNoAccessForItem The specified item has no access control.
@constant errSecInvalidOwnerEdit Invalid attempt to change the owner of this item.
@constant errSecTrustNotAvailable No trust results are available.
@constant errSecUnsupportedFormat Import/Export format unsupported.
@constant errSecUnknownFormat Unknown format in import.
@constant errSecKeyIsSensitive Key material must be wrapped for export.
@constant errSecMultiplePrivKeys An attempt was made to import multiple private keys.
@constant errSecPassphraseRequired Passphrase is required for import/export.
@constant errSecInvalidPasswordRef The password reference was invalid.
@constant errSecInvalidTrustSettings The Trust Settings Record was corrupted.
@constant errSecNoTrustSettings No Trust Settings were found.
@constant errSecPkcs12VerifyFailure MAC verification failed during PKCS12 Import.
@constant errSecDecode Unable to decode the provided data.
@discussion The assigned error space is discontinuous: e.g. -25240..-25279, -25290..-25329, -68608..-67585, and so on.
*/
/*
Note: the comments that appear after these errors are used to create SecErrorMessages.strings.
The comments must not be multi-line, and should be in a form meaningful to an end user. If
a different or additional comment is needed, it can be put in the header doc format, or on a
line that does not start with errZZZ.
*/
CF_ENUM(OSStatus)
{
errSecSuccess = 0, /* No error. */
errSecUnimplemented = -4, /* Function or operation not implemented. */
errSecDiskFull = -34, /* The disk is full. */
errSecDskFull __attribute__((deprecated("use errSecDiskFull"))) = errSecDiskFull,
errSecIO = -36, /* I/O error. */
errSecOpWr = -49, /* File already open with write permission. */
errSecParam = -50, /* One or more parameters passed to a function were not valid. */
errSecWrPerm = -61, /* Write permissions error. */
errSecAllocate = -108, /* Failed to allocate memory. */
errSecUserCanceled = -128, /* User canceled the operation. */
errSecBadReq = -909, /* Bad parameter or invalid state for operation. */
errSecInternalComponent = -2070,
errSecCoreFoundationUnknown = -4960,
errSecMissingEntitlement = -34018, /* A required entitlement isn't present. */
errSecRestrictedAPI = -34020, /* Client is restricted and is not permitted to perform this operation. */
errSecNotAvailable = -25291, /* No keychain is available. You may need to restart your computer. */
errSecReadOnly = -25292, /* This keychain cannot be modified. */
errSecAuthFailed = -25293, /* The user name or passphrase you entered is not correct. */
errSecNoSuchKeychain = -25294, /* The specified keychain could not be found. */
errSecInvalidKeychain = -25295, /* The specified keychain is not a valid keychain file. */
errSecDuplicateKeychain = -25296, /* A keychain with the same name already exists. */
errSecDuplicateCallback = -25297, /* The specified callback function is already installed. */
errSecInvalidCallback = -25298, /* The specified callback function is not valid. */
errSecDuplicateItem = -25299, /* The specified item already exists in the keychain. */
errSecItemNotFound = -25300, /* The specified item could not be found in the keychain. */
errSecBufferTooSmall = -25301, /* There is not enough memory available to use the specified item. */
errSecDataTooLarge = -25302, /* This item contains information which is too large or in a format that cannot be displayed. */
errSecNoSuchAttr = -25303, /* The specified attribute does not exist. */
errSecInvalidItemRef = -25304, /* The specified item is no longer valid. It may have been deleted from the keychain. */
errSecInvalidSearchRef = -25305, /* Unable to search the current keychain. */
errSecNoSuchClass = -25306, /* The specified item does not appear to be a valid keychain item. */
errSecNoDefaultKeychain = -25307, /* A default keychain could not be found. */
errSecInteractionNotAllowed = -25308, /* User interaction is not allowed. */
errSecReadOnlyAttr = -25309, /* The specified attribute could not be modified. */
errSecWrongSecVersion = -25310, /* This keychain was created by a different version of the system software and cannot be opened. */
errSecKeySizeNotAllowed = -25311, /* This item specifies a key size which is too large or too small. */
errSecNoStorageModule = -25312, /* A required component (data storage module) could not be loaded. You may need to restart your computer. */
errSecNoCertificateModule = -25313, /* A required component (certificate module) could not be loaded. You may need to restart your computer. */
errSecNoPolicyModule = -25314, /* A required component (policy module) could not be loaded. You may need to restart your computer. */
errSecInteractionRequired = -25315, /* User interaction is required, but is currently not allowed. */
errSecDataNotAvailable = -25316, /* The contents of this item cannot be retrieved. */
errSecDataNotModifiable = -25317, /* The contents of this item cannot be modified. */
errSecCreateChainFailed = -25318, /* One or more certificates required to validate this certificate cannot be found. */
errSecInvalidPrefsDomain = -25319, /* The specified preferences domain is not valid. */
errSecInDarkWake = -25320, /* In dark wake, no UI possible */
errSecACLNotSimple = -25240, /* The specified access control list is not in standard (simple) form. */
errSecPolicyNotFound = -25241, /* The specified policy cannot be found. */
errSecInvalidTrustSetting = -25242, /* The specified trust setting is invalid. */
errSecNoAccessForItem = -25243, /* The specified item has no access control. */
errSecInvalidOwnerEdit = -25244, /* Invalid attempt to change the owner of this item. */
errSecTrustNotAvailable = -25245, /* No trust results are available. */
errSecUnsupportedFormat = -25256, /* Import/Export format unsupported. */
errSecUnknownFormat = -25257, /* Unknown format in import. */
errSecKeyIsSensitive = -25258, /* Key material must be wrapped for export. */
errSecMultiplePrivKeys = -25259, /* An attempt was made to import multiple private keys. */
errSecPassphraseRequired = -25260, /* Passphrase is required for import/export. */
errSecInvalidPasswordRef = -25261, /* The password reference was invalid. */
errSecInvalidTrustSettings = -25262, /* The Trust Settings Record was corrupted. */
errSecNoTrustSettings = -25263, /* No Trust Settings were found. */
errSecPkcs12VerifyFailure = -25264, /* MAC verification failed during PKCS12 import (wrong password?) */
errSecNotSigner = -26267, /* A certificate was not signed by its proposed parent. */
errSecDecode = -26275, /* Unable to decode the provided data. */
errSecServiceNotAvailable = -67585, /* The required service is not available. */
errSecInsufficientClientID = -67586, /* The client ID is not correct. */
errSecDeviceReset = -67587, /* A device reset has occurred. */
errSecDeviceFailed = -67588, /* A device failure has occurred. */
errSecAppleAddAppACLSubject = -67589, /* Adding an application ACL subject failed. */
errSecApplePublicKeyIncomplete = -67590, /* The public key is incomplete. */
errSecAppleSignatureMismatch = -67591, /* A signature mismatch has occurred. */
errSecAppleInvalidKeyStartDate = -67592, /* The specified key has an invalid start date. */
errSecAppleInvalidKeyEndDate = -67593, /* The specified key has an invalid end date. */
errSecConversionError = -67594, /* A conversion error has occurred. */
errSecAppleSSLv2Rollback = -67595, /* A SSLv2 rollback error has occurred. */
errSecQuotaExceeded = -67596, /* The quota was exceeded. */
errSecFileTooBig = -67597, /* The file is too big. */
errSecInvalidDatabaseBlob = -67598, /* The specified database has an invalid blob. */
errSecInvalidKeyBlob = -67599, /* The specified database has an invalid key blob. */
errSecIncompatibleDatabaseBlob = -67600, /* The specified database has an incompatible blob. */
errSecIncompatibleKeyBlob = -67601, /* The specified database has an incompatible key blob. */
errSecHostNameMismatch = -67602, /* A host name mismatch has occurred. */
errSecUnknownCriticalExtensionFlag = -67603, /* There is an unknown critical extension flag. */
errSecNoBasicConstraints = -67604, /* No basic constraints were found. */
errSecNoBasicConstraintsCA = -67605, /* No basic CA constraints were found. */
errSecInvalidAuthorityKeyID = -67606, /* The authority key ID is not valid. */
errSecInvalidSubjectKeyID = -67607, /* The subject key ID is not valid. */
errSecInvalidKeyUsageForPolicy = -67608, /* The key usage is not valid for the specified policy. */
errSecInvalidExtendedKeyUsage = -67609, /* The extended key usage is not valid. */
errSecInvalidIDLinkage = -67610, /* The ID linkage is not valid. */
errSecPathLengthConstraintExceeded = -67611, /* The path length constraint was exceeded. */
errSecInvalidRoot = -67612, /* The root or anchor certificate is not valid. */
errSecCRLExpired = -67613, /* The CRL has expired. */
errSecCRLNotValidYet = -67614, /* The CRL is not yet valid. */
errSecCRLNotFound = -67615, /* The CRL was not found. */
errSecCRLServerDown = -67616, /* The CRL server is down. */
errSecCRLBadURI = -67617, /* The CRL has a bad Uniform Resource Identifier. */
errSecUnknownCertExtension = -67618, /* An unknown certificate extension was encountered. */
errSecUnknownCRLExtension = -67619, /* An unknown CRL extension was encountered. */
errSecCRLNotTrusted = -67620, /* The CRL is not trusted. */
errSecCRLPolicyFailed = -67621, /* The CRL policy failed. */
errSecIDPFailure = -67622, /* The issuing distribution point was not valid. */
errSecSMIMEEmailAddressesNotFound = -67623, /* An email address mismatch was encountered. */
errSecSMIMEBadExtendedKeyUsage = -67624, /* The appropriate extended key usage for SMIME was not found. */
errSecSMIMEBadKeyUsage = -67625, /* The key usage is not compatible with SMIME. */
errSecSMIMEKeyUsageNotCritical = -67626, /* The key usage extension is not marked as critical. */
errSecSMIMENoEmailAddress = -67627, /* No email address was found in the certificate. */
errSecSMIMESubjAltNameNotCritical = -67628, /* The subject alternative name extension is not marked as critical. */
errSecSSLBadExtendedKeyUsage = -67629, /* The appropriate extended key usage for SSL was not found. */
errSecOCSPBadResponse = -67630, /* The OCSP response was incorrect or could not be parsed. */
errSecOCSPBadRequest = -67631, /* The OCSP request was incorrect or could not be parsed. */
errSecOCSPUnavailable = -67632, /* OCSP service is unavailable. */
errSecOCSPStatusUnrecognized = -67633, /* The OCSP server did not recognize this certificate. */
errSecEndOfData = -67634, /* An end-of-data was detected. */
errSecIncompleteCertRevocationCheck = -67635, /* An incomplete certificate revocation check occurred. */
errSecNetworkFailure = -67636, /* A network failure occurred. */
errSecOCSPNotTrustedToAnchor = -67637, /* The OCSP response was not trusted to a root or anchor certificate. */
errSecRecordModified = -67638, /* The record was modified. */
errSecOCSPSignatureError = -67639, /* The OCSP response had an invalid signature. */
errSecOCSPNoSigner = -67640, /* The OCSP response had no signer. */
errSecOCSPResponderMalformedReq = -67641, /* The OCSP responder was given a malformed request. */
errSecOCSPResponderInternalError = -67642, /* The OCSP responder encountered an internal error. */
errSecOCSPResponderTryLater = -67643, /* The OCSP responder is busy, try again later. */
errSecOCSPResponderSignatureRequired = -67644, /* The OCSP responder requires a signature. */
errSecOCSPResponderUnauthorized = -67645, /* The OCSP responder rejected this request as unauthorized. */
errSecOCSPResponseNonceMismatch = -67646, /* The OCSP response nonce did not match the request. */
errSecCodeSigningBadCertChainLength = -67647, /* Code signing encountered an incorrect certificate chain length. */
errSecCodeSigningNoBasicConstraints = -67648, /* Code signing found no basic constraints. */
errSecCodeSigningBadPathLengthConstraint = -67649, /* Code signing encountered an incorrect path length constraint. */
errSecCodeSigningNoExtendedKeyUsage = -67650, /* Code signing found no extended key usage. */
errSecCodeSigningDevelopment = -67651, /* Code signing indicated use of a development-only certificate. */
errSecResourceSignBadCertChainLength = -67652, /* Resource signing has encountered an incorrect certificate chain length. */
errSecResourceSignBadExtKeyUsage = -67653, /* Resource signing has encountered an error in the extended key usage. */
errSecTrustSettingDeny = -67654, /* The trust setting for this policy was set to Deny. */
errSecInvalidSubjectName = -67655, /* An invalid certificate subject name was encountered. */
errSecUnknownQualifiedCertStatement = -67656, /* An unknown qualified certificate statement was encountered. */
errSecMobileMeRequestQueued = -67657,
errSecMobileMeRequestRedirected = -67658,
errSecMobileMeServerError = -67659,
errSecMobileMeServerNotAvailable = -67660,
errSecMobileMeServerAlreadyExists = -67661,
errSecMobileMeServerServiceErr = -67662,
errSecMobileMeRequestAlreadyPending = -67663,
errSecMobileMeNoRequestPending = -67664,
errSecMobileMeCSRVerifyFailure = -67665,
errSecMobileMeFailedConsistencyCheck = -67666,
errSecNotInitialized = -67667, /* A function was called without initializing CSSM. */
errSecInvalidHandleUsage = -67668, /* The CSSM handle does not match with the service type. */
errSecPVCReferentNotFound = -67669, /* A reference to the calling module was not found in the list of authorized callers. */
errSecFunctionIntegrityFail = -67670, /* A function address was not within the verified module. */
errSecInternalError = -67671, /* An internal error has occurred. */
errSecMemoryError = -67672, /* A memory error has occurred. */
errSecInvalidData = -67673, /* Invalid data was encountered. */
errSecMDSError = -67674, /* A Module Directory Service error has occurred. */
errSecInvalidPointer = -67675, /* An invalid pointer was encountered. */
errSecSelfCheckFailed = -67676, /* Self-check has failed. */
errSecFunctionFailed = -67677, /* A function has failed. */
errSecModuleManifestVerifyFailed = -67678, /* A module manifest verification failure has occurred. */
errSecInvalidGUID = -67679, /* An invalid GUID was encountered. */
errSecInvalidHandle = -67680, /* An invalid handle was encountered. */
errSecInvalidDBList = -67681, /* An invalid DB list was encountered. */
errSecInvalidPassthroughID = -67682, /* An invalid passthrough ID was encountered. */
errSecInvalidNetworkAddress = -67683, /* An invalid network address was encountered. */
errSecCRLAlreadySigned = -67684, /* The certificate revocation list is already signed. */
errSecInvalidNumberOfFields = -67685, /* An invalid number of fields were encountered. */
errSecVerificationFailure = -67686, /* A verification failure occurred. */
errSecUnknownTag = -67687, /* An unknown tag was encountered. */
errSecInvalidSignature = -67688, /* An invalid signature was encountered. */
errSecInvalidName = -67689, /* An invalid name was encountered. */
errSecInvalidCertificateRef = -67690, /* An invalid certificate reference was encountered. */
errSecInvalidCertificateGroup = -67691, /* An invalid certificate group was encountered. */
errSecTagNotFound = -67692, /* The specified tag was not found. */
errSecInvalidQuery = -67693, /* The specified query was not valid. */
errSecInvalidValue = -67694, /* An invalid value was detected. */
errSecCallbackFailed = -67695, /* A callback has failed. */
errSecACLDeleteFailed = -67696, /* An ACL delete operation has failed. */
errSecACLReplaceFailed = -67697, /* An ACL replace operation has failed. */
errSecACLAddFailed = -67698, /* An ACL add operation has failed. */
errSecACLChangeFailed = -67699, /* An ACL change operation has failed. */
errSecInvalidAccessCredentials = -67700, /* Invalid access credentials were encountered. */
errSecInvalidRecord = -67701, /* An invalid record was encountered. */
errSecInvalidACL = -67702, /* An invalid ACL was encountered. */
errSecInvalidSampleValue = -67703, /* An invalid sample value was encountered. */
errSecIncompatibleVersion = -67704, /* An incompatible version was encountered. */
errSecPrivilegeNotGranted = -67705, /* The privilege was not granted. */
errSecInvalidScope = -67706, /* An invalid scope was encountered. */
errSecPVCAlreadyConfigured = -67707, /* The PVC is already configured. */
errSecInvalidPVC = -67708, /* An invalid PVC was encountered. */
errSecEMMLoadFailed = -67709, /* The EMM load has failed. */
errSecEMMUnloadFailed = -67710, /* The EMM unload has failed. */
errSecAddinLoadFailed = -67711, /* The add-in load operation has failed. */
errSecInvalidKeyRef = -67712, /* An invalid key was encountered. */
errSecInvalidKeyHierarchy = -67713, /* An invalid key hierarchy was encountered. */
errSecAddinUnloadFailed = -67714, /* The add-in unload operation has failed. */
errSecLibraryReferenceNotFound = -67715, /* A library reference was not found. */
errSecInvalidAddinFunctionTable = -67716, /* An invalid add-in function table was encountered. */
errSecInvalidServiceMask = -67717, /* An invalid service mask was encountered. */
errSecModuleNotLoaded = -67718, /* A module was not loaded. */
errSecInvalidSubServiceID = -67719, /* An invalid subservice ID was encountered. */
errSecAttributeNotInContext = -67720, /* An attribute was not in the context. */
errSecModuleManagerInitializeFailed = -67721, /* A module failed to initialize. */
errSecModuleManagerNotFound = -67722, /* A module was not found. */
errSecEventNotificationCallbackNotFound = -67723, /* An event notification callback was not found. */
errSecInputLengthError = -67724, /* An input length error was encountered. */
errSecOutputLengthError = -67725, /* An output length error was encountered. */
errSecPrivilegeNotSupported = -67726, /* The privilege is not supported. */
errSecDeviceError = -67727, /* A device error was encountered. */
errSecAttachHandleBusy = -67728, /* The CSP handle was busy. */
errSecNotLoggedIn = -67729, /* You are not logged in. */
errSecAlgorithmMismatch = -67730, /* An algorithm mismatch was encountered. */
errSecKeyUsageIncorrect = -67731, /* The key usage is incorrect. */
errSecKeyBlobTypeIncorrect = -67732, /* The key blob type is incorrect. */
errSecKeyHeaderInconsistent = -67733, /* The key header is inconsistent. */
errSecUnsupportedKeyFormat = -67734, /* The key header format is not supported. */
errSecUnsupportedKeySize = -67735, /* The key size is not supported. */
errSecInvalidKeyUsageMask = -67736, /* The key usage mask is not valid. */
errSecUnsupportedKeyUsageMask = -67737, /* The key usage mask is not supported. */
errSecInvalidKeyAttributeMask = -67738, /* The key attribute mask is not valid. */
errSecUnsupportedKeyAttributeMask = -67739, /* The key attribute mask is not supported. */
errSecInvalidKeyLabel = -67740, /* The key label is not valid. */
errSecUnsupportedKeyLabel = -67741, /* The key label is not supported. */
errSecInvalidKeyFormat = -67742, /* The key format is not valid. */
errSecUnsupportedVectorOfBuffers = -67743, /* The vector of buffers is not supported. */
errSecInvalidInputVector = -67744, /* The input vector is not valid. */
errSecInvalidOutputVector = -67745, /* The output vector is not valid. */
errSecInvalidContext = -67746, /* An invalid context was encountered. */
errSecInvalidAlgorithm = -67747, /* An invalid algorithm was encountered. */
errSecInvalidAttributeKey = -67748, /* A key attribute was not valid. */
errSecMissingAttributeKey = -67749, /* A key attribute was missing. */
errSecInvalidAttributeInitVector = -67750, /* An init vector attribute was not valid. */
errSecMissingAttributeInitVector = -67751, /* An init vector attribute was missing. */
errSecInvalidAttributeSalt = -67752, /* A salt attribute was not valid. */
errSecMissingAttributeSalt = -67753, /* A salt attribute was missing. */
errSecInvalidAttributePadding = -67754, /* A padding attribute was not valid. */
errSecMissingAttributePadding = -67755, /* A padding attribute was missing. */
errSecInvalidAttributeRandom = -67756, /* A random number attribute was not valid. */
errSecMissingAttributeRandom = -67757, /* A random number attribute was missing. */
errSecInvalidAttributeSeed = -67758, /* A seed attribute was not valid. */
errSecMissingAttributeSeed = -67759, /* A seed attribute was missing. */
errSecInvalidAttributePassphrase = -67760, /* A passphrase attribute was not valid. */
errSecMissingAttributePassphrase = -67761, /* A passphrase attribute was missing. */
errSecInvalidAttributeKeyLength = -67762, /* A key length attribute was not valid. */
errSecMissingAttributeKeyLength = -67763, /* A key length attribute was missing. */
errSecInvalidAttributeBlockSize = -67764, /* A block size attribute was not valid. */
errSecMissingAttributeBlockSize = -67765, /* A block size attribute was missing. */
errSecInvalidAttributeOutputSize = -67766, /* An output size attribute was not valid. */
errSecMissingAttributeOutputSize = -67767, /* An output size attribute was missing. */
errSecInvalidAttributeRounds = -67768, /* The number of rounds attribute was not valid. */
errSecMissingAttributeRounds = -67769, /* The number of rounds attribute was missing. */
errSecInvalidAlgorithmParms = -67770, /* An algorithm parameters attribute was not valid. */
errSecMissingAlgorithmParms = -67771, /* An algorithm parameters attribute was missing. */
errSecInvalidAttributeLabel = -67772, /* A label attribute was not valid. */
errSecMissingAttributeLabel = -67773, /* A label attribute was missing. */
errSecInvalidAttributeKeyType = -67774, /* A key type attribute was not valid. */
errSecMissingAttributeKeyType = -67775, /* A key type attribute was missing. */
errSecInvalidAttributeMode = -67776, /* A mode attribute was not valid. */
errSecMissingAttributeMode = -67777, /* A mode attribute was missing. */
errSecInvalidAttributeEffectiveBits = -67778, /* An effective bits attribute was not valid. */
errSecMissingAttributeEffectiveBits = -67779, /* An effective bits attribute was missing. */
errSecInvalidAttributeStartDate = -67780, /* A start date attribute was not valid. */
errSecMissingAttributeStartDate = -67781, /* A start date attribute was missing. */
errSecInvalidAttributeEndDate = -67782, /* An end date attribute was not valid. */
errSecMissingAttributeEndDate = -67783, /* An end date attribute was missing. */
errSecInvalidAttributeVersion = -67784, /* A version attribute was not valid. */
errSecMissingAttributeVersion = -67785, /* A version attribute was missing. */
errSecInvalidAttributePrime = -67786, /* A prime attribute was not valid. */
errSecMissingAttributePrime = -67787, /* A prime attribute was missing. */
errSecInvalidAttributeBase = -67788, /* A base attribute was not valid. */
errSecMissingAttributeBase = -67789, /* A base attribute was missing. */
errSecInvalidAttributeSubprime = -67790, /* A subprime attribute was not valid. */
errSecMissingAttributeSubprime = -67791, /* A subprime attribute was missing. */
errSecInvalidAttributeIterationCount = -67792, /* An iteration count attribute was not valid. */
errSecMissingAttributeIterationCount = -67793, /* An iteration count attribute was missing. */
errSecInvalidAttributeDLDBHandle = -67794, /* A database handle attribute was not valid. */
errSecMissingAttributeDLDBHandle = -67795, /* A database handle attribute was missing. */
errSecInvalidAttributeAccessCredentials = -67796, /* An access credentials attribute was not valid. */
errSecMissingAttributeAccessCredentials = -67797, /* An access credentials attribute was missing. */
errSecInvalidAttributePublicKeyFormat = -67798, /* A public key format attribute was not valid. */
errSecMissingAttributePublicKeyFormat = -67799, /* A public key format attribute was missing. */
errSecInvalidAttributePrivateKeyFormat = -67800, /* A private key format attribute was not valid. */
errSecMissingAttributePrivateKeyFormat = -67801, /* A private key format attribute was missing. */
errSecInvalidAttributeSymmetricKeyFormat = -67802, /* A symmetric key format attribute was not valid. */
errSecMissingAttributeSymmetricKeyFormat = -67803, /* A symmetric key format attribute was missing. */
errSecInvalidAttributeWrappedKeyFormat = -67804, /* A wrapped key format attribute was not valid. */
errSecMissingAttributeWrappedKeyFormat = -67805, /* A wrapped key format attribute was missing. */
errSecStagedOperationInProgress = -67806, /* A staged operation is in progress. */
errSecStagedOperationNotStarted = -67807, /* A staged operation was not started. */
errSecVerifyFailed = -67808, /* A cryptographic verification failure has occurred. */
errSecQuerySizeUnknown = -67809, /* The query size is unknown. */
errSecBlockSizeMismatch = -67810, /* A block size mismatch occurred. */
errSecPublicKeyInconsistent = -67811, /* The public key was inconsistent. */
errSecDeviceVerifyFailed = -67812, /* A device verification failure has occurred. */
errSecInvalidLoginName = -67813, /* An invalid login name was detected. */
errSecAlreadyLoggedIn = -67814, /* The user is already logged in. */
errSecInvalidDigestAlgorithm = -67815, /* An invalid digest algorithm was detected. */
errSecInvalidCRLGroup = -67816, /* An invalid CRL group was detected. */
errSecCertificateCannotOperate = -67817, /* The certificate cannot operate. */
errSecCertificateExpired = -67818, /* An expired certificate was detected. */
errSecCertificateNotValidYet = -67819, /* The certificate is not yet valid. */
errSecCertificateRevoked = -67820, /* The certificate was revoked. */
errSecCertificateSuspended = -67821, /* The certificate was suspended. */
errSecInsufficientCredentials = -67822, /* Insufficient credentials were detected. */
errSecInvalidAction = -67823, /* The action was not valid. */
errSecInvalidAuthority = -67824, /* The authority was not valid. */
errSecVerifyActionFailed = -67825, /* A verify action has failed. */
errSecInvalidCertAuthority = -67826, /* The certificate authority was not valid. */
errSecInvalidCRLAuthority = -67827, /* The CRL authority was not valid. */
errSecInvaldCRLAuthority API_DEPRECATED_WITH_REPLACEMENT("errSecInvalidCRLAuthority", macos(10.11, 12.0), ios(4, 15)) = errSecInvalidCRLAuthority,
errSecInvalidCRLEncoding = -67828, /* The CRL encoding was not valid. */
errSecInvalidCRLType = -67829, /* The CRL type was not valid. */
errSecInvalidCRL = -67830, /* The CRL was not valid. */
errSecInvalidFormType = -67831, /* The form type was not valid. */
errSecInvalidID = -67832, /* The ID was not valid. */
errSecInvalidIdentifier = -67833, /* The identifier was not valid. */
errSecInvalidIndex = -67834, /* The index was not valid. */
errSecInvalidPolicyIdentifiers = -67835, /* The policy identifiers are not valid. */
errSecInvalidTimeString = -67836, /* The time specified was not valid. */
errSecInvalidReason = -67837, /* The trust policy reason was not valid. */
errSecInvalidRequestInputs = -67838, /* The request inputs are not valid. */
errSecInvalidResponseVector = -67839, /* The response vector was not valid. */
errSecInvalidStopOnPolicy = -67840, /* The stop-on policy was not valid. */
errSecInvalidTuple = -67841, /* The tuple was not valid. */
errSecMultipleValuesUnsupported = -67842, /* Multiple values are not supported. */
errSecNotTrusted = -67843, /* The certificate was not trusted. */
errSecNoDefaultAuthority = -67844, /* No default authority was detected. */
errSecRejectedForm = -67845, /* The trust policy had a rejected form. */
errSecRequestLost = -67846, /* The request was lost. */
errSecRequestRejected = -67847, /* The request was rejected. */
errSecUnsupportedAddressType = -67848, /* The address type is not supported. */
errSecUnsupportedService = -67849, /* The service is not supported. */
errSecInvalidTupleGroup = -67850, /* The tuple group was not valid. */
errSecInvalidBaseACLs = -67851, /* The base ACLs are not valid. */
errSecInvalidTupleCredentials = -67852, /* The tuple credentials are not valid. */
errSecInvalidTupleCredendtials API_DEPRECATED_WITH_REPLACEMENT("errSecInvalidTupleCredentials", macos(10.11, 12.0), ios(4, 15)) = errSecInvalidTupleCredentials,
errSecInvalidEncoding = -67853, /* The encoding was not valid. */
errSecInvalidValidityPeriod = -67854, /* The validity period was not valid. */
errSecInvalidRequestor = -67855, /* The requestor was not valid. */
errSecRequestDescriptor = -67856, /* The request descriptor was not valid. */
errSecInvalidBundleInfo = -67857, /* The bundle information was not valid. */
errSecInvalidCRLIndex = -67858, /* The CRL index was not valid. */
errSecNoFieldValues = -67859, /* No field values were detected. */
errSecUnsupportedFieldFormat = -67860, /* The field format is not supported. */
errSecUnsupportedIndexInfo = -67861, /* The index information is not supported. */
errSecUnsupportedLocality = -67862, /* The locality is not supported. */
errSecUnsupportedNumAttributes = -67863, /* The number of attributes is not supported. */
errSecUnsupportedNumIndexes = -67864, /* The number of indexes is not supported. */
errSecUnsupportedNumRecordTypes = -67865, /* The number of record types is not supported. */
errSecFieldSpecifiedMultiple = -67866, /* Too many fields were specified. */
errSecIncompatibleFieldFormat = -67867, /* The field format was incompatible. */
errSecInvalidParsingModule = -67868, /* The parsing module was not valid. */
errSecDatabaseLocked = -67869, /* The database is locked. */
errSecDatastoreIsOpen = -67870, /* The data store is open. */
errSecMissingValue = -67871, /* A missing value was detected. */
errSecUnsupportedQueryLimits = -67872, /* The query limits are not supported. */
errSecUnsupportedNumSelectionPreds = -67873, /* The number of selection predicates is not supported. */
errSecUnsupportedOperator = -67874, /* The operator is not supported. */
errSecInvalidDBLocation = -67875, /* The database location is not valid. */
errSecInvalidAccessRequest = -67876, /* The access request is not valid. */
errSecInvalidIndexInfo = -67877, /* The index information is not valid. */
errSecInvalidNewOwner = -67878, /* The new owner is not valid. */
errSecInvalidModifyMode = -67879, /* The modify mode is not valid. */
errSecMissingRequiredExtension = -67880, /* A required certificate extension is missing. */
errSecExtendedKeyUsageNotCritical = -67881, /* The extended key usage extension was not marked critical. */
errSecTimestampMissing = -67882, /* A timestamp was expected but was not found. */
errSecTimestampInvalid = -67883, /* The timestamp was not valid. */
errSecTimestampNotTrusted = -67884, /* The timestamp was not trusted. */
errSecTimestampServiceNotAvailable = -67885, /* The timestamp service is not available. */
errSecTimestampBadAlg = -67886, /* An unrecognized or unsupported Algorithm Identifier in timestamp. */
errSecTimestampBadRequest = -67887, /* The timestamp transaction is not permitted or supported. */
errSecTimestampBadDataFormat = -67888, /* The timestamp data submitted has the wrong format. */
errSecTimestampTimeNotAvailable = -67889, /* The time source for the Timestamp Authority is not available. */
errSecTimestampUnacceptedPolicy = -67890, /* The requested policy is not supported by the Timestamp Authority. */
errSecTimestampUnacceptedExtension = -67891, /* The requested extension is not supported by the Timestamp Authority. */
errSecTimestampAddInfoNotAvailable = -67892, /* The additional information requested is not available. */
errSecTimestampSystemFailure = -67893, /* The timestamp request cannot be handled due to system failure. */
errSecSigningTimeMissing = -67894, /* A signing time was expected but was not found. */
errSecTimestampRejection = -67895, /* A timestamp transaction was rejected. */
errSecTimestampWaiting = -67896, /* A timestamp transaction is waiting. */
errSecTimestampRevocationWarning = -67897, /* A timestamp authority revocation warning was issued. */
errSecTimestampRevocationNotification = -67898, /* A timestamp authority revocation notification was issued. */
errSecCertificatePolicyNotAllowed = -67899, /* The requested policy is not allowed for this certificate. */
errSecCertificateNameNotAllowed = -67900, /* The requested name is not allowed for this certificate. */
errSecCertificateValidityPeriodTooLong = -67901, /* The validity period in the certificate exceeds the maximum allowed. */
errSecCertificateIsCA = -67902, /* The verified certificate is a CA rather than an end-entity */
errSecCertificateDuplicateExtension = -67903, /* The certificate contains multiple extensions with the same extension ID. */
};
/*!
@enum SecureTransport Error Codes
@abstract Result codes returned from SecureTransport and SecProtocol functions. This is also the domain
for TLS errors in the network stack.
@constant errSSLProtocol SSL protocol error
@constant errSSLNegotiation Cipher Suite negotiation failure
@constant errSSLFatalAlert Fatal alert
@constant errSSLWouldBlock I/O would block (not fatal)
@constant errSSLSessionNotFound attempt to restore an unknown session
@constant errSSLClosedGraceful connection closed gracefully
@constant errSSLClosedAbort connection closed via error
@constant errSSLXCertChainInvalid invalid certificate chain
@constant errSSLBadCert bad certificate format
@constant errSSLCrypto underlying cryptographic error
@constant errSSLInternal Internal error
@constant errSSLModuleAttach module attach failure
@constant errSSLUnknownRootCert valid cert chain, untrusted root
@constant errSSLNoRootCert cert chain not verified by root
@constant errSSLCertExpired chain had an expired cert
@constant errSSLCertNotYetValid chain had a cert not yet valid
@constant errSSLClosedNoNotify server closed session with no notification
@constant errSSLBufferOverflow insufficient buffer provided
@constant errSSLBadCipherSuite bad SSLCipherSuite
@constant errSSLPeerUnexpectedMsg unexpected message received
@constant errSSLPeerBadRecordMac bad MAC
@constant errSSLPeerDecryptionFail decryption failed
@constant errSSLPeerRecordOverflow record overflow
@constant errSSLPeerDecompressFail decompression failure
@constant errSSLPeerHandshakeFail handshake failure
@constant errSSLPeerBadCert misc. bad certificate
@constant errSSLPeerUnsupportedCert bad unsupported cert format
@constant errSSLPeerCertRevoked certificate revoked
@constant errSSLPeerCertExpired certificate expired
@constant errSSLPeerCertUnknown unknown certificate
@constant errSSLIllegalParam illegal parameter
@constant errSSLPeerUnknownCA unknown Cert Authority
@constant errSSLPeerAccessDenied access denied
@constant errSSLPeerDecodeError decoding error
@constant errSSLPeerDecryptError decryption error
@constant errSSLPeerExportRestriction export restriction
@constant errSSLPeerProtocolVersion bad protocol version
@constant errSSLPeerInsufficientSecurity insufficient security
@constant errSSLPeerInternalError internal error
@constant errSSLPeerUserCancelled user canceled
@constant errSSLPeerNoRenegotiation no renegotiation allowed
@constant errSSLPeerAuthCompleted peer cert is valid, or was ignored if verification disabled
@constant errSSLClientCertRequested server has requested a client cert
@constant errSSLHostNameMismatch peer host name mismatch
@constant errSSLConnectionRefused peer dropped connection before responding
@constant errSSLDecryptionFail decryption failure
@constant errSSLBadRecordMac bad MAC
@constant errSSLRecordOverflow record overflow
@constant errSSLBadConfiguration configuration error
@constant errSSLUnexpectedRecord unexpected (skipped) record in DTLS
@constant errSSLWeakPeerEphemeralDHKey weak ephemeral dh key
@constant errSSLClientHelloReceived SNI
@constant errSSLTransportReset transport (socket) shutdown, e.g., TCP RST or FIN.
@constant errSSLNetworkTimeout network timeout triggered
@constant errSSLConfigurationFailed TLS configuration failed
@constant errSSLUnsupportedExtension unsupported TLS extension
@constant errSSLUnexpectedMessage peer rejected unexpected message
@constant errSSLDecompressFail decompression failed
@constant errSSLHandshakeFail handshake failed
@constant errSSLDecodeError decode failed
@constant errSSLInappropriateFallback inappropriate fallback
@constant errSSLMissingExtension missing extension
@constant errSSLBadCertificateStatusResponse bad OCSP response
@constant errSSLCertificateRequired certificate required
@constant errSSLUnknownPSKIdentity unknown PSK identity
@constant errSSLUnrecognizedName unknown or unrecognized name
@constant errSSLATSViolation ATS violation
@constant errSSLATSMinimumVersionViolation ATS violation: minimum protocol version is not ATS compliant
@constant errSSLATSCiphersuiteViolation ATS violation: selected ciphersuite is not ATS compliant
@constant errSSLATSMinimumKeySizeViolation ATS violation: peer key size is not ATS compliant
@constant errSSLATSLeafCertificateHashAlgorithmViolation ATS violation: peer leaf certificate hash algorithm is not ATS compliant
@constant errSSLATSCertificateHashAlgorithmViolation ATS violation: peer certificate hash algorithm is not ATS compliant
@constant errSSLATSCertificateTrustViolation ATS violation: peer certificate is not issued by trusted peer
@constant errSSLEarlyDataRejected Early application data rejected by peer
*/
/*
Note: the comments that appear after these errors are used to create SecErrorMessages.strings.
The comments must not be multi-line, and should be in a form meaningful to an end user. If
a different or additional comment is needed, it can be put in the header doc format, or on a
line that does not start with errZZZ.
*/
CF_ENUM(OSStatus) {
errSSLProtocol = -9800, /* SSL protocol error */
errSSLNegotiation = -9801, /* Cipher Suite negotiation failure */
errSSLFatalAlert = -9802, /* Fatal alert */
errSSLWouldBlock = -9803, /* I/O would block (not fatal) */
errSSLSessionNotFound = -9804, /* attempt to restore an unknown session */
errSSLClosedGraceful = -9805, /* connection closed gracefully */
errSSLClosedAbort = -9806, /* connection closed via error */
errSSLXCertChainInvalid = -9807, /* invalid certificate chain */
errSSLBadCert = -9808, /* bad certificate format */
errSSLCrypto = -9809, /* underlying cryptographic error */
errSSLInternal = -9810, /* Internal error */
errSSLModuleAttach = -9811, /* module attach failure */
errSSLUnknownRootCert = -9812, /* valid cert chain, untrusted root */
errSSLNoRootCert = -9813, /* cert chain not verified by root */
errSSLCertExpired = -9814, /* chain had an expired cert */
errSSLCertNotYetValid = -9815, /* chain had a cert not yet valid */
errSSLClosedNoNotify = -9816, /* server closed session with no notification */
errSSLBufferOverflow = -9817, /* insufficient buffer provided */
errSSLBadCipherSuite = -9818, /* bad SSLCipherSuite */
/* fatal errors detected by peer */
errSSLPeerUnexpectedMsg = -9819, /* unexpected message received */
errSSLPeerBadRecordMac = -9820, /* bad MAC */
errSSLPeerDecryptionFail = -9821, /* decryption failed */
errSSLPeerRecordOverflow = -9822, /* record overflow */
errSSLPeerDecompressFail = -9823, /* decompression failure */
errSSLPeerHandshakeFail = -9824, /* handshake failure */
errSSLPeerBadCert = -9825, /* misc. bad certificate */
errSSLPeerUnsupportedCert = -9826, /* bad unsupported cert format */
errSSLPeerCertRevoked = -9827, /* certificate revoked */
errSSLPeerCertExpired = -9828, /* certificate expired */
errSSLPeerCertUnknown = -9829, /* unknown certificate */
errSSLIllegalParam = -9830, /* illegal parameter */
errSSLPeerUnknownCA = -9831, /* unknown Cert Authority */
errSSLPeerAccessDenied = -9832, /* access denied */
errSSLPeerDecodeError = -9833, /* decoding error */
errSSLPeerDecryptError = -9834, /* decryption error */
errSSLPeerExportRestriction = -9835, /* export restriction */
errSSLPeerProtocolVersion = -9836, /* bad protocol version */
errSSLPeerInsufficientSecurity = -9837, /* insufficient security */
errSSLPeerInternalError = -9838, /* internal error */
errSSLPeerUserCancelled = -9839, /* user canceled */
errSSLPeerNoRenegotiation = -9840, /* no renegotiation allowed */
/* non-fatal result codes */
errSSLPeerAuthCompleted = -9841, /* peer cert is valid, or was ignored if verification disabled */
errSSLClientCertRequested = -9842, /* server has requested a client cert */
/* more errors detected by us */
errSSLHostNameMismatch = -9843, /* peer host name mismatch */
errSSLConnectionRefused = -9844, /* peer dropped connection before responding */
errSSLDecryptionFail = -9845, /* decryption failure */
errSSLBadRecordMac = -9846, /* bad MAC */
errSSLRecordOverflow = -9847, /* record overflow */
errSSLBadConfiguration = -9848, /* configuration error */
errSSLUnexpectedRecord = -9849, /* unexpected (skipped) record in DTLS */
errSSLWeakPeerEphemeralDHKey = -9850, /* weak ephemeral dh key */
/* non-fatal result codes */
errSSLClientHelloReceived = -9851, /* SNI */
/* fatal errors resulting from transport or networking errors */
errSSLTransportReset = -9852, /* transport (socket) shutdown, e.g., TCP RST or FIN. */
errSSLNetworkTimeout = -9853, /* network timeout triggered */
/* fatal errors resulting from software misconfiguration */
errSSLConfigurationFailed = -9854, /* TLS configuration failed */
/* additional errors */
errSSLUnsupportedExtension = -9855, /* unsupported TLS extension */
errSSLUnexpectedMessage = -9856, /* peer rejected unexpected message */
errSSLDecompressFail = -9857, /* decompression failed */
errSSLHandshakeFail = -9858, /* handshake failed */
errSSLDecodeError = -9859, /* decode failed */
errSSLInappropriateFallback = -9860, /* inappropriate fallback */
errSSLMissingExtension = -9861, /* missing extension */
errSSLBadCertificateStatusResponse = -9862, /* bad OCSP response */
errSSLCertificateRequired = -9863, /* certificate required */
errSSLUnknownPSKIdentity = -9864, /* unknown PSK identity */
errSSLUnrecognizedName = -9865, /* unknown or unrecognized name */
/* ATS compliance violation errors */
errSSLATSViolation = -9880, /* ATS violation */
errSSLATSMinimumVersionViolation = -9881, /* ATS violation: minimum protocol version is not ATS compliant */
errSSLATSCiphersuiteViolation = -9882, /* ATS violation: selected ciphersuite is not ATS compliant */
errSSLATSMinimumKeySizeViolation = -9883, /* ATS violation: peer key size is not ATS compliant */
errSSLATSLeafCertificateHashAlgorithmViolation = -9884, /* ATS violation: peer leaf certificate hash algorithm is not ATS compliant */
errSSLATSCertificateHashAlgorithmViolation = -9885, /* ATS violation: peer certificate hash algorithm is not ATS compliant */
errSSLATSCertificateTrustViolation = -9886, /* ATS violation: peer certificate is not issued by trusted peer */
/* early data errors */
errSSLEarlyDataRejected = -9890, /* Early application data rejected by peer */
};
CF_IMPLICIT_BRIDGING_DISABLED
CF_ASSUME_NONNULL_END
__END_DECLS
#endif /* _SECURITY_SECBASE_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecEncryptTransform.h | /*
* Copyright (c) 2010-2011,2013 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
@header SecEncryptTransform
This file defines a SecTransform that will do both asynchronous and synchronous
encryption.
The key that is supplied to the SecTransform determines the type of encryption
to be used.
*/
#if !defined(__SEC_ENCRYPT_TRANSFORM__)
#define __SEC_ENCRYPT_TRANSFORM__ 1
#include <CoreFoundation/CoreFoundation.h>
#include <Security/SecKey.h>
#include <Security/SecTransform.h>
#ifdef __cplusplus
extern "C" {
#endif
CF_ASSUME_NONNULL_BEGIN
CF_IMPLICIT_BRIDGING_ENABLED
/*! @abstract Indicates that no padding will be used when encrypting or decrypting. */
extern const CFStringRef kSecPaddingNoneKey;
/*! Indicates that PKCS1 padding will be used when encrypting or decrypting. */
extern const CFStringRef kSecPaddingPKCS1Key;
/*! Indicates that PKCS5 padding will be used when encrypting or decrypting. */
extern const CFStringRef kSecPaddingPKCS5Key;
/*! Indicates that PKCS7 padding will be used when encrypting or decrypting. */
extern const CFStringRef kSecPaddingPKCS7Key;
/*! Indicates that PKCS7 padding will be used when encrypting or decrypting. */
extern const CFStringRef kSecPaddingOAEPKey
__OSX_AVAILABLE_STARTING(__MAC_10_8,__IPHONE_NA);
/*! Indicates that no mode will be used when encrypting or decrypting. */
extern const CFStringRef kSecModeNoneKey;
/*! Indicates that ECB mode will be used when encrypting or decrypting. */
extern const CFStringRef kSecModeECBKey;
/*! Indicates that CBC mode will be used when encrypting or decrypting. */
extern const CFStringRef kSecModeCBCKey;
/*! Indicates that CFB mode will be used when encrypting or decrypting. */
extern const CFStringRef kSecModeCFBKey;
/*! Indicates that OFB mode will be used when encrypting or decrypting. */
extern const CFStringRef kSecModeOFBKey;
/*!
@abstract
This attribute holds the encryption key for the transform. (ReadOnly)
*/
extern const CFStringRef kSecEncryptKey;
/*!
@abstract
Key for setting padding.
@discussion
This key is optional. If you do not supply a value for this key,
an appropriate value will be supplied for you.
*/
extern const CFStringRef kSecPaddingKey;
/*!
@abstract
Key for setting an initialization vector.
@discussion
This key is optional. If you do not supply a
value for this key, an appropriate value will be supplied for you.
*/
extern const CFStringRef kSecIVKey;
/*!
@abstract
Specifies the encryption mode.
@discussion
This key is optional. If you do not supply this key,
an appropriate value will be supplied for you.
*/
extern const CFStringRef kSecEncryptionMode;
/*!
@abstract
Specifies the OAEP message length.
@discussion
This should be set to a CFNumberRef when the padding is set to OAEP,
and a specific messages size is desired. If unset the minimum padding
will be added. It is ignored when the padding mode is not OAEP.
*/
extern const CFStringRef kSecOAEPMessageLengthAttributeName
__OSX_AVAILABLE_STARTING(__MAC_10_8,__IPHONE_NA);
/*!
@abstract
Specifies the OAEP encoding paramaters
@discussion
This should be set to a CFDataRef when the padding is set to OAEP.
If unset a zero length CFDataRef is used. It is ignored by non
OAEP padding modes.
*/
extern const CFStringRef kSecOAEPEncodingParametersAttributeName
__OSX_AVAILABLE_STARTING(__MAC_10_8,__IPHONE_NA);
/*!
@abstract
Specifies the OAEP MGF1 digest algorithm.
@discussion
This should be set to a digest algorithm when the padding is set to OAEP.
If unset SHA1 is used. It is ifnored by non OAEP padding modes.
*/
extern const CFStringRef kSecOAEPMGF1DigestAlgorithmAttributeName
__OSX_AVAILABLE_STARTING(__MAC_10_8,__IPHONE_NA);
/*!
@function SecEncryptTransformCreate
@abstract Creates an encryption SecTransform object.
@param keyRef The key for the encryption operation
@param error A pointer to a CFErrorRef. This pointer will be set
if an error occurred. This value may be NULL if you
do not want an error returned.
@result A pointer to a SecTransformRef object. This object must
be released with CFRelease when you are done with
it. This function will return NULL if an error
occurred.
@discussion This function creates a transform which encrypts data.
*/
SecTransformRef SecEncryptTransformCreate(SecKeyRef keyRef,
CFErrorRef* error)
__OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_NA);
/*!
@function SecDecryptTransformCreate
@abstract Creates an encryption SecTransform object.
@param keyRef The key for the operation
@param error A pointer to a CFErrorRef. This pointer will be set
if an error occurred. This value may be NULL if you
do not want an error returned.
@result A pointer to a SecTransformRef object. This object must
be released with CFRelease when you are done with
it. This function will return NULL if an error
occurred.
@discussion This function creates a transform which encrypts data.
*/
SecTransformRef SecDecryptTransformCreate(SecKeyRef keyRef,
CFErrorRef* error)
__OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_NA);
/*!
@function SecDecryptTransformGetTypeID
@abstract Returns the CFTypeID for a decrypt transform.
@return the CFTypeID
*/
CFTypeID SecDecryptTransformGetTypeID(void)
__OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_NA);
/*!
@function SecEncryptTransformGetTypeID
@abstract Returns the CFTypeID for a decrypt transform.
@return the CFTypeID
*/
CFTypeID SecEncryptTransformGetTypeID(void)
__OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_NA);
CF_IMPLICIT_BRIDGING_DISABLED
CF_ASSUME_NONNULL_END
#ifdef __cplusplus
};
#endif
#endif /* ! __SEC_ENCRYPT_TRANSFORM__ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/Security.h | /*
* Copyright (c) 2000-2011,2012,2013-2014,2016 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _SECURITY_H_
#define _SECURITY_H_
#include <Security/SecBase.h>
#include <Security/SecCertificate.h>
#include <Security/SecIdentity.h>
#include <Security/SecAccessControl.h>
#include <Security/SecItem.h>
#include <Security/SecKey.h>
#include <Security/SecPolicy.h>
#include <Security/SecRandom.h>
#include <Security/SecImportExport.h>
#include <Security/SecTrust.h>
#include <Security/SecSharedCredential.h>
#include <Security/SecProtocolOptions.h>
#include <Security/SecProtocolMetadata.h>
#if SEC_OS_OSX_INCLUDES
#include <Security/AuthSession.h>
#endif
#if SEC_OS_OSX_INCLUDES
/* CDSA */
#include <Security/cssmconfig.h>
#include <Security/cssmapple.h>
#include <Security/certextensions.h>
#include <Security/cssm.h>
#include <Security/cssmaci.h>
#include <Security/cssmapi.h>
#include <Security/cssmcli.h>
#include <Security/cssmcspi.h>
#include <Security/cssmdli.h>
#include <Security/cssmerr.h>
#include <Security/cssmkrapi.h>
#include <Security/cssmkrspi.h>
#include <Security/cssmspi.h>
#include <Security/cssmtpi.h>
#include <Security/cssmtype.h>
#include <Security/emmspi.h>
#include <Security/emmtype.h>
#include <Security/mds.h>
#include <Security/mds_schema.h>
#include <Security/oidsalg.h>
#include <Security/oidsattr.h>
#include <Security/oidsbase.h>
#include <Security/oidscert.h>
#include <Security/oidscrl.h>
#include <Security/x509defs.h>
/* Security */
#include <Security/SecAccess.h>
#include <Security/SecACL.h>
#include <Security/SecCertificateOIDs.h>
#include <Security/SecIdentitySearch.h>
#include <Security/SecKeychain.h>
#include <Security/SecKeychainItem.h>
#include <Security/SecKeychainSearch.h>
#include <Security/SecPolicySearch.h>
#include <Security/SecTrustedApplication.h>
#include <Security/SecTrustSettings.h>
/* Code Signing */
#include <Security/SecStaticCode.h>
#include <Security/SecCode.h>
#include <Security/SecCodeHost.h>
#include <Security/SecRequirement.h>
#include <Security/SecTask.h>
/* Authorization */
#include <Security/Authorization.h>
#include <Security/AuthorizationTags.h>
#include <Security/AuthorizationDB.h>
/* CMS */
#include <Security/CMSDecoder.h>
#include <Security/CMSEncoder.h>
/* Secure Transport */
#include <Security/CipherSuite.h>
#include <Security/SecureTransport.h>
#ifdef __BLOCKS__
#include <Security/SecTransform.h>
#include <Security/SecCustomTransform.h>
#include <Security/SecDecodeTransform.h>
#include <Security/SecDigestTransform.h>
#include <Security/SecEncodeTransform.h>
#include <Security/SecEncryptTransform.h>
#include <Security/SecSignVerifyTransform.h>
#include <Security/SecReadTransform.h>
#endif
/* DER */
#include <Security/oids.h>
#endif // SEC_OS_OSX
#endif // _SECURITY_H_
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecStaticCode.h | /*
* Copyright (c) 2006,2011-2014 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
@header SecStaticCode
SecStaticCode represents the Code Signing identity of code in the file system.
This includes applications, tools, frameworks, plugins, scripts, and so on.
Note that arbitrary files will be considered scripts of unknown provenance;
and thus it is possible to handle most files as if they were code, though that is
not necessarily a good idea.
Normally, each SecCode has a specific SecStaticCode that holds its static signing
data. Informally, that is the SecStaticCode the SecCode "was made from" (by its host).
There is however no viable link in the other direction - given a SecStaticCode,
it is not possible to find, enumerate, or control any SecCode that originated from it.
There might not be any at a given point in time; or there might be many.
*/
#ifndef _H_SECSTATICCODE
#define _H_SECSTATICCODE
#include <Security/CSCommon.h>
#ifdef __cplusplus
extern "C" {
#endif
CF_ASSUME_NONNULL_BEGIN
/*!
@function SecStaticCodeGetTypeID
Returns the type identifier of all SecStaticCode instances.
*/
CFTypeID SecStaticCodeGetTypeID(void);
/*!
@function SecStaticCodeCreateWithPath
Given a path to a file system object, create a SecStaticCode object representing
the code at that location, if possible. Such a SecStaticCode is not inherently
linked to running code in the system.
It is possible to create a SecStaticCode object from an unsigned code object.
Most uses of such an object will return the errSecCSUnsigned error. However,
SecCodeCopyPath and SecCodeCopySigningInformation can be safely applied to such objects.
@param path A path to a location in the file system. Only file:// URLs are
currently supported. For bundles, pass a URL to the root directory of the
bundle. For single files, pass a URL to the file. If you pass a URL to the
main executable of a bundle, the bundle as a whole will be generally recognized.
Caution: Paths containing embedded // or /../ within a bundle's directory
may cause the bundle to be misconstrued. If you expect to submit such paths,
first clean them with realpath(3) or equivalent.
@param flags Optional flags. Pass kSecCSDefaultFlags for standard behavior.
@param staticCode On successful return, contains a reference to the StaticCode object
representing the code at path. Unchanged on error.
@result Upon success, errSecSuccess. Upon error, an OSStatus value documented in
CSCommon.h or certain other Security framework headers.
*/
OSStatus SecStaticCodeCreateWithPath(CFURLRef path, SecCSFlags flags, SecStaticCodeRef * __nonnull CF_RETURNS_RETAINED staticCode);
extern const CFStringRef kSecCodeAttributeArchitecture;
extern const CFStringRef kSecCodeAttributeSubarchitecture;
extern const CFStringRef kSecCodeAttributeUniversalFileOffset;
extern const CFStringRef kSecCodeAttributeBundleVersion;
/*!
@function SecStaticCodeCreateWithPathAndAttributes
Given a path to a file system object, create a SecStaticCode object representing
the code at that location, if possible. Such a SecStaticCode is not inherently
linked to running code in the system.
It is possible to create a SecStaticCode object from an unsigned code object.
Most uses of such an object will return the errSecCSUnsigned error. However,
SecCodeCopyPath and SecCodeCopySigningInformation can be safely applied to such objects.
@param path A path to a location in the file system. Only file:// URLs are
currently supported. For bundles, pass a URL to the root directory of the
bundle. For single files, pass a URL to the file. If you pass a URL to the
main executable of a bundle, the bundle as a whole will be generally recognized.
Caution: Paths containing embedded // or /../ within a bundle's directory
may cause the bundle to be misconstrued. If you expect to submit such paths,
first clean them with realpath(3) or equivalent.
@param flags Optional flags. Pass kSecCSDefaultFlags for standard behavior.
@param attributes A CFDictionary containing additional attributes of the code sought.
@param staticCode On successful return, contains a reference to the StaticCode object
representing the code at path. Unchanged on error.
@result Upon success, errSecSuccess. Upon error, an OSStatus value documented in
CSCommon.h or certain other Security framework headers.
@constant kSecCodeAttributeArchitecture Specifies the Mach-O architecture of code desired.
This can be a CFString containing a canonical architecture name ("i386" etc.), or a CFNumber
specifying an architecture numerically (see mach/machine.h). This key is ignored if the code
is not in Mach-O binary form. If the code is Mach-O but not universal ("thin"), the architecture
specified must agree with the actual file contents.
@constant kSecCodeAttributeSubarchitecture If the architecture is specified numerically
(using the kSecCodeAttributeArchitecture key), specifies any sub-architecture by number.
This key is ignored if no main architecture is specified; if it is specified by name; or
if the code is not in Mach-O form.
@constant kSecCodeAttributeUniversalFileOffset The offset of a Mach-O specific slice of a universal Mach-O file.
@constant kSecCodeAttributeBundleVersion If the code sought is a deep framework bundle (Something.framework/Versions/...),
then select the specified framework version. This key is otherwise ignored.
*/
OSStatus SecStaticCodeCreateWithPathAndAttributes(CFURLRef path, SecCSFlags flags, CFDictionaryRef attributes,
SecStaticCodeRef * __nonnull CF_RETURNS_RETAINED staticCode);
/*!
@function SecStaticCodeCheckValidity
Performs static validation on the given SecStaticCode object. The call obtains and
verifies the signature on the code object. It checks the validity of all
sealed components (including resources, if any). It validates the code against
a SecRequirement if one is given. The call succeeds if all these conditions
are satisfactory. It fails otherwise.
This call is only secure if the code is not subject to concurrent modification,
and the outcome is only valid as long as the code is unmodified thereafter.
Consider this carefully if the underlying file system has dynamic characteristics,
such as a network file system, union mount, FUSE, etc.
@param staticCode The code object to be validated.
@param flags Optional flags. Pass kSecCSDefaultFlags for standard behavior.
@constant kSecCSCheckAllArchitectures
For multi-architecture (universal) Mach-O programs, validate all architectures
included. By default, only the native architecture is validated.
@constant kSecCSDoNotValidateExecutable
Do not validate the contents of the main executable. This is normally done.
@constant kSecCSDoNotValidateResources
Do not validate the presence and contents of all bundle resources (if any).
By default, a mismatch in any bundle resource causes validation to fail.
@constant kSecCSCheckNestedCode
For code in bundle form, locate and recursively check embedded code. Only code
in standard locations is considered.
@constant kSecCSStrictValidate
For code in bundle form, perform additional checks to verify that the bundle
is not structured in a way that would allow tampering, and reject any resource
envelope that introduces weaknesses into the signature.
@constant kSecCSSingleThreaded
Perform all resource validation serially on a single thread instead of dispatching
work in parallel.
@constant kSecCSAllowNetworkAccess
Enables network access for certificate trust evaluation performed while validating the
bundle or its contents.
@param requirement On optional code requirement specifying additional conditions
the staticCode object must satisfy to be considered valid. If NULL, no additional
requirements are imposed.
@param errors An optional pointer to a CFErrorRef variable. If the call fails
(something other than errSecSuccess is returned), and this argument is non-NULL,
a CFErrorRef is stored there further describing the nature and circumstances
of the failure. The caller must CFRelease() this error object when done with it.
@result If validation succeeds, errSecSuccess. If validation fails, an OSStatus value
documented in CSCommon.h or certain other Security framework headers.
*/
CF_ENUM(uint32_t) {
kSecCSCheckAllArchitectures = 1 << 0,
kSecCSDoNotValidateExecutable = 1 << 1,
kSecCSDoNotValidateResources = 1 << 2,
kSecCSBasicValidateOnly = kSecCSDoNotValidateExecutable | kSecCSDoNotValidateResources,
kSecCSCheckNestedCode = 1 << 3,
kSecCSStrictValidate = 1 << 4,
kSecCSFullReport = 1 << 5,
kSecCSCheckGatekeeperArchitectures = (1 << 6) | kSecCSCheckAllArchitectures,
kSecCSRestrictSymlinks = 1 << 7,
kSecCSRestrictToAppLike = 1 << 8,
kSecCSRestrictSidebandData = 1 << 9,
kSecCSUseSoftwareSigningCert = 1 << 10,
kSecCSValidatePEH = 1 << 11,
kSecCSSingleThreaded = 1 << 12,
// NOTE: These values have gaps for internal usage.
kSecCSAllowNetworkAccess CF_ENUM_AVAILABLE(11_3, 14_5) = 1 << 16,
kSecCSFastExecutableValidation CF_ENUM_AVAILABLE(11_3, 14_5) = 1 << 17,
};
OSStatus SecStaticCodeCheckValidity(SecStaticCodeRef staticCode, SecCSFlags flags,
SecRequirementRef __nullable requirement);
OSStatus SecStaticCodeCheckValidityWithErrors(SecStaticCodeRef staticCode, SecCSFlags flags,
SecRequirementRef __nullable requirement, CFErrorRef *errors);
CF_ASSUME_NONNULL_END
#ifdef __cplusplus
}
#endif
#endif //_H_SECSTATICCODE
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/cssmkrapi.h | /*
* Copyright (c) 1999-2001,2004,2011,2014 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*
* cssmkrapi.h -- Application Programmers Interface for Key Recovery Modules
*/
#ifndef _CSSMKRAPI_H_
#define _CSSMKRAPI_H_ 1
#include <Security/cssmtype.h>
#ifdef __cplusplus
extern "C" {
#endif
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
typedef uint32 CSSM_KRSP_HANDLE; /* Key Recovery Service Provider Handle */
typedef struct cssm_kr_name {
uint8 Type; /* namespace type */
uint8 Length; /* name string length */
char *Name; /* name string */
} CSSM_KR_NAME DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_kr_profile {
CSSM_KR_NAME UserName; /* name of the user */
CSSM_CERTGROUP_PTR UserCertificate; /* public key certificate of the user */
CSSM_CERTGROUP_PTR KRSCertChain; /* cert chain for the KRSP coordinator */
uint8 LE_KRANum; /* number of KRA cert chains in the following list */
CSSM_CERTGROUP_PTR LE_KRACertChainList; /* list of Law enforcement KRA certificate chains */
uint8 ENT_KRANum; /* number of KRA cert chains in the following list */
CSSM_CERTGROUP_PTR ENT_KRACertChainList; /* list of Enterprise KRA certificate chains */
uint8 INDIV_KRANum; /* number of KRA cert chains in the following list */
CSSM_CERTGROUP_PTR INDIV_KRACertChainList; /* list of Individual KRA certificate chains */
CSSM_DATA_PTR INDIV_AuthenticationInfo; /* authentication information for individual key recovery */
uint32 KRSPFlags; /* flag values to be interpreted by KRSP */
CSSM_DATA_PTR KRSPExtensions; /* reserved for extensions specific to KRSPs */
} CSSM_KR_PROFILE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_KR_PROFILE_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_kr_wrappedproductinfo {
CSSM_VERSION StandardVersion;
CSSM_STRING StandardDescription;
CSSM_VERSION ProductVersion;
CSSM_STRING ProductDescription;
CSSM_STRING ProductVendor;
uint32 ProductFlags;
} CSSM_KR_WRAPPEDPRODUCT_INFO DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_KR_WRAPPEDPRODUCT_INFO_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_krsubservice {
uint32 SubServiceId;
char *Description; /* Description of this sub service */
CSSM_KR_WRAPPEDPRODUCT_INFO WrappedProduct;
} CSSM_KRSUBSERVICE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_KRSUBSERVICE_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef uint32 CSSM_KR_POLICY_TYPE;
#define CSSM_KR_INDIV_POLICY (0x00000001)
#define CSSM_KR_ENT_POLICY (0x00000002)
#define CSSM_KR_LE_MAN_POLICY (0x00000003)
#define CSSM_KR_LE_USE_POLICY (0x00000004)
typedef uint32 CSSM_KR_POLICY_FLAGS;
#define CSSM_KR_INDIV (0x00000001)
#define CSSM_KR_ENT (0x00000002)
#define CSSM_KR_LE_MAN (0x00000004)
#define CSSM_KR_LE_USE (0x00000008)
#define CSSM_KR_LE (CSSM_KR_LE_MAN | CSSM_KR_LE_USE)
#define CSSM_KR_OPTIMIZE (0x00000010)
#define CSSM_KR_DROP_WORKFACTOR (0x00000020)
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_kr_policy_list_item {
struct kr_policy_list_item *next;
CSSM_ALGORITHMS AlgorithmId;
CSSM_ENCRYPT_MODE Mode;
uint32 MaxKeyLength;
uint32 MaxRounds;
uint8 WorkFactor;
CSSM_KR_POLICY_FLAGS PolicyFlags;
CSSM_CONTEXT_TYPE AlgClass;
} CSSM_KR_POLICY_LIST_ITEM DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_KR_POLICY_LIST_ITEM_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_kr_policy_info {
CSSM_BOOL krbNotAllowed;
uint32 numberOfEntries;
CSSM_KR_POLICY_LIST_ITEM *policyEntry;
} CSSM_KR_POLICY_INFO DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_KR_POLICY_INFO_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
#pragma clang diagnostic pop
#ifdef __cplusplus
}
#endif
#endif /* _CSSMKRAPI_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecTransformReadTransform.h | /*
* Copyright (c) 2010-2011 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _SEC_TRANSFORM_READ_TRANSFORM_H
#define _SEC_TRANSFORM_READ_TRANSFORM_H
#ifdef __cplusplus
extern "C" {
#endif
#include <Security/SecTransform.h>
CF_ASSUME_NONNULL_BEGIN
CF_IMPLICIT_BRIDGING_ENABLED
/*!
@header
The read transform reads bytes from a instance. The bytes are
sent as CFDataRef instances to the OUTPUT attribute of the
transform.
This transform recognizes the following additional attributes
that can be used to modify its behavior:
MAX_READSIZE (expects CFNumber): changes the maximum number of
bytes the transform will attempt to read from the stream. Note
that the transform may deliver fewer bytes than this depending
on the stream being used.
*/
/*!
@function SecTransformCreateReadTransformWithReadStream
@abstract Creates a read transform from a CFReadStreamRef
@param inputStream The stream that is to be opened and read from when
the chain executes.
*/
SecTransformRef SecTransformCreateReadTransformWithReadStream(CFReadStreamRef inputStream)
__OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_NA);
CF_IMPLICIT_BRIDGING_DISABLED
CF_ASSUME_NONNULL_END
#ifdef __cplusplus
};
#endif
#endif
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecTrustSettings.h | /*
* Copyright (c) 2006,2007,2011,2012,2014-2016 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
@header SecTrustSettings
The functions and data types in SecTrustSettings implement a way to
set and retrive trustability of certificates.
*/
#ifndef _SECURITY_SECTRUSTSETTINGS_H_
#define _SECURITY_SECTRUSTSETTINGS_H_
#include <CoreFoundation/CoreFoundation.h>
#include <CoreFoundation/CFArray.h>
#include <Security/SecBase.h>
#include <Security/SecCertificate.h>
#if SEC_OS_OSX
#include <Security/SecKeychain.h>
#include <Security/SecPolicy.h>
#include <Security/cssmtype.h>
#endif /* SEC_OS_OSX */
__BEGIN_DECLS
#if SEC_OS_OSX_INCLUDES
CF_ASSUME_NONNULL_BEGIN
#endif
/*
* Any certificate (cert) which resides in a keychain can have associated with
* it a set of Trust Settings. Trust Settings specify conditions in which a
* given cert can be trusted or explicitly distrusted. A "trusted" cert is
* either a root (self-signed) cert that, when a cert chain verifies back to that
* root, the entire cert chain is trusted; or a non-root cert that does not need
* to verify to a trusted root cert (which is normally the case when verifying a
* cert chain). An "explicitly distrusted" cert is one which will, when encountered
* during the evaluation of a cert chain, cause immediate and unconditional failure
* of the verify operation.
*
* Trust Settings are configurable by the user; they can apply on three levels
* (called domains):
*
* -- Per-user.
* -- Locally administered, system-wide. Administrator privileges are required
* to make changes to this domain.
* -- System. These Trust Settings are immutable and comprise the set of trusted
* root certificates supplied in Mac OS X.
*
* Per-user Trust Settings override locally administered Trust Settings, which
* in turn override the System Trust Settings.
*
* Each cert's Trust Settings are expressed as a CFArray which includes any
* number (including zero) of CFDictionaries, each of which comprises one set of
* Usage Constraints. Each Usage Constraints dictionary contains zero or one of
* each the following components:
*
* key = kSecTrustSettingsPolicy On OSX, value = SecPolicyRef
On iOS, value = policy OID as CFString
*
* key = kSecTrustSettingsApplication value = SecTrustedApplicationRef
* key = kSecTrustSettingsPolicyString value = CFString, policy-specific
* key = kSecTrustSettingsKeyUsage value = CFNumber, an SInt32 key usage
*
* A given Usage Constraints dictionary applies to a given cert if *all* of the
* usage constraint components specified in the dictionary match the usage of
* the cert being evaluated; when this occurs, the value of the
* kSecTrustSettingsResult entry in the dictionary, shown below, is the effective
* trust setting for the cert.
*
* key = kSecTrustSettingsResult value = CFNumber, an SInt32 SecTrustSettingsResult
*
* The overall Trust Settings of a given cert are the sum of all such Usage
* Constraints CFDictionaries: Trust Settings for a given usage apply if *any*
* of the CFDictionaries in the cert's Trust Settings array satisfies
* the specified usage. Thus, when a cert has multiple Usage Constraints
* dictionaries in its Trust Settings array, the overall Trust Settings
* for the cert are
*
* (Usage Constraint 0 component 0 AND Usage Constraint 0 component 1 ...)
* -- OR --
* (Usage Constraint 1 component 0 AND Usage Constraint 1 component 1 ...)
* -- OR --
* ...
*
* Notes on the various Usage Constraints components:
*
* kSecTrustSettingsPolicy Specifies a cert verification policy, e.g., SSL,
* SMIME, etc, using Policy Constants
* kSecTrustSettingsApplication Specifies the application performing the cert
* verification.
* kSecTrustSettingsPolicyString Policy-specific. For the SMIME policy, this is
* an email address.
* For the SSL policy, this is a host name.
* kSecTrustSettingsKeyUsage A bitfield indicating key operations (sign,
* encrypt, etc.) for which this Usage Constraint
* apply. Values are defined below as the
* SecTrustSettingsKeyUsage enum.
* kSecTrustSettingsResult The resulting trust value. If not present this has a
* default of kSecTrustSettingsResultTrustRoot, meaning
* "trust this root cert". Other legal values are:
* kSecTrustSettingsResultTrustAsRoot : trust non-root
* cert as if it were a trusted root.
* kSecTrustSettingsResultDeny : explicitly distrust this
* cert.
* kSecTrustSettingsResultUnspecified : neither trust nor
* distrust; can be used to specify an "Allowed error"
* (see below) without assigning trust to a specific
* cert.
*
* Another optional component in a Usage Constraints dictionary is a CSSM_RETURN
* which, if encountered during certificate verification, is ignored for that
* cert. These "allowed error" values are constrained by Usage Constraints as
* described above; a Usage Constraint dictionary with no constraints but with
* an Allowed Error value causes that error to always be allowed when the cert
* is being evaluated.
*
* The "allowed error" entry in a Usage Constraints dictionary is formatted
* as follows:
*
* key = kSecTrustSettingsAllowedError value = CFNumber, an SInt32 CSSM_RETURN
*
* Note that if kSecTrustSettingsResult value of kSecTrustSettingsResultUnspecified
* is *not* present for a Usage Constraints dictionary with no Usage
* Constraints, the default of kSecTrustSettingsResultTrustRoot is assumed. To
* specify a kSecTrustSettingsAllowedError without explicitly trusting (or
* distrusting) the associated cert, specify kSecTrustSettingsResultUnspecified
* for the kSecTrustSettingsResult component.
*
* Note that an empty Trust Settings array means "always trust this cert,
* with a resulting kSecTrustSettingsResult of kSecTrustSettingsResultTrustRoot".
* An empty Trust Settings array is definitely not the same as *no* Trust
* Settings, which means "this cert must be verified to a known trusted cert".
*
* Note the distinction between kSecTrustSettingsResultTrustRoot and
* kSecTrustSettingsResultTrustAsRoot; the former can only be applied to
* root (self-signed) certs; the latter can only be applied to non-root
* certs. This also means that an empty TrustSettings array for a non-root
* cert is invalid, since the default value for kSecTrustSettingsResult is
* kSecTrustSettingsResultTrustRoot, which is invalid for a non-root cert.
*
* Authentication
* --------------
*
* When making changes to the per-user Trust Settings, the user will be
* prompted with an alert panel asking for authentication via user name a
* password (or other credentials normally used for login). This means
* that it is not possible to modify per-user Trust Settings when not
* running in a GUI environment (i.e. the user is not logged in via
* Loginwindow).
*
* When making changes to the system-wide Trust Settings, the user will be
* prompted with an alert panel asking for an administrator's name and
* password, unless the calling process is running as root in which case
* no futher authentication is needed.
*/
/*
* The keys in one Usage Constraints dictionary.
*/
#define kSecTrustSettingsPolicy CFSTR("kSecTrustSettingsPolicy")
#define kSecTrustSettingsApplication CFSTR("kSecTrustSettingsApplication")
#define kSecTrustSettingsPolicyString CFSTR("kSecTrustSettingsPolicyString")
#define kSecTrustSettingsKeyUsage CFSTR("kSecTrustSettingsKeyUsage")
#define kSecTrustSettingsAllowedError CFSTR("kSecTrustSettingsAllowedError")
#define kSecTrustSettingsResult CFSTR("kSecTrustSettingsResult")
/*
* Key usage bits, the value for Usage Constraints key kSecTrustSettingsKeyUsage.
*/
typedef CF_OPTIONS(uint32_t, SecTrustSettingsKeyUsage) {
/* sign/verify data */
kSecTrustSettingsKeyUseSignature = 0x00000001,
/* bulk encryption */
kSecTrustSettingsKeyUseEnDecryptData = 0x00000002,
/* key wrap/unwrap */
kSecTrustSettingsKeyUseEnDecryptKey = 0x00000004,
/* sign/verify cert */
kSecTrustSettingsKeyUseSignCert = 0x00000008,
/* sign/verify CRL and OCSP */
kSecTrustSettingsKeyUseSignRevocation = 0x00000010,
/* key exchange, e.g., Diffie-Hellman */
kSecTrustSettingsKeyUseKeyExchange = 0x00000020,
/* any usage (the default if this value is not specified) */
kSecTrustSettingsKeyUseAny = 0xffffffff
};
/*!
@enum SecTrustSettingsResult
@abstract Result of a trust settings evaluation.
*/
typedef CF_ENUM(uint32_t, SecTrustSettingsResult) {
kSecTrustSettingsResultInvalid = 0, /* Never valid in a Trust Settings array or
* in an API call. */
kSecTrustSettingsResultTrustRoot, /* Root cert is explicitly trusted */
kSecTrustSettingsResultTrustAsRoot, /* Non-root cert is explicitly trusted */
kSecTrustSettingsResultDeny, /* Cert is explicitly distrusted */
kSecTrustSettingsResultUnspecified /* Neither trusted nor distrusted; evaluation
* proceeds as usual */
};
/*
* Specify user, local administrator, or system domain Trust Settings.
* Note that kSecTrustSettingsDomainSystem settings are read-only, even by
* root.
*/
typedef CF_ENUM(uint32_t, SecTrustSettingsDomain) {
kSecTrustSettingsDomainUser = 0,
kSecTrustSettingsDomainAdmin,
kSecTrustSettingsDomainSystem
};
/*
* This constant is deprecated and ineffective as of macOS 10.12.
* Please discontinue use.
*/
#define kSecTrustSettingsDefaultRootCertSetting ((SecCertificateRef)-1)
#if SEC_OS_OSX_INCLUDES
/*
* Obtain Trust Settings for specified cert.
* Caller must CFRelease() the returned CFArray.
* Returns errSecItemNotFound if no Trust settings exist for the cert.
*/
OSStatus SecTrustSettingsCopyTrustSettings(
SecCertificateRef certRef,
SecTrustSettingsDomain domain,
CFArrayRef * __nonnull CF_RETURNS_RETAINED trustSettings); /* RETURNED */
/*
* Specify Trust Settings for specified cert. If specified cert
* already has Trust Settings in the specified domain, they will
* be replaced.
* The trustSettingsDictOrArray parameter is either a CFDictionary,
* a CFArray of them, or NULL. NULL indicates "always trust this
* root cert regardless of usage".
*/
OSStatus SecTrustSettingsSetTrustSettings(
SecCertificateRef certRef,
SecTrustSettingsDomain domain,
CFTypeRef __nullable trustSettingsDictOrArray);
/*
* Delete Trust Settings for specified cert.
* Returns errSecItemNotFound if no Trust settings exist for the cert.
*/
OSStatus SecTrustSettingsRemoveTrustSettings(
SecCertificateRef certRef,
SecTrustSettingsDomain domain);
/*
* Obtain an array of all certs which have Trust Settings in the
* specified domain. Elements in the returned certArray are
* SecCertificateRefs.
* Caller must CFRelease() the returned array.
* Returns errSecNoTrustSettings if no trust settings exist
* for the specified domain.
*/
OSStatus SecTrustSettingsCopyCertificates(
SecTrustSettingsDomain domain,
CFArrayRef * __nullable CF_RETURNS_RETAINED certArray);
/*
* Obtain the time at which a specified cert's Trust Settings
* were last modified. Caller must CFRelease the result.
* Returns errSecItemNotFound if no Trust Settings exist for specified
* cert and domain.
*/
OSStatus SecTrustSettingsCopyModificationDate(
SecCertificateRef certRef,
SecTrustSettingsDomain domain,
CFDateRef * __nonnull CF_RETURNS_RETAINED modificationDate); /* RETURNED */
/*
* Obtain an external, portable representation of the specified
* domain's TrustSettings. Caller must CFRelease the returned data.
* Returns errSecNoTrustSettings if no trust settings exist
* for the specified domain.
*/
OSStatus SecTrustSettingsCreateExternalRepresentation(
SecTrustSettingsDomain domain,
CFDataRef * __nonnull CF_RETURNS_RETAINED trustSettings);
/*
* Import trust settings, obtained via SecTrustSettingsCreateExternalRepresentation,
* into the specified domain.
*/
OSStatus SecTrustSettingsImportExternalRepresentation(
SecTrustSettingsDomain domain,
CFDataRef trustSettings);
CF_ASSUME_NONNULL_END
#endif /* SEC_OS_OSX_INCLUDES */
__END_DECLS
#endif /* _SECURITY_SECTRUSTSETTINGS_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/AuthSession.h | /*
* Copyright (c) 2000-2003,2011,2013-2014 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
* AuthSession.h
* AuthSession - APIs for managing login, authorization, and security Sessions.
*/
#if !defined(__AuthSession__)
#define __AuthSession__ 1
#include <Security/Authorization.h>
#if defined(__cplusplus)
extern "C" {
#endif
CF_ASSUME_NONNULL_BEGIN
/*!
@header AuthSession
The Session API provides specialized applications access to Session management and inquiry
functions. This is a specialized API that should not be of interest to most people.
The Security subsystem separates all processes into Security "sessions". Each process is in
exactly one session, and session membership inherits across fork/exec. Sessions form boundaries
for security-related state such as authorizations, keychain lock status, and the like.
Typically, each successful login (whether graphical or through ssh & friends) creates
a separate session. System daemons (started at system startup) belong to the "root session"
which has no user nor graphics access.
Sessions are identified with SecuritySessionIds. A session has a set of attributes
that are set on creation and can be retrieved with SessionGetInfo().
There are similar session concepts in the system, related but not necessarily
completely congruous. In particular, graphics sessions track security sessions
(but only for graphic logins).
*/
/*!
@typedef SecuritySessionId
These are externally visible identifiers for authorization sessions.
Different sessions have different identifiers; beyond that, you can't
tell anything from these values.
SessionIds can be compared for equality as you'd expect, but you should be careful
to use attribute bits wherever appropriate.
*/
typedef UInt32 SecuritySessionId;
/*!
@enum SecuritySessionId
Here are some special values for SecuritySessionId. You may specify those
on input to SessionAPI functions. They will never be returned from such
functions.
Note: -2 is reserved (see 4487137).
*/
CF_ENUM(SecuritySessionId) {
noSecuritySession = 0, /* definitely not a valid SecuritySessionId */
callerSecuritySession = ((SecuritySessionId)-1) /* the Session I (the caller) am in */
};
/*!
@enum SessionAttributeBits
Each Session has a set of attribute bits. You can get those from the
SessionGetInfo API function.
*/
typedef CF_OPTIONS(UInt32, SessionAttributeBits) {
sessionIsRoot = 0x0001, /* is the root session (startup/system programs) */
sessionHasGraphicAccess = 0x0010, /* graphic subsystem (CoreGraphics et al) available */
sessionHasTTY = 0x0020, /* /dev/tty is available */
sessionIsRemote = 0x1000, /* session was established over the network */
};
/*!
@enum SessionCreationFlags
These flags control how a new session is created by SessionCreate.
They have no permanent meaning beyond that.
*/
typedef CF_OPTIONS(UInt32, SessionCreationFlags) {
sessionKeepCurrentBootstrap = 0x8000 /* caller has allocated sub-bootstrap (expert use only) */
};
/*!
@enum SessionStatus
Error codes returned by AuthSession API.
Note that the AuthSession APIs can also return Authorization API error codes.
*/
CF_ENUM(OSStatus) {
errSessionSuccess = 0, /* all is well */
errSessionInvalidId = -60500, /* invalid session id specified */
errSessionInvalidAttributes = -60501, /* invalid set of requested attribute bits */
errSessionAuthorizationDenied = -60502, /* you are not allowed to do this */
errSessionValueNotSet = -60503, /* the session attribute you requested has not been set */
errSessionInternal = -60008, /* internal error */
errSessionInvalidFlags = -60011, /* invalid flags/options */
};
/*!
@function SessionGetInfo
Obtain information about a session. You can ask about any session whose
identifier you know. Use the callerSecuritySession constant to ask about
your own session (the one your process is in).
@param session (input) The Session you are asking about. Can be one of the
special constants defined above.
@param sessionId (output/optional) The actual SecuritySessionId for the session you asked about.
Will never be one of those constants.
@param attributes (output/optional) Receives the attribute bits for the session.
@result An OSStatus indicating success (errSecSuccess) or an error cause.
errSessionInvalidId -60500 Invalid session id specified
*/
OSStatus SessionGetInfo(SecuritySessionId session,
SecuritySessionId * __nullable sessionId,
SessionAttributeBits * __nullable attributes);
/*!
@function SessionCreate
This (very specialized) function creates a security session.
Upon completion, the new session contains the calling process (and none other).
You cannot create a session for someone else, and cannot avoid being placed
into the new session. This is (currently) the only call that changes a process's
session membership.
By default, a new bootstrap subset port is created for the calling process. The process
acquires this new port as its bootstrap port, which all its children will inherit.
If you happen to have created the subset port on your own, you can pass the
sessionKeepCurrentBootstrap flag, and SessionCreate will use it. Note however that
you cannot supersede a prior SessionCreate call that way; only a single SessionCreate
call is allowed for each Session (however made).
This call will discard any security information established for the calling process.
In particular, any authorization handles acquired will become invalid, and so will any
keychain related information. We recommend that you call SessionCreate before
making any other security-related calls that establish rights of any kind, to the
extent this is practical. Also, we strongly recommend that you do not perform
security-related calls in any other threads while calling SessionCreate.
@param flags Flags controlling how the session is created.
@param attributes The set of attribute bits to set for the new session.
Not all bits can be set this way.
@result An OSStatus indicating success (errSecSuccess) or an error cause.
errSessionInvalidAttributes -60501 Attempt to set invalid attribute bits
errSessionAuthorizationDenied -60502 Attempt to re-initialize a session
errSessionInvalidFlags -60011 Attempt to specify unsupported flag bits
*/
OSStatus SessionCreate(SessionCreationFlags flags,
SessionAttributeBits attributes);
CF_ASSUME_NONNULL_END
#if defined(__cplusplus)
}
#endif
#endif /* ! __AuthSession__ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/AuthorizationTags.h | /*
* Copyright (c) 2000-2004,2011,2014 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
* AuthorizationTags.h -- Right tags for implementing access control in
* applications and daemons
*/
#ifndef _SECURITY_AUTHORIZATIONTAGS_H_
#define _SECURITY_AUTHORIZATIONTAGS_H_
/*!
@header AuthorizationTags
This header defines some of the supported rights tags to be used in the Authorization API.
*/
/*!
@define kAuthorizationEnvironmentUsername
The name of the AuthorizationItem that should be passed into the environment when specifying a username. The value and valueLength should contain the username itself.
*/
#define kAuthorizationEnvironmentUsername "username"
/*!
@define kAuthorizationEnvironmentPassword
The name of the AuthorizationItem that should be passed into the environment when specifying a password for a given username. The value and valueLength should contain the actual password data.
*/
#define kAuthorizationEnvironmentPassword "password"
/*!
@define kAuthorizationEnvironmentShared
The name of the AuthorizationItem that should be passed into the environment when specifying a username and password. Adding this entry to the environment will cause the username/password to be added to the shared credential pool of the calling applications session. This means that further calls by other applications in this session will automatically have this credential availible to them. The value is ignored.
*/
#define kAuthorizationEnvironmentShared "shared"
/*!
@define kAuthorizationRightExecute
The name of the AuthorizationItem that should be passed into the rights when preauthorizing for a call to AuthorizationExecuteWithPrivileges().
You need to acquire this right to be able to perform a AuthorizationExecuteWithPrivileges() operation. In addtion to this right you should obtain whatever rights the tool you are executing with privileges need to perform it's operation on your behalf. Currently no options are supported but you should pass in the full path of the tool you wish to execute in the value and valueLength fields. In the future we will limit the right to only execute the requested path, and we will display this information to the user.
*/
#define kAuthorizationRightExecute "system.privilege.admin"
/*!
@define kAuthorizationEnvironmentPrompt
The name of the AuthorizationItem that should be passed into the environment when specifying a invocation specific additional text. The value should be a localized UTF8 string.
*/
#define kAuthorizationEnvironmentPrompt "prompt"
/*!
@define kAuthorizationEnvironmentIcon
The name of the AuthorizationItem that should be passed into the environment when specifying an alternate icon to be used. The value should be a full path to and image NSImage can deal with.
*/
#define kAuthorizationEnvironmentIcon "icon"
/*!
@define kAuthorizationPamResult
Return code provided by PAM module
*/
#define kAuthorizationPamResult "pam_result"
/*!
@define kAuthorizationFlags
Flags passed to AuthorizationCopyRights
*/
#define kAuthorizationFlags "flags"
#endif /* !_SECURITY_AUTHORIZATIONTAGS_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecRandom.h | /*
* Copyright (c) 2007-2009,2011-2013,2016 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
@header SecRandom
The functions provided in SecRandom.h implement high-level accessors
to cryptographically secure random numbers.
*/
#ifndef _SECURITY_SECRANDOM_H_
#define _SECURITY_SECRANDOM_H_
#include <Security/SecBase.h>
#include <stdint.h>
#include <sys/types.h>
__BEGIN_DECLS
CF_ASSUME_NONNULL_BEGIN
CF_IMPLICIT_BRIDGING_ENABLED
/*!
@typedef SecRandomRef
@abstract Reference to a (pseudo) random number generator.
*/
typedef const struct __SecRandom * SecRandomRef;
/* This is a synonym for NULL, if you'd rather use a named constant. This
refers to a cryptographically secure random number generator. */
extern const SecRandomRef kSecRandomDefault
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_2_0);
/*!
@function SecRandomCopyBytes
@abstract
Return count random bytes in *bytes, allocated by the caller. It
is critical to check the return value for error.
@param rnd
Only @p kSecRandomDefault is supported.
@param count
The number of bytes to generate.
@param bytes
A buffer to fill with random output.
@result Return 0 on success, any other value on failure.
@discussion
If @p rnd is unrecognized or unsupported, @p kSecRandomDefault is
used.
*/
int SecRandomCopyBytes(SecRandomRef __nullable rnd, size_t count, void *bytes)
__attribute__ ((warn_unused_result))
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_2_0);
CF_IMPLICIT_BRIDGING_DISABLED
CF_ASSUME_NONNULL_END
__END_DECLS
#endif /* !_SECURITY_SECRANDOM_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecIdentity.h | /*
* Copyright (c) 2002-2011,2012-2013,2016-2021 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
@header SecIdentity
The functions provided in SecIdentity.h implement a convenient way to
match private keys with certificates.
*/
#ifndef _SECURITY_SECIDENTITY_H_
#define _SECURITY_SECIDENTITY_H_
#include <CoreFoundation/CFBase.h>
#include <CoreFoundation/CFArray.h>
#include <Security/SecBase.h>
#include <AvailabilityMacros.h>
#if SEC_OS_OSX
#include <Security/cssmtype.h>
#endif
__BEGIN_DECLS
CF_ASSUME_NONNULL_BEGIN
CF_IMPLICIT_BRIDGING_ENABLED
/*!
@function SecIdentityGetTypeID
@abstract Returns the type identifier of SecIdentity instances.
@result The CFTypeID of SecIdentity instances.
*/
CFTypeID SecIdentityGetTypeID(void)
__OSX_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_2_0);
#if SEC_OS_OSX
/*!
@function SecIdentityCreateWithCertificate
@abstract Creates a new identity reference for the given certificate, assuming the associated private key is in one of the specified keychains.
@param keychainOrArray A reference to an array of keychains to search, a single keychain, or NULL to search the user's default keychain search list.
@param certificateRef A certificate reference.
@param identityRef On return, an identity reference. You are responsible for releasing this reference by calling the CFRelease function.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecIdentityCreateWithCertificate(
CFTypeRef __nullable keychainOrArray,
SecCertificateRef certificateRef,
SecIdentityRef * __nonnull CF_RETURNS_RETAINED identityRef)
__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA);
#endif
/*!
@function SecIdentityCopyCertificate
@abstract Returns a reference to a certificate for the given identity
reference.
@param identityRef An identity reference.
@param certificateRef On return, a pointer to the found certificate
reference. You are responsible for releasing this reference by calling
the CFRelease function.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecIdentityCopyCertificate(
SecIdentityRef identityRef,
SecCertificateRef * __nonnull CF_RETURNS_RETAINED certificateRef)
__OSX_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_2_0);
/*!
@function SecIdentityCopyPrivateKey
@abstract Returns the private key associated with an identity.
@param identityRef An identity reference.
@param privateKeyRef On return, a pointer to the private key for the given
identity. On iOS, the private key must be of class type kSecAppleKeyItemClass.
You are responsible for releasing this reference by calling the CFRelease function.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecIdentityCopyPrivateKey(
SecIdentityRef identityRef,
SecKeyRef * __nonnull CF_RETURNS_RETAINED privateKeyRef)
__OSX_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_2_0);
#if SEC_OS_OSX
/*!
@function SecIdentityCopyPreference
@abstract Returns the preferred identity for the specified name and key usage, optionally limiting the result to an identity issued by a certificate whose subject is one of the distinguished names in validIssuers. If a preferred identity does not exist, NULL is returned.
@param name A string containing a URI, RFC822 email address, DNS hostname, or other name which uniquely identifies the service requiring an identity.
@param keyUsage A CSSM_KEYUSE key usage value, as defined in cssmtype.h. Pass 0 to ignore this parameter.
@param validIssuers (optional) An array of CFDataRef instances whose contents are the subject names of allowable issuers, as returned by a call to SSLCopyDistinguishedNames (SecureTransport.h). Pass NULL if any issuer is allowed.
@param identity On return, a reference to the preferred identity, or NULL if none was found. You are responsible for releasing this reference by calling the CFRelease function.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This API is deprecated in 10.7. Please use the SecIdentityCopyPreferred API instead.
*/
OSStatus SecIdentityCopyPreference(CFStringRef name, CSSM_KEYUSE keyUsage, CFArrayRef __nullable validIssuers, SecIdentityRef * __nonnull CF_RETURNS_RETAINED identity)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/*!
@function SecIdentityCopyPreferred
@abstract Returns the preferred identity for the specified name and key usage, optionally limiting the result to an identity issued by a certificate whose subject is one of the distinguished names in validIssuers. If a preferred identity does not exist, NULL is returned.
@param name A string containing a URI, RFC822 email address, DNS hostname, or other name which uniquely identifies the service requiring an identity.
@param keyUsage A CFArrayRef value, containing items defined in SecItem.h Pass NULL to ignore this parameter. (kSecAttrCanEncrypt, kSecAttrCanDecrypt, kSecAttrCanDerive, kSecAttrCanSign, kSecAttrCanVerify, kSecAttrCanWrap, kSecAttrCanUnwrap)
@param validIssuers (optional) An array of CFDataRef instances whose contents are the subject names of allowable issuers, as returned by a call to SSLCopyDistinguishedNames (SecureTransport.h). Pass NULL if any issuer is allowed.
@result An identity or NULL, if the preferred identity has not been set. Your code should then typically perform a search for possible identities using the SecItem APIs.
@discussion If a preferred identity has not been set for the supplied name, the returned identity reference will be NULL. Your code should then perform a search for possible identities, using the SecItemCopyMatching API. Note: in versions of macOS prior to 11.3, identity preferences are shared between processes running as the same user. Starting in 11.3, URI names are considered per-application preferences. An identity preference for a URI name may not be found if the calling application is different from the one which set the preference with SecIdentitySetPreferred.
*/
__nullable
SecIdentityRef SecIdentityCopyPreferred(CFStringRef name, CFArrayRef __nullable keyUsage, CFArrayRef __nullable validIssuers)
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
/*!
@function SecIdentitySetPreference
@abstract Sets the preferred identity for the specified name and key usage.
@param identity A reference to the identity which will be preferred.
@param name A string containing a URI, RFC822 email address, DNS hostname, or other name which uniquely identifies a service requiring this identity.
@param keyUsage A CSSM_KEYUSE key usage value, as defined in cssmtype.h. Pass 0 to specify any key usage.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This API is deprecated in 10.7. Please use the SecIdentitySetPreferred API instead.
*/
OSStatus SecIdentitySetPreference(SecIdentityRef identity, CFStringRef name, CSSM_KEYUSE keyUsage)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/*!
@function SecIdentitySetPreferred
@abstract Sets the preferred identity for the specified name and key usage.
@param identity A reference to the identity which will be preferred. If NULL is passed, any existing preference for the specified name is cleared instead.
@param name A string containing a URI, RFC822 email address, DNS hostname, or other name which uniquely identifies a service requiring this identity.
@param keyUsage A CFArrayRef value, containing items defined in SecItem.h Pass NULL to specify any key usage. (kSecAttrCanEncrypt, kSecAttrCanDecrypt, kSecAttrCanDerive, kSecAttrCanSign, kSecAttrCanVerify, kSecAttrCanWrap, kSecAttrCanUnwrap)
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion Note: in versions of macOS prior to 11.3, identity preferences are shared between processes running as the same user. Starting in 11.3, URI names are considered per-application preferences. An identity preference for a URI name will be scoped to the application which created it, such that a subsequent call to SecIdentityCopyPreferred will only return it for that same application.
*/
OSStatus SecIdentitySetPreferred(SecIdentityRef __nullable identity, CFStringRef name, CFArrayRef __nullable keyUsage)
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
/*!
@function SecIdentityCopySystemIdentity
@abstract Obtain the system-wide SecIdentityRef associated with
a specified domain.
@param domain Identifies the SecIdentityRef to be obtained, typically
in the form "com.apple.subdomain...".
@param idRef On return, the system SecIdentityRef assicated with
the specified domain. Caller must CFRelease this when
finished with it.
@param actualDomain (optional) The actual domain name of the
the returned identity is returned here. This
may be different from the requested domain.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion If no system SecIdentityRef exists for the specified
domain, a domain-specific alternate may be returned
instead, typically (but not exclusively) the
kSecIdentityDomainDefault SecIdentityRef.
*/
OSStatus SecIdentityCopySystemIdentity(
CFStringRef domain,
SecIdentityRef * __nonnull CF_RETURNS_RETAINED idRef,
CFStringRef * __nullable CF_RETURNS_RETAINED actualDomain) /* optional */
__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA);
/*!
@function SecIdentitySetSystemIdentity
@abstract Assign the supplied SecIdentityRef to the specified
domain.
@param domain Identifies the domain to which the specified
SecIdentityRef will be assigned.
@param idRef (optional) The identity to be assigned to the specified
domain. Pass NULL to delete a possible entry for the specified
domain; in this case, it is not an error if no identity
exists for the specified domain.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion The caller must be running as root.
*/
OSStatus SecIdentitySetSystemIdentity(
CFStringRef domain,
SecIdentityRef __nullable idRef)
__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA);
/*
* Defined system identity domains.
*/
/*!
@const kSecIdentityDomainDefault The system-wide default identity.
*/
extern const CFStringRef kSecIdentityDomainDefault __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA);
/*!
@const kSecIdentityDomainKerberosKDC Kerberos KDC identity.
*/
extern const CFStringRef kSecIdentityDomainKerberosKDC __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA);
#endif // SEC_OS_OSX
CF_IMPLICIT_BRIDGING_DISABLED
CF_ASSUME_NONNULL_END
__END_DECLS
#endif /* !_SECURITY_SECIDENTITY_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecReadTransform.h | #include <Security/SecTransformReadTransform.h>
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/cssmspi.h | /*
* Copyright (c) 1999-2001,2003-2004,2011-2012,2014 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*
* cssmspi.h -- Service Provider Interface for CSSM Modules
*/
#ifndef _CSSMSPI_H_
#define _CSSMSPI_H_ 1
#include <Security/cssmtype.h>
#include <Security/cssmspi.h> /* CSSM_UPCALLS_PTR */
#ifdef __cplusplus
extern "C" {
#endif
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
typedef CSSM_RETURN (CSSMAPI *CSSM_SPI_ModuleEventHandler)
(const CSSM_GUID *ModuleGuid,
void *CssmNotifyCallbackCtx,
uint32 SubserviceId,
CSSM_SERVICE_TYPE ServiceType,
CSSM_MODULE_EVENT EventType) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef uint32 CSSM_CONTEXT_EVENT;
enum {
CSSM_CONTEXT_EVENT_CREATE = 1,
CSSM_CONTEXT_EVENT_DELETE = 2,
CSSM_CONTEXT_EVENT_UPDATE = 3
};
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_module_funcs {
CSSM_SERVICE_TYPE ServiceType;
uint32 NumberOfServiceFuncs;
const CSSM_PROC_ADDR *ServiceFuncs;
} CSSM_MODULE_FUNCS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_MODULE_FUNCS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef void *(CSSMAPI *CSSM_UPCALLS_MALLOC)
(CSSM_HANDLE AddInHandle,
size_t size) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef void (CSSMAPI *CSSM_UPCALLS_FREE)
(CSSM_HANDLE AddInHandle,
void *memblock) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef void *(CSSMAPI *CSSM_UPCALLS_REALLOC)
(CSSM_HANDLE AddInHandle,
void *memblock,
size_t size) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef void *(CSSMAPI *CSSM_UPCALLS_CALLOC)
(CSSM_HANDLE AddInHandle,
size_t num,
size_t size) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_upcalls {
CSSM_UPCALLS_MALLOC malloc_func;
CSSM_UPCALLS_FREE free_func;
CSSM_UPCALLS_REALLOC realloc_func;
CSSM_UPCALLS_CALLOC calloc_func;
CSSM_RETURN (CSSMAPI *CcToHandle_func)
(CSSM_CC_HANDLE Cc,
CSSM_MODULE_HANDLE_PTR ModuleHandle);
CSSM_RETURN (CSSMAPI *GetModuleInfo_func)
(CSSM_MODULE_HANDLE Module,
CSSM_GUID_PTR Guid,
CSSM_VERSION_PTR Version,
uint32 *SubServiceId,
CSSM_SERVICE_TYPE *SubServiceType,
CSSM_ATTACH_FLAGS *AttachFlags,
CSSM_KEY_HIERARCHY *KeyHierarchy,
CSSM_API_MEMORY_FUNCS_PTR AttachedMemFuncs,
CSSM_FUNC_NAME_ADDR_PTR FunctionTable,
uint32 NumFunctions);
} CSSM_UPCALLS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_UPCALLS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
#pragma clang diagnostic pop
#ifdef __cplusplus
}
#endif
#endif /* _CSSMSPI_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/cssmapi.h | /*
* Copyright (c) 1999-2001,2004,2011,2014 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*
* cssmapi.h -- Application Programmers Interfaces for CSSM
*/
#ifndef _CSSMAPI_H_
#define _CSSMAPI_H_ 1
#include <Security/cssmtype.h>
/* ==========================================================================
W A R N I N G : CDSA has been deprecated starting with 10.7. While the
APIs will continue to work, developers should update their code to use
the APIs that are suggested and NOT use the CDSA APIs
========================================================================== */
#ifdef __cplusplus
extern "C" {
#endif
/* Core Functions */
/* --------------------------------------------------------------------------
CSSM_Init has been deprecated in 10.7 and later. There is no alternate
API as this call is only needed when calling CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_Init (const CSSM_VERSION *Version,
CSSM_PRIVILEGE_SCOPE Scope,
const CSSM_GUID *CallerGuid,
CSSM_KEY_HIERARCHY KeyHierarchy,
CSSM_PVC_MODE *PvcPolicy,
const void *Reserved)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_Terminate has been deprecated in 10.7 and later. There is no alternate
API as this call is only needed when calling CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_Terminate (void)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_ModuleLoad has been deprecated in 10.7 and later. There is no
alternate API as this call is only needed when calling CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_ModuleLoad (const CSSM_GUID *ModuleGuid,
CSSM_KEY_HIERARCHY KeyHierarchy,
CSSM_API_ModuleEventHandler AppNotifyCallback,
void *AppNotifyCallbackCtx)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_ModuleUnload has been deprecated in 10.7 and later. There is no
alternate API as this call is only needed when calling CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_ModuleUnload (const CSSM_GUID *ModuleGuid,
CSSM_API_ModuleEventHandler AppNotifyCallback,
void *AppNotifyCallbackCtx)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_Introduce has been deprecated in 10.7 and later. There is no
alternate API as this call is only needed when calling CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_Introduce (const CSSM_GUID *ModuleID,
CSSM_KEY_HIERARCHY KeyHierarchy)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_Unintroduce has been deprecated in 10.7 and later. There is no
alternate API as this call is only needed when calling CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_Unintroduce (const CSSM_GUID *ModuleID)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_ModuleAttach has been deprecated in 10.7 and later. There is no
alternate API as this call is only needed when calling CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_ModuleAttach (const CSSM_GUID *ModuleGuid,
const CSSM_VERSION *Version,
const CSSM_API_MEMORY_FUNCS *MemoryFuncs,
uint32 SubserviceID,
CSSM_SERVICE_TYPE SubServiceType,
CSSM_ATTACH_FLAGS AttachFlags,
CSSM_KEY_HIERARCHY KeyHierarchy,
CSSM_FUNC_NAME_ADDR *FunctionTable,
uint32 NumFunctionTable,
const void *Reserved,
CSSM_MODULE_HANDLE_PTR NewModuleHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_ModuleDetach has been deprecated in 10.7 and later. There is no
alternate API as this call is only needed when calling CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_ModuleDetach (CSSM_MODULE_HANDLE ModuleHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_SetPrivilege has been deprecated in 10.7 and later. There is no alternate
API as this call is only needed when calling CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_SetPrivilege (CSSM_PRIVILEGE Privilege)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_GetPrivilege has been deprecated in 10.7 and later. There is no
alternate API as this call is only needed when calling CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_GetPrivilege (CSSM_PRIVILEGE *Privilege)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_GetModuleGUIDFromHandle has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling CDSA
APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_GetModuleGUIDFromHandle (CSSM_MODULE_HANDLE ModuleHandle,
CSSM_GUID_PTR ModuleGUID)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_GetSubserviceUIDFromHandle has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling CDSA
APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_GetSubserviceUIDFromHandle (CSSM_MODULE_HANDLE ModuleHandle,
CSSM_SUBSERVICE_UID_PTR SubserviceUID)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_ListAttachedModuleManagers has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling CDSA
APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_ListAttachedModuleManagers (uint32 *NumberOfModuleManagers,
CSSM_GUID_PTR ModuleManagerGuids)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_GetAPIMemoryFunctions has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling CDSA
APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_GetAPIMemoryFunctions (CSSM_MODULE_HANDLE AddInHandle,
CSSM_API_MEMORY_FUNCS_PTR AppMemoryFuncs)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* Cryptographic Context Operations */
/* --------------------------------------------------------------------------
CSSM_CSP_CreateSignatureContext has been deprecated in 10.7 and later.
The replacement API for this is SecSignTransformCreate in the
SecSignVerifyTransform.h file.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CSP_CreateSignatureContext (CSSM_CSP_HANDLE CSPHandle,
CSSM_ALGORITHMS AlgorithmID,
const CSSM_ACCESS_CREDENTIALS *AccessCred,
const CSSM_KEY *Key,
CSSM_CC_HANDLE *NewContextHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CSP_CreateSignatureContext has been deprecated in 10.7 and later.
The replacement API for this is SecSignTransformCreate in the
SecSignVerifyTransform.h file.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CSP_CreateSymmetricContext (CSSM_CSP_HANDLE CSPHandle,
CSSM_ALGORITHMS AlgorithmID,
CSSM_ENCRYPT_MODE Mode,
const CSSM_ACCESS_CREDENTIALS *AccessCred,
const CSSM_KEY *Key,
const CSSM_DATA *InitVector,
CSSM_PADDING Padding,
void *Reserved,
CSSM_CC_HANDLE *NewContextHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CSP_CreateDigestContext has been deprecated in 10.7 and later.
The replacement API for this is SecDigestTransformCreate in the
SecDigestTransform.h file.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CSP_CreateDigestContext (CSSM_CSP_HANDLE CSPHandle,
CSSM_ALGORITHMS AlgorithmID,
CSSM_CC_HANDLE *NewContextHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CSP_CreateMacContext has been deprecated in 10.7 and later.
The replacement API for this is SecDigestTransformCreate in the
SecDigestTransform.h file.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CSP_CreateMacContext (CSSM_CSP_HANDLE CSPHandle,
CSSM_ALGORITHMS AlgorithmID,
const CSSM_KEY *Key,
CSSM_CC_HANDLE *NewContextHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CSP_CreateRandomGenContext has been deprecated in 10.7 and later.
There is no replacement API as this API is only needed with CDSA. Please
see the SecRandom.h file to get random numbers
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CSP_CreateRandomGenContext (CSSM_CSP_HANDLE CSPHandle,
CSSM_ALGORITHMS AlgorithmID,
const CSSM_CRYPTO_DATA *Seed,
CSSM_SIZE Length,
CSSM_CC_HANDLE *NewContextHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CSP_CreateAsymmetricContext has been deprecated in 10.7 and later.
There is no direct replacement of this API as it is only needed by CDSA.
For asymmertical encryption/decryption use the SecEncryptTransformCreate
or SecDecryptTransformCreate with a asymmertical key.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CSP_CreateAsymmetricContext (CSSM_CSP_HANDLE CSPHandle,
CSSM_ALGORITHMS AlgorithmID,
const CSSM_ACCESS_CREDENTIALS *AccessCred,
const CSSM_KEY *Key,
CSSM_PADDING Padding,
CSSM_CC_HANDLE *NewContextHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CSP_CreateDeriveKeyContext has been deprecated in 10.7 and later.
The replacement for this API would be the SecKeyDeriveFromPassword API
in the SecKey.h file
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CSP_CreateDeriveKeyContext (CSSM_CSP_HANDLE CSPHandle,
CSSM_ALGORITHMS AlgorithmID,
CSSM_KEY_TYPE DeriveKeyType,
uint32 DeriveKeyLengthInBits,
const CSSM_ACCESS_CREDENTIALS *AccessCred,
const CSSM_KEY *BaseKey,
uint32 IterationCount,
const CSSM_DATA *Salt,
const CSSM_CRYPTO_DATA *Seed,
CSSM_CC_HANDLE *NewContextHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CSP_CreateKeyGenContext has been deprecated in 10.7 and later.
The replacement for this API would be either the SecKeyGeneratePair API
or the SecKeyGenerateSymmetric API in the SecKey.h file
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CSP_CreateKeyGenContext (CSSM_CSP_HANDLE CSPHandle,
CSSM_ALGORITHMS AlgorithmID,
uint32 KeySizeInBits,
const CSSM_CRYPTO_DATA *Seed,
const CSSM_DATA *Salt,
const CSSM_DATE *StartDate,
const CSSM_DATE *EndDate,
const CSSM_DATA *Params,
CSSM_CC_HANDLE *NewContextHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CSP_CreatePassThroughContext has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CSP_CreatePassThroughContext (CSSM_CSP_HANDLE CSPHandle,
const CSSM_KEY *Key,
CSSM_CC_HANDLE *NewContextHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_GetContext has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_GetContext (CSSM_CC_HANDLE CCHandle,
CSSM_CONTEXT_PTR *Context)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_FreeContext has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_FreeContext (CSSM_CONTEXT_PTR Context)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_SetContext has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_SetContext (CSSM_CC_HANDLE CCHandle,
const CSSM_CONTEXT *Context)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DeleteContext has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DeleteContext (CSSM_CC_HANDLE CCHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_GetContextAttribute has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_GetContextAttribute (const CSSM_CONTEXT *Context,
uint32 AttributeType,
CSSM_CONTEXT_ATTRIBUTE_PTR *ContextAttribute)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_UpdateContextAttributes has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_UpdateContextAttributes (CSSM_CC_HANDLE CCHandle,
uint32 NumberOfAttributes,
const CSSM_CONTEXT_ATTRIBUTE *ContextAttributes)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DeleteContextAttributes has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DeleteContextAttributes (CSSM_CC_HANDLE CCHandle,
uint32 NumberOfAttributes,
const CSSM_CONTEXT_ATTRIBUTE *ContextAttributes)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* Cryptographic Sessions and Controlled Access to Keys */
/* --------------------------------------------------------------------------
CSSM_CSP_Login has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CSP_Login (CSSM_CSP_HANDLE CSPHandle,
const CSSM_ACCESS_CREDENTIALS *AccessCred,
const CSSM_DATA *LoginName,
const void *Reserved)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CSP_Logout has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CSP_Logout (CSSM_CSP_HANDLE CSPHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CSP_GetLoginAcl has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CSP_GetLoginAcl (CSSM_CSP_HANDLE CSPHandle,
const CSSM_STRING *SelectionTag,
uint32 *NumberOfAclInfos,
CSSM_ACL_ENTRY_INFO_PTR *AclInfos)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CSP_ChangeLoginAcl has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CSP_ChangeLoginAcl (CSSM_CSP_HANDLE CSPHandle,
const CSSM_ACCESS_CREDENTIALS *AccessCred,
const CSSM_ACL_EDIT *AclEdit)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_GetKeyAcl has been deprecated in 10.7 and later.
If the key in question is in a keychain then the ACL for the key can be
acquired by using the SecItemCopyMatching API specifically
kSecReturnAttributes with a value of kCFBooleanTrue. In the attributes
dictionary is kSecAttrAccess key with a value of a SecAccessRef. With
a SecAccessRef the ACL for the key can be gotten using either the
SecAccessCopyACLList API.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_GetKeyAcl (CSSM_CSP_HANDLE CSPHandle,
const CSSM_KEY *Key,
const CSSM_STRING *SelectionTag,
uint32 *NumberOfAclInfos,
CSSM_ACL_ENTRY_INFO_PTR *AclInfos)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_ChangeKeyAcl has been deprecated in 10.7 and later.
If the key in question is in a keychain then the ACL for the key can be
changed by using the SecItemUpdate API.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_ChangeKeyAcl (CSSM_CSP_HANDLE CSPHandle,
const CSSM_ACCESS_CREDENTIALS *AccessCred,
const CSSM_ACL_EDIT *AclEdit,
const CSSM_KEY *Key)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_GetKeyOwner has been deprecated in 10.7 and later.
If the key in question is in a keychain then the ACL for the key can be
acquired by using the SecItemCopyMatching API specifically
kSecReturnAttributes with a value of kCFBooleanTrue. In the attributes
dictionary is kSecAttrAccess key with a value of a SecAccessRef. With
a SecAccessRef the ACL for the key can be gotten using either the
SecAccessCopyOwnerAndACL API.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_GetKeyOwner (CSSM_CSP_HANDLE CSPHandle,
const CSSM_KEY *Key,
CSSM_ACL_OWNER_PROTOTYPE_PTR Owner)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_ChangeKeyOwner has been deprecated in 10.7 and later.
If the key in question is in a keychain then the ACL for the key can be
changed by using the SecItemUpdate API.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_ChangeKeyOwner (CSSM_CSP_HANDLE CSPHandle,
const CSSM_ACCESS_CREDENTIALS *AccessCred,
const CSSM_KEY *Key,
const CSSM_ACL_OWNER_PROTOTYPE *NewOwner)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CSP_GetLoginOwner has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CSP_GetLoginOwner (CSSM_CSP_HANDLE CSPHandle,
CSSM_ACL_OWNER_PROTOTYPE_PTR Owner)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CSP_ChangeLoginOwner has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CSP_ChangeLoginOwner (CSSM_CSP_HANDLE CSPHandle,
const CSSM_ACCESS_CREDENTIALS *AccessCred,
const CSSM_ACL_OWNER_PROTOTYPE *NewOwner)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_SignData has been deprecated in 10.7 and later.
To sign data use the SecSignTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_SignData (CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *DataBufs,
uint32 DataBufCount,
CSSM_ALGORITHMS DigestAlgorithm,
CSSM_DATA_PTR Signature)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_SignDataInit has been deprecated in 10.7 and later.
To sign data use the SecSignTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_SignDataInit (CSSM_CC_HANDLE CCHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_SignDataUpdate has been deprecated in 10.7 and later.
To sign data use the SecSignTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_SignDataUpdate (CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *DataBufs,
uint32 DataBufCount)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_SignDataFinal has been deprecated in 10.7 and later.
To sign data use the SecSignTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_SignDataFinal (CSSM_CC_HANDLE CCHandle,
CSSM_DATA_PTR Signature)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_VerifyData has been deprecated in 10.7 and later.
To sign data use the SecVerifyTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_VerifyData (CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *DataBufs,
uint32 DataBufCount,
CSSM_ALGORITHMS DigestAlgorithm,
const CSSM_DATA *Signature)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_VerifyDataInit has been deprecated in 10.7 and later.
To sign data use the SecVerifyTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_VerifyDataInit (CSSM_CC_HANDLE CCHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_VerifyDataUpdate has been deprecated in 10.7 and later.
To sign data use the SecVerifyTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_VerifyDataUpdate (CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *DataBufs,
uint32 DataBufCount)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_VerifyDataFinal has been deprecated in 10.7 and later.
To sign data use the SecVerifyTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_VerifyDataFinal (CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *Signature)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DigestData has been deprecated in 10.7 and later.
To sign data use the SecDigestTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DigestData (CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *DataBufs,
uint32 DataBufCount,
CSSM_DATA_PTR Digest)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DigestDataInit has been deprecated in 10.7 and later.
To sign data use the SecDigestTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DigestDataInit (CSSM_CC_HANDLE CCHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DigestDataUpdate has been deprecated in 10.7 and later.
To sign data use the SecDigestTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DigestDataUpdate (CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *DataBufs,
uint32 DataBufCount)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DigestDataClone has been deprecated in 10.7 and later.
Given that transforms can have be connected into chains, this
functionality is no longer needed.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DigestDataClone (CSSM_CC_HANDLE CCHandle,
CSSM_CC_HANDLE *ClonednewCCHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DigestDataFinal has been deprecated in 10.7 and later.
To sign data use the SecDigestTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DigestDataFinal (CSSM_CC_HANDLE CCHandle,
CSSM_DATA_PTR Digest)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_GenerateMac has been deprecated in 10.7 and later.
To sign data use the SecDigestTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_GenerateMac (CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *DataBufs,
uint32 DataBufCount,
CSSM_DATA_PTR Mac)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_GenerateMacInit has been deprecated in 10.7 and later.
To sign data use the SecDigestTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_GenerateMacInit (CSSM_CC_HANDLE CCHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_GenerateMacUpdate has been deprecated in 10.7 and later.
To sign data use the SecDigestTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_GenerateMacUpdate (CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *DataBufs,
uint32 DataBufCount)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_GenerateMacFinal has been deprecated in 10.7 and later.
To sign data use the SecDigestTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_GenerateMacFinal (CSSM_CC_HANDLE CCHandle,
CSSM_DATA_PTR Mac)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_VerifyMac has been deprecated in 10.7 and later.
To sign data use the SecVerifyTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_VerifyMac (CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *DataBufs,
uint32 DataBufCount,
const CSSM_DATA *Mac)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_VerifyMacInit has been deprecated in 10.7 and later.
To sign data use the SecVerifyTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_VerifyMacInit (CSSM_CC_HANDLE CCHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_VerifyMacUpdate has been deprecated in 10.7 and later.
To sign data use the SecVerifyTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_VerifyMacUpdate (CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *DataBufs,
uint32 DataBufCount)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_VerifyMacFinal has been deprecated in 10.7 and later.
To sign data use the SecVerifyTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_VerifyMacFinal (CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *Mac)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_QuerySize has been deprecated in 10.7 and later.
Given that transforms buffer data into queues, this functionality is no
longer needed.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_QuerySize (CSSM_CC_HANDLE CCHandle,
CSSM_BOOL Encrypt,
uint32 QuerySizeCount,
CSSM_QUERY_SIZE_DATA_PTR DataBlockSizes)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_EncryptData has been deprecated in 10.7 and later.
To sign data use the SecEncryptTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_EncryptData (CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *ClearBufs,
uint32 ClearBufCount,
CSSM_DATA_PTR CipherBufs,
uint32 CipherBufCount,
CSSM_SIZE *bytesEncrypted,
CSSM_DATA_PTR RemData)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_EncryptDataP has been deprecated in 10.7 and later.
To sign data use the SecEncryptTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_EncryptDataP (CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *ClearBufs,
uint32 ClearBufCount,
CSSM_DATA_PTR CipherBufs,
uint32 CipherBufCount,
CSSM_SIZE *bytesEncrypted,
CSSM_DATA_PTR RemData,
CSSM_PRIVILEGE Privilege)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_EncryptDataInit has been deprecated in 10.7 and later.
To sign data use the SecEncryptTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_EncryptDataInit (CSSM_CC_HANDLE CCHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_EncryptDataInitP has been deprecated in 10.7 and later.
To sign data use the SecEncryptTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_EncryptDataInitP (CSSM_CC_HANDLE CCHandle,
CSSM_PRIVILEGE Privilege)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_EncryptDataUpdate has been deprecated in 10.7 and later.
To sign data use the SecEncryptTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_EncryptDataUpdate (CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *ClearBufs,
uint32 ClearBufCount,
CSSM_DATA_PTR CipherBufs,
uint32 CipherBufCount,
CSSM_SIZE *bytesEncrypted)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_EncryptDataFinal has been deprecated in 10.7 and later.
To sign data use the SecEncryptTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_EncryptDataFinal (CSSM_CC_HANDLE CCHandle,
CSSM_DATA_PTR RemData)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DecryptData has been deprecated in 10.7 and later.
To sign data use the SecDecryptTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DecryptData (CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *CipherBufs,
uint32 CipherBufCount,
CSSM_DATA_PTR ClearBufs,
uint32 ClearBufCount,
CSSM_SIZE *bytesDecrypted,
CSSM_DATA_PTR RemData)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DecryptDataP has been deprecated in 10.7 and later.
To sign data use the SecDecryptTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DecryptDataP (CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *CipherBufs,
uint32 CipherBufCount,
CSSM_DATA_PTR ClearBufs,
uint32 ClearBufCount,
CSSM_SIZE *bytesDecrypted,
CSSM_DATA_PTR RemData,
CSSM_PRIVILEGE Privilege)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DecryptDataInit has been deprecated in 10.7 and later.
To sign data use the SecDecryptTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DecryptDataInit (CSSM_CC_HANDLE CCHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DecryptDataInitP has been deprecated in 10.7 and later.
To sign data use the SecDecryptTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DecryptDataInitP (CSSM_CC_HANDLE CCHandle,
CSSM_PRIVILEGE Privilege)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DecryptDataUpdate has been deprecated in 10.7 and later.
To sign data use the SecDecryptTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DecryptDataUpdate (CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *CipherBufs,
uint32 CipherBufCount,
CSSM_DATA_PTR ClearBufs,
uint32 ClearBufCount,
CSSM_SIZE *bytesDecrypted)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DecryptDataFinal has been deprecated in 10.7 and later.
To sign data use the SecDecryptTransformCreate API to create the transform
and the SecTransform APIs to set the data and to execute the transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DecryptDataFinal (CSSM_CC_HANDLE CCHandle,
CSSM_DATA_PTR RemData)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_QueryKeySizeInBits has been deprecated in 10.7 and later.
Given that a SecKeyRef abstracts the usage of a key this API so no longer
needed.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_QueryKeySizeInBits (CSSM_CSP_HANDLE CSPHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_KEY *Key,
CSSM_KEY_SIZE_PTR KeySize)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_GenerateKey has been deprecated in 10.7 and later.
To create a symmetrical key call SecKeyGenerateSymmetric.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_GenerateKey (CSSM_CC_HANDLE CCHandle,
uint32 KeyUsage,
uint32 KeyAttr,
const CSSM_DATA *KeyLabel,
const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry,
CSSM_KEY_PTR Key)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_GenerateKeyP has been deprecated in 10.7 and later.
To create a symmetrical key call SecKeyGenerateSymmetric.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_GenerateKeyP (CSSM_CC_HANDLE CCHandle,
uint32 KeyUsage,
uint32 KeyAttr,
const CSSM_DATA *KeyLabel,
const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry,
CSSM_KEY_PTR Key,
CSSM_PRIVILEGE Privilege)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_GenerateKeyPair has been deprecated in 10.7 and later.
To create an asymmetrical key call SecKeyGeneratePair.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_GenerateKeyPair (CSSM_CC_HANDLE CCHandle,
uint32 PublicKeyUsage,
uint32 PublicKeyAttr,
const CSSM_DATA *PublicKeyLabel,
CSSM_KEY_PTR PublicKey,
uint32 PrivateKeyUsage,
uint32 PrivateKeyAttr,
const CSSM_DATA *PrivateKeyLabel,
const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry,
CSSM_KEY_PTR PrivateKey)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_GenerateKeyPairP has been deprecated in 10.7 and later.
To create an asymmetrical key call SecKeyGeneratePair.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_GenerateKeyPairP (CSSM_CC_HANDLE CCHandle,
uint32 PublicKeyUsage,
uint32 PublicKeyAttr,
const CSSM_DATA *PublicKeyLabel,
CSSM_KEY_PTR PublicKey,
uint32 PrivateKeyUsage,
uint32 PrivateKeyAttr,
const CSSM_DATA *PrivateKeyLabel,
const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry,
CSSM_KEY_PTR PrivateKey,
CSSM_PRIVILEGE Privilege)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_GenerateRandom has been deprecated in 10.7 and later.
To get random data call SecRandomCopyBytes
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_GenerateRandom (CSSM_CC_HANDLE CCHandle,
CSSM_DATA_PTR RandomNumber)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CSP_ObtainPrivateKeyFromPublicKey has been deprecated in 10.7 and later.
There is not currently a direct replacement for this API
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CSP_ObtainPrivateKeyFromPublicKey (CSSM_CSP_HANDLE CSPHandle,
const CSSM_KEY *PublicKey,
CSSM_KEY_PTR PrivateKey)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_WrapKey has been deprecated in 10.7 and later.
This is replaced with the SecKeyWrapSymmetric API.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_WrapKey (CSSM_CC_HANDLE CCHandle,
const CSSM_ACCESS_CREDENTIALS *AccessCred,
const CSSM_KEY *Key,
const CSSM_DATA *DescriptiveData,
CSSM_WRAP_KEY_PTR WrappedKey)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_UnwrapKey has been deprecated in 10.7 and later.
This is replaced with the SecKeyUnwrapSymmetric API.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_UnwrapKey (CSSM_CC_HANDLE CCHandle,
const CSSM_KEY *PublicKey,
const CSSM_WRAP_KEY *WrappedKey,
uint32 KeyUsage,
uint32 KeyAttr,
const CSSM_DATA *KeyLabel,
const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry,
CSSM_KEY_PTR UnwrappedKey,
CSSM_DATA_PTR DescriptiveData)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_WrapKeyP has been deprecated in 10.7 and later.
This is replaced with the SecKeyWrapSymmetric API.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_WrapKeyP (CSSM_CC_HANDLE CCHandle,
const CSSM_ACCESS_CREDENTIALS *AccessCred,
const CSSM_KEY *Key,
const CSSM_DATA *DescriptiveData,
CSSM_WRAP_KEY_PTR WrappedKey,
CSSM_PRIVILEGE Privilege)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_WrapKeyP has been deprecated in 10.7 and later.
This is replaced with the SecKeyUnwrapSymmetric API.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_UnwrapKeyP (CSSM_CC_HANDLE CCHandle,
const CSSM_KEY *PublicKey,
const CSSM_WRAP_KEY *WrappedKey,
uint32 KeyUsage,
uint32 KeyAttr,
const CSSM_DATA *KeyLabel,
const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry,
CSSM_KEY_PTR UnwrappedKey,
CSSM_DATA_PTR DescriptiveData,
CSSM_PRIVILEGE Privilege)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DeriveKey has been deprecated in 10.7 and later.
This is replaced with the SecKeyDeriveFromPassword API.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DeriveKey (CSSM_CC_HANDLE CCHandle,
CSSM_DATA_PTR Param,
uint32 KeyUsage,
uint32 KeyAttr,
const CSSM_DATA *KeyLabel,
const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry,
CSSM_KEY_PTR DerivedKey)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_FreeKey has been deprecated in 10.7 and later. There is no
alternate API. If the key in question is in a keychain calling
SecItemDelete will delete the key. If it is just a free standing key
calling CFRelease on the SecKeyRef will delete the key.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_FreeKey (CSSM_CSP_HANDLE CSPHandle,
const CSSM_ACCESS_CREDENTIALS *AccessCred,
CSSM_KEY_PTR KeyPtr,
CSSM_BOOL Delete)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_GenerateAlgorithmParams has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_GenerateAlgorithmParams (CSSM_CC_HANDLE CCHandle,
uint32 ParamBits,
CSSM_DATA_PTR Param)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* Miscellaneous Functions for Cryptographic Services */
/* --------------------------------------------------------------------------
CSSM_CSP_GetOperationalStatistics has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CSP_GetOperationalStatistics (CSSM_CSP_HANDLE CSPHandle,
CSSM_CSP_OPERATIONAL_STATISTICS *Statistics)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_GetTimeValue has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_GetTimeValue (CSSM_CSP_HANDLE CSPHandle,
CSSM_ALGORITHMS TimeAlgorithm,
CSSM_DATA *TimeData)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_RetrieveUniqueId has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs. One could call CFUUIDCreate to create a unique ID.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_RetrieveUniqueId (CSSM_CSP_HANDLE CSPHandle,
CSSM_DATA_PTR UniqueID)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_RetrieveCounter has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_RetrieveCounter (CSSM_CSP_HANDLE CSPHandle,
CSSM_DATA_PTR Counter)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_VerifyDevice has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_VerifyDevice (CSSM_CSP_HANDLE CSPHandle,
const CSSM_DATA *DeviceCert)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* Extensibility Functions for Cryptographic Services */
/* --------------------------------------------------------------------------
CSSM_CSP_PassThrough has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CSP_PassThrough (CSSM_CC_HANDLE CCHandle,
uint32 PassThroughId,
const void *InData,
void **OutData)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* Trust Policy Operations */
/* --------------------------------------------------------------------------
CSSM_TP_SubmitCredRequest has been deprecated in 10.7 and later.
There is currently no direct replacement.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_TP_SubmitCredRequest (CSSM_TP_HANDLE TPHandle,
const CSSM_TP_AUTHORITY_ID *PreferredAuthority,
CSSM_TP_AUTHORITY_REQUEST_TYPE RequestType,
const CSSM_TP_REQUEST_SET *RequestInput,
const CSSM_TP_CALLERAUTH_CONTEXT *CallerAuthContext,
sint32 *EstimatedTime,
CSSM_DATA_PTR ReferenceIdentifier)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_TP_RetrieveCredResult has been deprecated in 10.7 and later.
There is currently no direct replacement.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_TP_RetrieveCredResult (CSSM_TP_HANDLE TPHandle,
const CSSM_DATA *ReferenceIdentifier,
const CSSM_TP_CALLERAUTH_CONTEXT *CallerAuthCredentials,
sint32 *EstimatedTime,
CSSM_BOOL *ConfirmationRequired,
CSSM_TP_RESULT_SET_PTR *RetrieveOutput)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_TP_ConfirmCredResult has been deprecated in 10.7 and later.
There is currently no direct replacement.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_TP_ConfirmCredResult (CSSM_TP_HANDLE TPHandle,
const CSSM_DATA *ReferenceIdentifier,
const CSSM_TP_CALLERAUTH_CONTEXT *CallerAuthCredentials,
const CSSM_TP_CONFIRM_RESPONSE *Responses,
const CSSM_TP_AUTHORITY_ID *PreferredAuthority)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_TP_ReceiveConfirmation has been deprecated in 10.7 and later.
There is currently no direct replacement.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_TP_ReceiveConfirmation (CSSM_TP_HANDLE TPHandle,
const CSSM_DATA *ReferenceIdentifier,
CSSM_TP_CONFIRM_RESPONSE_PTR *Responses,
sint32 *ElapsedTime)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_TP_CertReclaimKey has been deprecated in 10.7 and later.
There is currently no direct replacement.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_TP_CertReclaimKey (CSSM_TP_HANDLE TPHandle,
const CSSM_CERTGROUP *CertGroup,
uint32 CertIndex,
CSSM_LONG_HANDLE KeyCacheHandle,
CSSM_CSP_HANDLE CSPHandle,
const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_TP_CertReclaimAbort has been deprecated in 10.7 and later.
There is currently no direct replacement.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_TP_CertReclaimAbort (CSSM_TP_HANDLE TPHandle,
CSSM_LONG_HANDLE KeyCacheHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_TP_FormRequest has been deprecated in 10.7 and later.
There is currently no direct replacement.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_TP_FormRequest (CSSM_TP_HANDLE TPHandle,
const CSSM_TP_AUTHORITY_ID *PreferredAuthority,
CSSM_TP_FORM_TYPE FormType,
CSSM_DATA_PTR BlankForm)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_TP_FormSubmit has been deprecated in 10.7 and later.
There is currently no direct replacement.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_TP_FormSubmit (CSSM_TP_HANDLE TPHandle,
CSSM_TP_FORM_TYPE FormType,
const CSSM_DATA *Form,
const CSSM_TP_AUTHORITY_ID *ClearanceAuthority,
const CSSM_TP_AUTHORITY_ID *RepresentedAuthority,
CSSM_ACCESS_CREDENTIALS_PTR Credentials)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_TP_CertGroupVerify has been deprecated in 10.7 and later.
There is currently no direct replacement.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_TP_CertGroupVerify (CSSM_TP_HANDLE TPHandle,
CSSM_CL_HANDLE CLHandle,
CSSM_CSP_HANDLE CSPHandle,
const CSSM_CERTGROUP *CertGroupToBeVerified,
const CSSM_TP_VERIFY_CONTEXT *VerifyContext,
CSSM_TP_VERIFY_CONTEXT_RESULT_PTR VerifyContextResult)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_TP_CertCreateTemplate has been deprecated in 10.7 and later.
There is currently no direct replacement.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_TP_CertCreateTemplate (CSSM_TP_HANDLE TPHandle,
CSSM_CL_HANDLE CLHandle,
uint32 NumberOfFields,
const CSSM_FIELD *CertFields,
CSSM_DATA_PTR CertTemplate)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_TP_CertGetAllTemplateFields has been deprecated in 10.7 and later.
There is currently no direct replacement.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_TP_CertGetAllTemplateFields (CSSM_TP_HANDLE TPHandle,
CSSM_CL_HANDLE CLHandle,
const CSSM_DATA *CertTemplate,
uint32 *NumberOfFields,
CSSM_FIELD_PTR *CertFields)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_TP_CertSign has been deprecated in 10.7 and later.
The replacement API is SecSignTransformCreate.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_TP_CertSign (CSSM_TP_HANDLE TPHandle,
CSSM_CL_HANDLE CLHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *CertTemplateToBeSigned,
const CSSM_CERTGROUP *SignerCertGroup,
const CSSM_TP_VERIFY_CONTEXT *SignerVerifyContext,
CSSM_TP_VERIFY_CONTEXT_RESULT_PTR SignerVerifyResult,
CSSM_DATA_PTR SignedCert)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_TP_CrlVerify has been deprecated in 10.7 and later.
The replacement API is SecVerifyTransformCreate.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_TP_CrlVerify (CSSM_TP_HANDLE TPHandle,
CSSM_CL_HANDLE CLHandle,
CSSM_CSP_HANDLE CSPHandle,
const CSSM_ENCODED_CRL *CrlToBeVerified,
const CSSM_CERTGROUP *SignerCertGroup,
const CSSM_TP_VERIFY_CONTEXT *VerifyContext,
CSSM_TP_VERIFY_CONTEXT_RESULT_PTR RevokerVerifyResult)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_TP_CrlCreateTemplate has been deprecated in 10.7 and later.
There is currently no direct replacement.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_TP_CrlCreateTemplate (CSSM_TP_HANDLE TPHandle,
CSSM_CL_HANDLE CLHandle,
uint32 NumberOfFields,
const CSSM_FIELD *CrlFields,
CSSM_DATA_PTR NewCrlTemplate)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_TP_CertRevoke has been deprecated in 10.7 and later.
There is currently no direct replacement.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_TP_CertRevoke (CSSM_TP_HANDLE TPHandle,
CSSM_CL_HANDLE CLHandle,
CSSM_CSP_HANDLE CSPHandle,
const CSSM_DATA *OldCrlTemplate,
const CSSM_CERTGROUP *CertGroupToBeRevoked,
const CSSM_CERTGROUP *RevokerCertGroup,
const CSSM_TP_VERIFY_CONTEXT *RevokerVerifyContext,
CSSM_TP_VERIFY_CONTEXT_RESULT_PTR RevokerVerifyResult,
CSSM_TP_CERTCHANGE_REASON Reason,
CSSM_DATA_PTR NewCrlTemplate)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_TP_CertRemoveFromCrlTemplate has been deprecated in 10.7 and later.
There is currently no direct replacement.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_TP_CertRemoveFromCrlTemplate (CSSM_TP_HANDLE TPHandle,
CSSM_CL_HANDLE CLHandle,
CSSM_CSP_HANDLE CSPHandle,
const CSSM_DATA *OldCrlTemplate,
const CSSM_CERTGROUP *CertGroupToBeRemoved,
const CSSM_CERTGROUP *RevokerCertGroup,
const CSSM_TP_VERIFY_CONTEXT *RevokerVerifyContext,
CSSM_TP_VERIFY_CONTEXT_RESULT_PTR RevokerVerifyResult,
CSSM_DATA_PTR NewCrlTemplate)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_TP_CrlSign has been deprecated in 10.7 and later.
The replacement API is SecVerifyTransformCreate.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_TP_CrlSign (CSSM_TP_HANDLE TPHandle,
CSSM_CL_HANDLE CLHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_ENCODED_CRL *CrlToBeSigned,
const CSSM_CERTGROUP *SignerCertGroup,
const CSSM_TP_VERIFY_CONTEXT *SignerVerifyContext,
CSSM_TP_VERIFY_CONTEXT_RESULT_PTR SignerVerifyResult,
CSSM_DATA_PTR SignedCrl)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_TP_ApplyCrlToDb has been deprecated in 10.7 and later.
There is currently no direct replacement.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_TP_ApplyCrlToDb (CSSM_TP_HANDLE TPHandle,
CSSM_CL_HANDLE CLHandle,
CSSM_CSP_HANDLE CSPHandle,
const CSSM_ENCODED_CRL *CrlToBeApplied,
const CSSM_CERTGROUP *SignerCertGroup,
const CSSM_TP_VERIFY_CONTEXT *ApplyCrlVerifyContext,
CSSM_TP_VERIFY_CONTEXT_RESULT_PTR ApplyCrlVerifyResult)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_TP_CertGroupConstruct has been deprecated in 10.7 and later.
There is currently no direct replacement.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_TP_CertGroupConstruct (CSSM_TP_HANDLE TPHandle,
CSSM_CL_HANDLE CLHandle,
CSSM_CSP_HANDLE CSPHandle,
const CSSM_DL_DB_LIST *DBList,
const void *ConstructParams,
const CSSM_CERTGROUP *CertGroupFrag,
CSSM_CERTGROUP_PTR *CertGroup)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_TP_CertGroupPrune has been deprecated in 10.7 and later.
There is currently no direct replacement.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_TP_CertGroupPrune (CSSM_TP_HANDLE TPHandle,
CSSM_CL_HANDLE CLHandle,
const CSSM_DL_DB_LIST *DBList,
const CSSM_CERTGROUP *OrderedCertGroup,
CSSM_CERTGROUP_PTR *PrunedCertGroup)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_TP_CertGroupToTupleGroup has been deprecated in 10.7 and later.
There is currently no direct replacement.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_TP_CertGroupToTupleGroup (CSSM_TP_HANDLE TPHandle,
CSSM_CL_HANDLE CLHandle,
const CSSM_CERTGROUP *CertGroup,
CSSM_TUPLEGROUP_PTR *TupleGroup)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_TP_TupleGroupToCertGroup has been deprecated in 10.7 and later.
There is currently no direct replacement.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_TP_TupleGroupToCertGroup (CSSM_TP_HANDLE TPHandle,
CSSM_CL_HANDLE CLHandle,
const CSSM_TUPLEGROUP *TupleGroup,
CSSM_CERTGROUP_PTR *CertTemplates)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_TP_PassThrough has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_TP_PassThrough (CSSM_TP_HANDLE TPHandle,
CSSM_CL_HANDLE CLHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_DL_DB_LIST *DBList,
uint32 PassThroughId,
const void *InputParams,
void **OutputParams)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* Authorization Computation Operations */
/* --------------------------------------------------------------------------
CSSM_AC_AuthCompute has been deprecated in 10.7 and later.
Please see the APIs in the SecAccess.h file for a replacement.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_AC_AuthCompute (CSSM_AC_HANDLE ACHandle,
const CSSM_TUPLEGROUP *BaseAuthorizations,
const CSSM_TUPLEGROUP *Credentials,
uint32 NumberOfRequestors,
const CSSM_LIST *Requestors,
const CSSM_LIST *RequestedAuthorizationPeriod,
const CSSM_LIST *RequestedAuthorization,
CSSM_TUPLEGROUP_PTR AuthorizationResult)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_AC_PassThrough has been deprecated in 10.7 and later.
Please see the APIs in the SecAccess.h file for a replacement.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_AC_PassThrough (CSSM_AC_HANDLE ACHandle,
CSSM_TP_HANDLE TPHandle,
CSSM_CL_HANDLE CLHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_DL_DB_LIST *DBList,
uint32 PassThroughId,
const void *InputParams,
void **OutputParams)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* Certificate Library Operations */
/* --------------------------------------------------------------------------
CSSM_CL_CertCreateTemplate has been deprecated in 10.7 and later.
There is currently no direct replacement.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CertCreateTemplate (CSSM_CL_HANDLE CLHandle,
uint32 NumberOfFields,
const CSSM_FIELD *CertFields,
CSSM_DATA_PTR CertTemplate)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CertGetAllTemplateFields has been deprecated in 10.7 and later.
There is currently no direct replacement.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CertGetAllTemplateFields (CSSM_CL_HANDLE CLHandle,
const CSSM_DATA *CertTemplate,
uint32 *NumberOfFields,
CSSM_FIELD_PTR *CertFields)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CertSign has been deprecated in 10.7 and later.
There is currently no direct replacement.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CertSign (CSSM_CL_HANDLE CLHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *CertTemplate,
const CSSM_FIELD *SignScope,
uint32 ScopeSize,
CSSM_DATA_PTR SignedCert)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CertVerify has been deprecated in 10.7 and later.
There is currently no direct replacement.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CertVerify (CSSM_CL_HANDLE CLHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *CertToBeVerified,
const CSSM_DATA *SignerCert,
const CSSM_FIELD *VerifyScope,
uint32 ScopeSize)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CertVerifyWithKey has been deprecated in 10.7 and later.
There is currently no direct replacement.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CertVerifyWithKey (CSSM_CL_HANDLE CLHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *CertToBeVerified)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CertVerifyWithKey has been deprecated in 10.7 and later.
This is replaced with the SecCertificateCopyValues API.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CertGetFirstFieldValue (CSSM_CL_HANDLE CLHandle,
const CSSM_DATA *Cert,
const CSSM_OID *CertField,
CSSM_HANDLE_PTR ResultsHandle,
uint32 *NumberOfMatchedFields,
CSSM_DATA_PTR *Value)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CertGetNextFieldValue has been deprecated in 10.7 and later.
This is replaced with the SecCertificateCopyValues API.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CertGetNextFieldValue (CSSM_CL_HANDLE CLHandle,
CSSM_HANDLE ResultsHandle,
CSSM_DATA_PTR *Value)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CertAbortQuery has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CertAbortQuery (CSSM_CL_HANDLE CLHandle,
CSSM_HANDLE ResultsHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CertGetKeyInfo has been deprecated in 10.7 and later.
This is replaced with the SecCertificateCopyValues API.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CertGetKeyInfo (CSSM_CL_HANDLE CLHandle,
const CSSM_DATA *Cert,
CSSM_KEY_PTR *Key)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CertGetAllFields has been deprecated in 10.7 and later.
This is replaced with the SecCertificateCopyValues API.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CertGetAllFields (CSSM_CL_HANDLE CLHandle,
const CSSM_DATA *Cert,
uint32 *NumberOfFields,
CSSM_FIELD_PTR *CertFields)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_FreeFields has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_FreeFields (CSSM_CL_HANDLE CLHandle,
uint32 NumberOfFields,
CSSM_FIELD_PTR *Fields)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_FreeFieldValue has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_FreeFieldValue (CSSM_CL_HANDLE CLHandle,
const CSSM_OID *CertOrCrlOid,
CSSM_DATA_PTR Value)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CertCache has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CertCache (CSSM_CL_HANDLE CLHandle,
const CSSM_DATA *Cert,
CSSM_HANDLE_PTR CertHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CertGetFirstCachedFieldValue has been deprecated in 10.7 and later.
This is replaced with the SecCertificateCopyValues API
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CertGetFirstCachedFieldValue (CSSM_CL_HANDLE CLHandle,
CSSM_HANDLE CertHandle,
const CSSM_OID *CertField,
CSSM_HANDLE_PTR ResultsHandle,
uint32 *NumberOfMatchedFields,
CSSM_DATA_PTR *Value)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CertGetNextCachedFieldValue has been deprecated in 10.7 and later.
This is replaced with the SecCertificateCopyValues API
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CertGetNextCachedFieldValue (CSSM_CL_HANDLE CLHandle,
CSSM_HANDLE ResultsHandle,
CSSM_DATA_PTR *Value)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CertAbortCache has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CertAbortCache (CSSM_CL_HANDLE CLHandle,
CSSM_HANDLE CertHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CertGroupToSignedBundle has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CertGroupToSignedBundle (CSSM_CL_HANDLE CLHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_CERTGROUP *CertGroupToBundle,
const CSSM_CERT_BUNDLE_HEADER *BundleInfo,
CSSM_DATA_PTR SignedBundle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CertGroupFromVerifiedBundle has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CertGroupFromVerifiedBundle (CSSM_CL_HANDLE CLHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_CERT_BUNDLE *CertBundle,
const CSSM_DATA *SignerCert,
CSSM_CERTGROUP_PTR *CertGroup)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CertDescribeFormat has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CertDescribeFormat (CSSM_CL_HANDLE CLHandle,
uint32 *NumberOfFields,
CSSM_OID_PTR *OidList)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CrlCreateTemplate has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CrlCreateTemplate (CSSM_CL_HANDLE CLHandle,
uint32 NumberOfFields,
const CSSM_FIELD *CrlTemplate,
CSSM_DATA_PTR NewCrl)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CrlSetFields has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CrlSetFields (CSSM_CL_HANDLE CLHandle,
uint32 NumberOfFields,
const CSSM_FIELD *CrlTemplate,
const CSSM_DATA *OldCrl,
CSSM_DATA_PTR ModifiedCrl)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CrlAddCert has been deprecated in 10.7 and later.
There is currently no direct replacement.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CrlAddCert (CSSM_CL_HANDLE CLHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *Cert,
uint32 NumberOfFields,
const CSSM_FIELD *CrlEntryFields,
const CSSM_DATA *OldCrl,
CSSM_DATA_PTR NewCrl)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CrlRemoveCert has been deprecated in 10.7 and later.
There is currently no direct replacement.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CrlRemoveCert (CSSM_CL_HANDLE CLHandle,
const CSSM_DATA *Cert,
const CSSM_DATA *OldCrl,
CSSM_DATA_PTR NewCrl)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CrlSign has been deprecated in 10.7 and later.
The replacement API would be to use the SecSignTransformCreate transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CrlSign (CSSM_CL_HANDLE CLHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *UnsignedCrl,
const CSSM_FIELD *SignScope,
uint32 ScopeSize,
CSSM_DATA_PTR SignedCrl)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CrlVerify has been deprecated in 10.7 and later.
The replacement API would be to use the SecVerifyTransformCreate transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CrlVerify (CSSM_CL_HANDLE CLHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *CrlToBeVerified,
const CSSM_DATA *SignerCert,
const CSSM_FIELD *VerifyScope,
uint32 ScopeSize)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CrlVerifyWithKey has been deprecated in 10.7 and later.
The replacement API would be to use the SecVerifyTransformCreate transform.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CrlVerifyWithKey (CSSM_CL_HANDLE CLHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *CrlToBeVerified)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_IsCertInCrl has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_IsCertInCrl (CSSM_CL_HANDLE CLHandle,
const CSSM_DATA *Cert,
const CSSM_DATA *Crl,
CSSM_BOOL *CertFound)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CrlGetFirstFieldValue has been deprecated in 10.7 and later.
This is replaced with the SecCertificateCopyValues API
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CrlGetFirstFieldValue (CSSM_CL_HANDLE CLHandle,
const CSSM_DATA *Crl,
const CSSM_OID *CrlField,
CSSM_HANDLE_PTR ResultsHandle,
uint32 *NumberOfMatchedFields,
CSSM_DATA_PTR *Value)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CrlGetNextFieldValue has been deprecated in 10.7 and later.
This is replaced with the SecCertificateCopyValues API
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CrlGetNextFieldValue (CSSM_CL_HANDLE CLHandle,
CSSM_HANDLE ResultsHandle,
CSSM_DATA_PTR *Value)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CrlAbortQuery has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CrlAbortQuery (CSSM_CL_HANDLE CLHandle,
CSSM_HANDLE ResultsHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CrlGetAllFields has been deprecated in 10.7 and later.
This is replaced with the SecCertificateCopyValues API
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CrlGetAllFields (CSSM_CL_HANDLE CLHandle,
const CSSM_DATA *Crl,
uint32 *NumberOfCrlFields,
CSSM_FIELD_PTR *CrlFields)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CrlCache has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CrlCache (CSSM_CL_HANDLE CLHandle,
const CSSM_DATA *Crl,
CSSM_HANDLE_PTR CrlHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_IsCertInCachedCrl has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_IsCertInCachedCrl (CSSM_CL_HANDLE CLHandle,
const CSSM_DATA *Cert,
CSSM_HANDLE CrlHandle,
CSSM_BOOL *CertFound,
CSSM_DATA_PTR CrlRecordIndex)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CrlGetFirstCachedFieldValue has been deprecated in 10.7 and later.
This is replaced with the SecCertificateCopyValues API
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CrlGetFirstCachedFieldValue (CSSM_CL_HANDLE CLHandle,
CSSM_HANDLE CrlHandle,
const CSSM_DATA *CrlRecordIndex,
const CSSM_OID *CrlField,
CSSM_HANDLE_PTR ResultsHandle,
uint32 *NumberOfMatchedFields,
CSSM_DATA_PTR *Value)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CrlGetNextCachedFieldValue has been deprecated in 10.7 and later.
This is replaced with the SecCertificateCopyValues API
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CrlGetNextCachedFieldValue (CSSM_CL_HANDLE CLHandle,
CSSM_HANDLE ResultsHandle,
CSSM_DATA_PTR *Value)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CrlGetAllCachedRecordFields has been deprecated in 10.7 and later.
This is replaced with the SecCertificateCopyValues API
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CrlGetAllCachedRecordFields (CSSM_CL_HANDLE CLHandle,
CSSM_HANDLE CrlHandle,
const CSSM_DATA *CrlRecordIndex,
uint32 *NumberOfFields,
CSSM_FIELD_PTR *CrlFields)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CrlAbortCache has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CrlAbortCache (CSSM_CL_HANDLE CLHandle,
CSSM_HANDLE CrlHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_CrlDescribeFormat has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_CrlDescribeFormat (CSSM_CL_HANDLE CLHandle,
uint32 *NumberOfFields,
CSSM_OID_PTR *OidList)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_CL_PassThrough has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_CL_PassThrough (CSSM_CL_HANDLE CLHandle,
CSSM_CC_HANDLE CCHandle,
uint32 PassThroughId,
const void *InputParams,
void **OutputParams)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* Data Storage Library Operations */
/* --------------------------------------------------------------------------
CSSM_DL_DbOpen has been deprecated in 10.7 and later.
The replacement API is SecKeychainOpen
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DL_DbOpen (CSSM_DL_HANDLE DLHandle,
const char *DbName,
const CSSM_NET_ADDRESS *DbLocation,
CSSM_DB_ACCESS_TYPE AccessRequest,
const CSSM_ACCESS_CREDENTIALS *AccessCred,
const void *OpenParameters,
CSSM_DB_HANDLE *DbHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DL_DbClose has been deprecated in 10.7 and later. There is no alternate
API as this call is only needed when calling CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DL_DbClose (CSSM_DL_DB_HANDLE DLDBHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DL_DbCreate has been deprecated in 10.7 and later.
The replacement API is SecKeychainCreate
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DL_DbCreate (CSSM_DL_HANDLE DLHandle,
const char *DbName,
const CSSM_NET_ADDRESS *DbLocation,
const CSSM_DBINFO *DBInfo,
CSSM_DB_ACCESS_TYPE AccessRequest,
const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry,
const void *OpenParameters,
CSSM_DB_HANDLE *DbHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DL_DbDelete has been deprecated in 10.7 and later.
The replacement API is SecKeychainDelete
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DL_DbDelete (CSSM_DL_HANDLE DLHandle,
const char *DbName,
const CSSM_NET_ADDRESS *DbLocation,
const CSSM_ACCESS_CREDENTIALS *AccessCred)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DL_CreateRelation has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DL_CreateRelation (CSSM_DL_DB_HANDLE DLDBHandle,
CSSM_DB_RECORDTYPE RelationID,
const char *RelationName,
uint32 NumberOfAttributes,
const CSSM_DB_SCHEMA_ATTRIBUTE_INFO *pAttributeInfo,
uint32 NumberOfIndexes,
const CSSM_DB_SCHEMA_INDEX_INFO *pIndexInfo)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DL_DestroyRelation has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DL_DestroyRelation (CSSM_DL_DB_HANDLE DLDBHandle,
CSSM_DB_RECORDTYPE RelationID)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DL_Authenticate has been deprecated in 10.7 and later.
The replacement API is SecKeychainUnlock
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DL_Authenticate (CSSM_DL_DB_HANDLE DLDBHandle,
CSSM_DB_ACCESS_TYPE AccessRequest,
const CSSM_ACCESS_CREDENTIALS *AccessCred)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DL_GetDbAcl has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DL_GetDbAcl (CSSM_DL_DB_HANDLE DLDBHandle,
const CSSM_STRING *SelectionTag,
uint32 *NumberOfAclInfos,
CSSM_ACL_ENTRY_INFO_PTR *AclInfos)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DL_ChangeDbAcl has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DL_ChangeDbAcl (CSSM_DL_DB_HANDLE DLDBHandle,
const CSSM_ACCESS_CREDENTIALS *AccessCred,
const CSSM_ACL_EDIT *AclEdit)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DL_GetDbOwner has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DL_GetDbOwner (CSSM_DL_DB_HANDLE DLDBHandle,
CSSM_ACL_OWNER_PROTOTYPE_PTR Owner)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DL_ChangeDbOwner has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DL_ChangeDbOwner (CSSM_DL_DB_HANDLE DLDBHandle,
const CSSM_ACCESS_CREDENTIALS *AccessCred,
const CSSM_ACL_OWNER_PROTOTYPE *NewOwner)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DL_GetDbNames has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DL_GetDbNames (CSSM_DL_HANDLE DLHandle,
CSSM_NAME_LIST_PTR *NameList)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DL_GetDbNameFromHandle has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DL_GetDbNameFromHandle (CSSM_DL_DB_HANDLE DLDBHandle,
char **DbName)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DL_FreeNameList has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DL_FreeNameList (CSSM_DL_HANDLE DLHandle,
CSSM_NAME_LIST_PTR NameList)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DL_Authenticate has been deprecated in 10.7 and later.
The replacement API are SecKeychainAddInternetPassword,
SecKeychainAddGenericPassword, SecItemAdd
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DL_DataInsert (CSSM_DL_DB_HANDLE DLDBHandle,
CSSM_DB_RECORDTYPE RecordType,
const CSSM_DB_RECORD_ATTRIBUTE_DATA *Attributes,
const CSSM_DATA *Data,
CSSM_DB_UNIQUE_RECORD_PTR *UniqueId)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DL_Authenticate has been deprecated in 10.7 and later.
The replacement API is SecItemDelete
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DL_DataDelete (CSSM_DL_DB_HANDLE DLDBHandle,
const CSSM_DB_UNIQUE_RECORD *UniqueRecordIdentifier)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DL_Authenticate has been deprecated in 10.7 and later.
The replacement API is SecItemUpdate
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DL_DataModify (CSSM_DL_DB_HANDLE DLDBHandle,
CSSM_DB_RECORDTYPE RecordType,
CSSM_DB_UNIQUE_RECORD_PTR UniqueRecordIdentifier,
const CSSM_DB_RECORD_ATTRIBUTE_DATA *AttributesToBeModified,
const CSSM_DATA *DataToBeModified,
CSSM_DB_MODIFY_MODE ModifyMode)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DL_DataGetFirst has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs. SecItemCopyMatching may return multiple items if specified to
do so. The user could then retrieve the first in the list of items.
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DL_DataGetFirst (CSSM_DL_DB_HANDLE DLDBHandle,
const CSSM_QUERY *Query,
CSSM_HANDLE_PTR ResultsHandle,
CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
CSSM_DATA_PTR Data,
CSSM_DB_UNIQUE_RECORD_PTR *UniqueId)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DL_DataGetNext has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs. SecItemCopyMatching may return multiple items if specified to
do so. The user could then retrieve the items in the list
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DL_DataGetNext (CSSM_DL_DB_HANDLE DLDBHandle,
CSSM_HANDLE ResultsHandle,
CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
CSSM_DATA_PTR Data,
CSSM_DB_UNIQUE_RECORD_PTR *UniqueId)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DL_DataAbortQuery has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DL_DataAbortQuery (CSSM_DL_DB_HANDLE DLDBHandle,
CSSM_HANDLE ResultsHandle)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DL_DataGetFromUniqueRecordId has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DL_DataGetFromUniqueRecordId (CSSM_DL_DB_HANDLE DLDBHandle,
const CSSM_DB_UNIQUE_RECORD *UniqueRecord,
CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
CSSM_DATA_PTR Data)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DL_FreeUniqueRecord has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DL_FreeUniqueRecord (CSSM_DL_DB_HANDLE DLDBHandle,
CSSM_DB_UNIQUE_RECORD_PTR UniqueRecord)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/* --------------------------------------------------------------------------
CSSM_DL_PassThrough has been deprecated in 10.7 and later.
There is no alternate API as this call is only needed when calling
CDSA APIs
-------------------------------------------------------------------------- */
CSSM_RETURN CSSMAPI
CSSM_DL_PassThrough (CSSM_DL_DB_HANDLE DLDBHandle,
uint32 PassThroughId,
const void *InputParams,
void **OutputParams)
DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
#ifdef __cplusplus
}
#endif
#endif /* _CSSMAPI_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/oids.h | /*
* Copyright (c) 2005-2009,2011-2016 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
* oids.h - declaration of OID consts
*
*/
/* We need to guard against the other copy of libDER.
* This is outside this header's guards because DERItem.h currently guards
* the DERItem type against this header (legacy from when this header also
* defined the type). */
#ifndef _LIB_DER_H_
#include <libDER/DERItem.h>
#endif /* _LIB_DER_H_ */
#ifndef _SECURITY_OIDS_H_
#define _SECURITY_OIDS_H_
#include <stdint.h>
#include <string.h>
__BEGIN_DECLS
/* Algorithm oids. */
extern const DERItem
oidRsa, /* PKCS1 RSA encryption, used to identify RSA keys */
oidMd2Rsa, /* PKCS1 md2withRSAEncryption signature alg */
oidMd4Rsa, /* PKCS1 md4withRSAEncryption signature alg */
oidMd5Rsa, /* PKCS1 md5withRSAEncryption signature alg */
oidSha1Rsa, /* PKCS1 sha1withRSAEncryption signature alg */
oidSha256Rsa, /* PKCS1 sha256WithRSAEncryption signature alg */
oidSha384Rsa, /* PKCS1 sha384WithRSAEncryption signature alg */
oidSha512Rsa, /* PKCS1 sha512WithRSAEncryption signature alg */
oidSha224Rsa, /* PKCS1 sha224WithRSAEncryption signature alg */
oidEcPubKey, /* ECDH or ECDSA public key in a certificate */
oidSha1Ecdsa, /* ECDSA with SHA1 signature alg */
oidSha224Ecdsa, /* ECDSA with SHA224 signature alg */
oidSha256Ecdsa, /* ECDSA with SHA256 signature alg */
oidSha384Ecdsa, /* ECDSA with SHA384 signature alg */
oidSha512Ecdsa, /* ECDSA with SHA512 signature alg */
oidSha1Dsa, /* ANSI X9.57 DSA with SHA1 signature alg */
oidMd2, /* OID_RSA_HASH 2 */
oidMd4, /* OID_RSA_HASH 4 */
oidMd5, /* OID_RSA_HASH 5 */
oidSha1, /* OID_OIW_ALGORITHM 26 */
oidSha1DsaOIW, /* OID_OIW_ALGORITHM 27 */
oidSha1DsaCommonOIW,/* OID_OIW_ALGORITHM 28 */
oidSha1RsaOIW, /* OID_OIW_ALGORITHM 29 */
oidSha256, /* OID_NIST_HASHALG 1 */
oidSha384, /* OID_NIST_HASHALG 2 */
oidSha512, /* OID_NIST_HASHALG 3 */
oidSha224, /* OID_NIST_HASHALG 4 */
oidFee, /* APPLE_ALG_OID 1 */
oidMd5Fee, /* APPLE_ALG_OID 3 */
oidSha1Fee, /* APPLE_ALG_OID 4 */
oidEcPrime192v1, /* OID_EC_CURVE 1 prime192v1/secp192r1/ansiX9p192r1*/
oidEcPrime256v1, /* OID_EC_CURVE 7 prime256v1/secp256r1*/
oidAnsip384r1, /* OID_CERTICOM_EC_CURVE 34 ansip384r1/secp384r1*/
oidAnsip521r1; /* OID_CERTICOM_EC_CURVE 35 ansip521r1/secp521r1*/
/* Standard X.509 Cert and CRL extensions. */
extern const DERItem
oidSubjectKeyIdentifier,
oidKeyUsage,
oidPrivateKeyUsagePeriod,
oidSubjectAltName,
oidIssuerAltName,
oidBasicConstraints,
oidNameConstraints,
oidCrlDistributionPoints,
oidCertificatePolicies,
oidAnyPolicy,
oidPolicyMappings,
oidAuthorityKeyIdentifier,
oidPolicyConstraints,
oidExtendedKeyUsage,
oidAnyExtendedKeyUsage,
oidInhibitAnyPolicy,
oidAuthorityInfoAccess,
oidSubjectInfoAccess,
oidAdOCSP,
oidAdCAIssuer,
oidNetscapeCertType,
oidEntrustVersInfo,
oidMSNTPrincipalName;
/* Policy Qualifier IDs for Internet policy qualifiers. */
extern const DERItem
oidQtCps,
oidQtUNotice;
/* X.501 Name IDs. */
extern const DERItem
oidCommonName,
oidCountryName,
oidLocalityName,
oidStateOrProvinceName,
oidOrganizationName,
oidOrganizationalUnitName,
oidDescription,
oidEmailAddress,
oidFriendlyName,
oidLocalKeyId;
/* X.509 Extended Key Usages */
extern const DERItem
oidExtendedKeyUsageServerAuth,
oidExtendedKeyUsageClientAuth,
oidExtendedKeyUsageCodeSigning,
oidExtendedKeyUsageEmailProtection,
oidExtendedKeyUsageTimeStamping,
oidExtendedKeyUsageOCSPSigning,
oidExtendedKeyUsageIPSec,
oidExtendedKeyUsageMicrosoftSGC,
oidExtendedKeyUsageNetscapeSGC;
/* Google Certificate Transparency OIDs */
extern const DERItem
oidGoogleEmbeddedSignedCertificateTimestamp,
oidGoogleOCSPSignedCertificateTimestamp;
__END_DECLS
#endif /* _SECURITY_OIDS_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecSharedCredential.h | /*
* Copyright (c) 2014-2020 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
@header SecSharedCredential
SecSharedCredential defines CoreFoundation-based functions for
storing and requesting shared password-based credentials.
These credentials are currently able to be shared with Safari and
applications which have a 'com.apple.developer.associated-domains'
entitlement that includes the domain being requested.
*/
#ifndef _SECURITY_SECSHAREDCREDENTIAL_H_
#define _SECURITY_SECSHAREDCREDENTIAL_H_
#include <Security/SecItem.h>
#include <CoreFoundation/CoreFoundation.h>
#include <AvailabilityMacros.h>
__BEGIN_DECLS
CF_ASSUME_NONNULL_BEGIN
CF_IMPLICIT_BRIDGING_ENABLED
#ifdef __BLOCKS__
/*!
@enum Credential Key Constants
@discussion Predefined key constants used to get values in a dictionary
of credentials returned by SecRequestWebCredential.
@constant kSecSharedPassword Specifies a dictionary key whose value is a
shared password. You use this key to get a value of type CFStringRef
that contains a password.
*/
extern const CFStringRef kSecSharedPassword
API_AVAILABLE(ios(8.0), macCatalyst(14.0), macos(11.0))
API_UNAVAILABLE(tvos, watchos);
/*!
@function SecAddSharedWebCredential
@abstract Asynchronously store (or update) a shared password for a website.
@param fqdn The fully qualified domain name of the website requiring the password.
@param account The account name associated with this password.
@param password The password to be stored. Pass NULL to remove a shared password if it exists.
@param completionHandler A block which will be invoked when the function has completed. If the shared password was successfully added (or removed), the CFErrorRef parameter passed to the block will be NULL. If the error parameter is non-NULL, an error occurred and the error reference will hold the result. Note: the error reference will be automatically released after this handler is called, though you may optionally retain it for as long as needed.
@discussion This function adds a shared password item which will be accessible by Safari and applications that have the specified fully-qualified domain name in their 'com.apple.developer.associated-domains' entitlement. If a shared password item already exists for the specified website and account, it will be updated with the provided password. To remove a password, pass NULL for the password parameter.
Note: since a request involving shared web credentials may potentially require user interaction or other verification to be approved, this function is dispatched asynchronously; your code provides a completion handler that will be called once the results (if any) are available.
*/
void SecAddSharedWebCredential(CFStringRef fqdn, CFStringRef account, CFStringRef __nullable password,
void (^completionHandler)(CFErrorRef __nullable error))
API_AVAILABLE(ios(8.0), macCatalyst(14.0), macos(11.0))
API_UNAVAILABLE(tvos, watchos);
/*!
@function SecRequestSharedWebCredential
@abstract Asynchronously obtain one or more shared passwords for a website.
@param fqdn (Optional) Fully qualified domain name of the website for which passwords are being requested. If NULL is passed in this argument, the domain name(s) listed in the calling application's 'com.apple.developer.associated-domains' entitlement are searched implicitly.
@param account (Optional) Account name for which passwords are being requested. The account may be NULL to request all shared credentials which are available for the site, allowing the caller to discover an existing account.
@param completionHandler A block which will be called to deliver the requested credentials. If no matching items were found, the credentials array will be empty, and the CFErrorRef parameter will provide the error result. Note: the credentials and error references will be automatically released after this handler is called, though you may optionally retain either for as long as needed.
@discussion This function requests one or more shared passwords for a given website, depending on whether the optional account parameter is supplied. To obtain results, the website specified in the fqdn parameter must be one which matches an entry in the calling application's 'com.apple.developer.associated-domains' entitlement.
If matching shared password items are found, the credentials provided to the completionHandler will be a CFArrayRef containing CFDictionaryRef entries. Each dictionary entry will contain the following pairs (see Security/SecItem.h):
key: kSecAttrServer value: CFStringRef (the website)
key: kSecAttrAccount value: CFStringRef (the account)
key: kSecSharedPassword value: CFStringRef (the password)
If the found item specifies a non-standard port number (i.e. other than 443 for https), the following key may also be present:
key: kSecAttrPort value: CFNumberRef (the port number)
Note: since a request involving shared web credentials may potentially require user interaction or other verification to be approved, this function is dispatched asynchronously; your code provides a completion handler that will be called once the results (if any) are available.
*/
void SecRequestSharedWebCredential(CFStringRef __nullable fqdn, CFStringRef __nullable account,
void (^completionHandler)(CFArrayRef __nullable credentials, CFErrorRef __nullable error))
API_DEPRECATED("Use ASAuthorizationController to make an ASAuthorizationPasswordRequest (AuthenticationServices framework)",
ios(8.0,14.0), macCatalyst(14.0,14.0), macos(10.16,11.0))
API_UNAVAILABLE(tvos, watchos);
/*!
@function SecCreateSharedWebCredentialPassword
@abstract Returns a randomly generated password.
@return CFStringRef password in the form xxx-xxx-xxx-xxx where x is taken from the sets "abcdefghkmnopqrstuvwxy", "ABCDEFGHJKLMNPQRSTUVWXYZ", "3456789" with at least one character from each set being present.
*/
__nullable
CFStringRef SecCreateSharedWebCredentialPassword(void)
API_AVAILABLE(ios(8.0), macCatalyst(14.0), macos(11.0))
API_UNAVAILABLE(tvos, watchos);
#endif /* __BLOCKS__ */
CF_IMPLICIT_BRIDGING_DISABLED
CF_ASSUME_NONNULL_END
__END_DECLS
#endif /* !_SECURITY_SECSHAREDCREDENTIAL_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/cssmcli.h | /*
* Copyright (c) 1999-2001,2004,2011,2014 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*
* cssmcli.h -- Service Provider Interface for Certificate Library Modules
*/
#ifndef _CSSMCLI_H_
#define _CSSMCLI_H_ 1
#include <Security/cssmtype.h>
#ifdef __cplusplus
extern "C" {
#endif
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_spi_cl_funcs {
CSSM_RETURN (CSSMCLI *CertCreateTemplate)
(CSSM_CL_HANDLE CLHandle,
uint32 NumberOfFields,
const CSSM_FIELD *CertFields,
CSSM_DATA_PTR CertTemplate);
CSSM_RETURN (CSSMCLI *CertGetAllTemplateFields)
(CSSM_CL_HANDLE CLHandle,
const CSSM_DATA *CertTemplate,
uint32 *NumberOfFields,
CSSM_FIELD_PTR *CertFields);
CSSM_RETURN (CSSMCLI *CertSign)
(CSSM_CL_HANDLE CLHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *CertTemplate,
const CSSM_FIELD *SignScope,
uint32 ScopeSize,
CSSM_DATA_PTR SignedCert);
CSSM_RETURN (CSSMCLI *CertVerify)
(CSSM_CL_HANDLE CLHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *CertToBeVerified,
const CSSM_DATA *SignerCert,
const CSSM_FIELD *VerifyScope,
uint32 ScopeSize);
CSSM_RETURN (CSSMCLI *CertVerifyWithKey)
(CSSM_CL_HANDLE CLHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *CertToBeVerified);
CSSM_RETURN (CSSMCLI *CertGetFirstFieldValue)
(CSSM_CL_HANDLE CLHandle,
const CSSM_DATA *Cert,
const CSSM_OID *CertField,
CSSM_HANDLE_PTR ResultsHandle,
uint32 *NumberOfMatchedFields,
CSSM_DATA_PTR *Value);
CSSM_RETURN (CSSMCLI *CertGetNextFieldValue)
(CSSM_CL_HANDLE CLHandle,
CSSM_HANDLE ResultsHandle,
CSSM_DATA_PTR *Value);
CSSM_RETURN (CSSMCLI *CertAbortQuery)
(CSSM_CL_HANDLE CLHandle,
CSSM_HANDLE ResultsHandle);
CSSM_RETURN (CSSMCLI *CertGetKeyInfo)
(CSSM_CL_HANDLE CLHandle,
const CSSM_DATA *Cert,
CSSM_KEY_PTR *Key);
CSSM_RETURN (CSSMCLI *CertGetAllFields)
(CSSM_CL_HANDLE CLHandle,
const CSSM_DATA *Cert,
uint32 *NumberOfFields,
CSSM_FIELD_PTR *CertFields);
CSSM_RETURN (CSSMCLI *FreeFields)
(CSSM_CL_HANDLE CLHandle,
uint32 NumberOfFields,
CSSM_FIELD_PTR *FieldArray);
CSSM_RETURN (CSSMCLI *FreeFieldValue)
(CSSM_CL_HANDLE CLHandle,
const CSSM_OID *CertOrCrlOid,
CSSM_DATA_PTR Value);
CSSM_RETURN (CSSMCLI *CertCache)
(CSSM_CL_HANDLE CLHandle,
const CSSM_DATA *Cert,
CSSM_HANDLE_PTR CertHandle);
CSSM_RETURN (CSSMCLI *CertGetFirstCachedFieldValue)
(CSSM_CL_HANDLE CLHandle,
CSSM_HANDLE CertHandle,
const CSSM_OID *CertField,
CSSM_HANDLE_PTR ResultsHandle,
uint32 *NumberOfMatchedFields,
CSSM_DATA_PTR *Value);
CSSM_RETURN (CSSMCLI *CertGetNextCachedFieldValue)
(CSSM_CL_HANDLE CLHandle,
CSSM_HANDLE ResultsHandle,
CSSM_DATA_PTR *Value);
CSSM_RETURN (CSSMCLI *CertAbortCache)
(CSSM_CL_HANDLE CLHandle,
CSSM_HANDLE CertHandle);
CSSM_RETURN (CSSMCLI *CertGroupToSignedBundle)
(CSSM_CL_HANDLE CLHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_CERTGROUP *CertGroupToBundle,
const CSSM_CERT_BUNDLE_HEADER *BundleInfo,
CSSM_DATA_PTR SignedBundle);
CSSM_RETURN (CSSMCLI *CertGroupFromVerifiedBundle)
(CSSM_CL_HANDLE CLHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_CERT_BUNDLE *CertBundle,
const CSSM_DATA *SignerCert,
CSSM_CERTGROUP_PTR *CertGroup);
CSSM_RETURN (CSSMCLI *CertDescribeFormat)
(CSSM_CL_HANDLE CLHandle,
uint32 *NumberOfFields,
CSSM_OID_PTR *OidList);
CSSM_RETURN (CSSMCLI *CrlCreateTemplate)
(CSSM_CL_HANDLE CLHandle,
uint32 NumberOfFields,
const CSSM_FIELD *CrlTemplate,
CSSM_DATA_PTR NewCrl);
CSSM_RETURN (CSSMCLI *CrlSetFields)
(CSSM_CL_HANDLE CLHandle,
uint32 NumberOfFields,
const CSSM_FIELD *CrlTemplate,
const CSSM_DATA *OldCrl,
CSSM_DATA_PTR ModifiedCrl);
CSSM_RETURN (CSSMCLI *CrlAddCert)
(CSSM_CL_HANDLE CLHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *Cert,
uint32 NumberOfFields,
const CSSM_FIELD *CrlEntryFields,
const CSSM_DATA *OldCrl,
CSSM_DATA_PTR NewCrl);
CSSM_RETURN (CSSMCLI *CrlRemoveCert)
(CSSM_CL_HANDLE CLHandle,
const CSSM_DATA *Cert,
const CSSM_DATA *OldCrl,
CSSM_DATA_PTR NewCrl);
CSSM_RETURN (CSSMCLI *CrlSign)
(CSSM_CL_HANDLE CLHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *UnsignedCrl,
const CSSM_FIELD *SignScope,
uint32 ScopeSize,
CSSM_DATA_PTR SignedCrl);
CSSM_RETURN (CSSMCLI *CrlVerify)
(CSSM_CL_HANDLE CLHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *CrlToBeVerified,
const CSSM_DATA *SignerCert,
const CSSM_FIELD *VerifyScope,
uint32 ScopeSize);
CSSM_RETURN (CSSMCLI *CrlVerifyWithKey)
(CSSM_CL_HANDLE CLHandle,
CSSM_CC_HANDLE CCHandle,
const CSSM_DATA *CrlToBeVerified);
CSSM_RETURN (CSSMCLI *IsCertInCrl)
(CSSM_CL_HANDLE CLHandle,
const CSSM_DATA *Cert,
const CSSM_DATA *Crl,
CSSM_BOOL *CertFound);
CSSM_RETURN (CSSMCLI *CrlGetFirstFieldValue)
(CSSM_CL_HANDLE CLHandle,
const CSSM_DATA *Crl,
const CSSM_OID *CrlField,
CSSM_HANDLE_PTR ResultsHandle,
uint32 *NumberOfMatchedFields,
CSSM_DATA_PTR *Value);
CSSM_RETURN (CSSMCLI *CrlGetNextFieldValue)
(CSSM_CL_HANDLE CLHandle,
CSSM_HANDLE ResultsHandle,
CSSM_DATA_PTR *Value);
CSSM_RETURN (CSSMCLI *CrlAbortQuery)
(CSSM_CL_HANDLE CLHandle,
CSSM_HANDLE ResultsHandle);
CSSM_RETURN (CSSMCLI *CrlGetAllFields)
(CSSM_CL_HANDLE CLHandle,
const CSSM_DATA *Crl,
uint32 *NumberOfCrlFields,
CSSM_FIELD_PTR *CrlFields);
CSSM_RETURN (CSSMCLI *CrlCache)
(CSSM_CL_HANDLE CLHandle,
const CSSM_DATA *Crl,
CSSM_HANDLE_PTR CrlHandle);
CSSM_RETURN (CSSMCLI *IsCertInCachedCrl)
(CSSM_CL_HANDLE CLHandle,
const CSSM_DATA *Cert,
CSSM_HANDLE CrlHandle,
CSSM_BOOL *CertFound,
CSSM_DATA_PTR CrlRecordIndex);
CSSM_RETURN (CSSMCLI *CrlGetFirstCachedFieldValue)
(CSSM_CL_HANDLE CLHandle,
CSSM_HANDLE CrlHandle,
const CSSM_DATA *CrlRecordIndex,
const CSSM_OID *CrlField,
CSSM_HANDLE_PTR ResultsHandle,
uint32 *NumberOfMatchedFields,
CSSM_DATA_PTR *Value);
CSSM_RETURN (CSSMCLI *CrlGetNextCachedFieldValue)
(CSSM_CL_HANDLE CLHandle,
CSSM_HANDLE ResultsHandle,
CSSM_DATA_PTR *Value);
CSSM_RETURN (CSSMCLI *CrlGetAllCachedRecordFields)
(CSSM_CL_HANDLE CLHandle,
CSSM_HANDLE CrlHandle,
const CSSM_DATA *CrlRecordIndex,
uint32 *NumberOfFields,
CSSM_FIELD_PTR *CrlFields);
CSSM_RETURN (CSSMCLI *CrlAbortCache)
(CSSM_CL_HANDLE CLHandle,
CSSM_HANDLE CrlHandle);
CSSM_RETURN (CSSMCLI *CrlDescribeFormat)
(CSSM_CL_HANDLE CLHandle,
uint32 *NumberOfFields,
CSSM_OID_PTR *OidList);
CSSM_RETURN (CSSMCLI *PassThrough)
(CSSM_CL_HANDLE CLHandle,
CSSM_CC_HANDLE CCHandle,
uint32 PassThroughId,
const void *InputParams,
void **OutputParams);
} CSSM_SPI_CL_FUNCS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_SPI_CL_FUNCS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
#pragma clang diagnostic pop
#ifdef __cplusplus
}
#endif
#endif /* _CSSMCLI_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecProtocolObject.h | /*
* Copyright (c) 2018 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef SecProtocolObject_h
#define SecProtocolObject_h
#include <sys/cdefs.h>
#include <os/object.h>
#if OS_OBJECT_USE_OBJC
# define SEC_OBJECT_DECL(type) OS_OBJECT_DECL(type)
#else // OS_OBJECT_USE_OBJC
# define SEC_OBJECT_DECL(type) \
struct type; \
typedef struct type *type##_t
#endif // OS_OBJECT_USE_OBJC
#if __has_feature(assume_nonnull)
# define SEC_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin")
# define SEC_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end")
#else // !__has_feature(assume_nonnull)
# define SEC_ASSUME_NONNULL_BEGIN
# define SEC_ASSUME_NONNULL_END
#endif // !__has_feature(assume_nonnull)
#if defined(__OBJC__) && __has_attribute(ns_returns_retained)
# define SEC_RETURNS_RETAINED __attribute__((__ns_returns_retained__))
#else // __OBJC__ && ns_returns_retained
# define SEC_RETURNS_RETAINED
#endif // __OBJC__ && ns_returns_retained
#if !OS_OBJECT_USE_OBJC_RETAIN_RELEASE
__BEGIN_DECLS
__attribute__((visibility("default"))) void *sec_retain(void *obj);
__attribute__((visibility("default"))) void sec_release(void *obj);
__END_DECLS
#else // !OS_OBJECT_USE_OBJC_RETAIN_RELEASE
#undef sec_retain
#undef sec_release
#define sec_retain(object) [(object) retain]
#define sec_release(object) [(object) release]
#endif // !OS_OBJECT_USE_OBJC_RETAIN_RELEASE
#ifndef SEC_OBJECT_IMPL
/*!
* A `sec_object` is a generic, ARC-able type wrapper for common CoreFoundation Security types.
*/
SEC_OBJECT_DECL(sec_object);
#endif // !SEC_OBJECT_IMPL
#endif // SecProtocolObject_h
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/eisl.h | /*
* Copyright (c) 1999-2002,2004,2011,2014 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*
* eisl.h -- Embedded Integrity Services Library Interface
*/
#ifndef _EISL_H_
#define _EISL_H_ 1
#include <Security/cssmconfig.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif /* _EISL_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecKeychainItem.h | /* * Copyright (c) 2000-2008,2011-2014 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
@header SecKeychainItem
SecKeychainItem implements an item which may be stored in a SecKeychain, with publicly
visible attributes and encrypted data. Access to the data of an item is protected
using strong cryptographic algorithms.
*/
#ifndef _SECURITY_SECKEYCHAINITEM_H_
#define _SECURITY_SECKEYCHAINITEM_H_
#include <AvailabilityMacros.h>
#include <CoreFoundation/CFData.h>
#include <Security/SecBase.h>
#include <Security/cssmapple.h>
#if defined(__cplusplus)
extern "C" {
#endif
CF_ASSUME_NONNULL_BEGIN
/*!
@enum ItemClassConstants
@abstract Specifies a keychain item's class code.
@constant kSecInternetPasswordItemClass Indicates that the item is an Internet password.
@constant kSecGenericPasswordItemClass Indicates that the item is a generic password.
@constant kSecAppleSharePasswordItemClass Indicates that the item is an AppleShare password.
Note: AppleShare passwords are no longer used by OS X, starting in Leopard (10.5). Use of this item class is deprecated in OS X 10.9 and later; kSecInternetPasswordItemClass should be used instead when storing or looking up passwords for an Apple Filing Protocol (AFP) server.
@constant kSecCertificateItemClass Indicates that the item is a digital certificate.
@constant kSecPublicKeyItemClass Indicates that the item is a public key.
@constant kSecPrivateKeyItemClass Indicates that the item is a private key.
@constant kSecSymmetricKeyItemClass Indicates that the item is a symmetric key.
@discussion The SecItemClass enumeration defines constants your application can use to specify the type of the keychain item you wish to create, dispose, add, delete, update, copy, or locate. You can also use these constants with the tag constant SecItemAttr.
*/
typedef CF_ENUM(FourCharCode, SecItemClass)
{
kSecInternetPasswordItemClass = 'inet',
kSecGenericPasswordItemClass = 'genp',
kSecAppleSharePasswordItemClass CF_ENUM_DEPRECATED(10_0, 10_9, NA, NA) = 'ashp',
kSecCertificateItemClass = 0x80001000,
kSecPublicKeyItemClass = 0x0000000F,
kSecPrivateKeyItemClass = 0x00000010,
kSecSymmetricKeyItemClass = 0x00000011
};
/*!
@enum ItemAttributeConstants
@abstract Specifies keychain item attributes.
@constant kSecCreationDateItemAttr (read-only) Identifies the creation date attribute. You use this tag to get a value of type string that represents the date the item was created, expressed in Zulu Time format ("YYYYMMDDhhmmSSZ"). This format is identical to CSSM_DB_ATTRIBUTE_FORMAT_TIME_DATE (cssmtype.h). When specifying the creation date as input to a function (e.g. SecKeychainSearchCreateFromAttributes), you may alternatively provide a numeric value of type UInt32 or SInt64, expressed as seconds since 1/1/1904 (DateTimeUtils.h).
@constant kSecModDateItemAttr (read-only) Identifies the modification date attribute. You use this tag to get a value of type string that represents the last time the item was updated, expressed in Zulu Time format ("YYYYMMDDhhmmSSZ"). This format is identical to CSSM_DB_ATTRIBUTE_FORMAT_TIME_DATE (cssmtype.h). When specifying the modification date as input to a function (e.g. SecKeychainSearchCreateFromAttributes), you may alternatively provide a numeric value of type UInt32 or SInt64, expressed as seconds since 1/1/1904 (DateTimeUtils.h).
@constant kSecDescriptionItemAttr Identifies the description attribute. You use this tag to set or get a value of type string that represents a user-visible string describing this particular kind of item (e.g. "disk image password").
@constant kSecCommentItemAttr Identifies the comment attribute. You use this tag to set or get a value of type string that represents a user-editable string containing comments for this item.
@constant kSecCreatorItemAttr Identifies the creator attribute. You use this tag to set or get a value of type FourCharCode that represents the item's creator.
@constant kSecTypeItemAttr Identifies the type attribute. You use this tag to set or get a value of type FourCharCode that represents the item's type.
@constant kSecScriptCodeItemAttr Identifies the script code attribute. You use this tag to set or get a value of type ScriptCode that represents the script code for all strings. (Note: use of this attribute is deprecated; string attributes should always be stored in UTF-8 encoding.)
@constant kSecLabelItemAttr Identifies the label attribute. You use this tag to set or get a value of type string that represents a user-editable string containing the label for this item.
@constant kSecInvisibleItemAttr Identifies the invisible attribute. You use this tag to set or get a value of type Boolean that indicates whether the item is invisible (i.e. should not be displayed).
@constant kSecNegativeItemAttr Identifies the negative attribute. You use this tag to set or get a value of type Boolean that indicates whether there is a valid password associated with this keychain item. This is useful if your application doesn't want a password for some particular service to be stored in the keychain, but prefers that it always be entered by the user. The item (typically invisible and with zero-length data) acts as a placeholder to say "don't use me."
@constant kSecCustomIconItemAttr Identifies the custom icon attribute. You use this tag to set or get a value of type Boolean that indicates whether the item has an application-specific icon. To do this, you must also set the attribute value identified by the tag kSecTypeItemAttr to a file type for which there is a corresponding icon in the desktop database, and set the attribute value identified by the tag kSecCreatorItemAttr to an appropriate application creator type. If a custom icon corresponding to the item's type and creator can be found in the desktop database, it will be displayed by Keychain Access. Otherwise, default icons are used. (Note: use of this attribute is deprecated; custom icons for keychain items are not supported in Mac OS X.)
@constant kSecAccountItemAttr Identifies the account attribute. You use this tag to set or get a string that represents the user account. This attribute applies to generic, Internet, and AppleShare password items.
@constant kSecServiceItemAttr Identifies the service attribute. You use this tag to set or get a string that represents the service associated with this item. This attribute is unique to generic password items.
@constant kSecGenericItemAttr Identifies the generic attribute. You use this tag to set or get a value of untyped bytes that represents a user-defined attribute. This attribute is unique to generic password items.
@constant kSecSecurityDomainItemAttr Identifies the security domain attribute. You use this tag to set or get a value that represents the Internet security domain. This attribute is unique to Internet password items.
@constant kSecServerItemAttr Identifies the server attribute. You use this tag to set or get a value of type string that represents the Internet server's domain name or IP address. This attribute is unique to Internet password items.
@constant kSecAuthenticationTypeItemAttr Identifies the authentication type attribute. You use this tag to set or get a value of type SecAuthenticationType that represents the Internet authentication scheme. This attribute is unique to Internet password items.
@constant kSecPortItemAttr Identifies the port attribute. You use this tag to set or get a value of type UInt32 that represents the Internet port number. This attribute is unique to Internet password items.
@constant kSecPathItemAttr Identifies the path attribute. You use this tag to set or get a string value that represents the path. This attribute is unique to Internet password items.
@constant kSecVolumeItemAttr Identifies the volume attribute. You use this tag to set or get a string value that represents the AppleShare volume. This attribute is unique to AppleShare password items. Note: AppleShare passwords are no longer used by OS X as of Leopard (10.5); Internet password items are used instead.
@constant kSecAddressItemAttr Identifies the address attribute. You use this tag to set or get a string value that represents the AppleTalk zone name, or the IP or domain name that represents the server address. This attribute is unique to AppleShare password items. Note: AppleShare passwords are no longer used by OS X as of Leopard (10.5); Internet password items are used instead.
@constant kSecSignatureItemAttr Identifies the server signature attribute. You use this tag to set or get a value of type SecAFPServerSignature that represents the server signature block. This attribute is unique to AppleShare password items. Note: AppleShare passwords are no longer used by OS X as of Leopard (10.5); Internet password items are used instead.
@constant kSecProtocolItemAttr Identifies the protocol attribute. You use this tag to set or get a value of type SecProtocolType that represents the Internet protocol. This attribute applies to AppleShare and Internet password items.
@constant kSecCertificateType Indicates a CSSM_CERT_TYPE type.
@constant kSecCertificateEncoding Indicates a CSSM_CERT_ENCODING type.
@constant kSecCrlType Indicates a CSSM_CRL_TYPE type.
@constant kSecCrlEncoding Indicates a CSSM_CRL_ENCODING type.
@constant kSecAlias Indicates an alias.
@discussion To obtain information about a certificate, use the CDSA Certificate Library (CL) API. To obtain information about a key, use the SecKeyGetCSSMKey function and the CDSA Cryptographic Service Provider (CSP) API.
*/
typedef CF_ENUM(FourCharCode, SecItemAttr)
{
kSecCreationDateItemAttr = 'cdat',
kSecModDateItemAttr = 'mdat',
kSecDescriptionItemAttr = 'desc',
kSecCommentItemAttr = 'icmt',
kSecCreatorItemAttr = 'crtr',
kSecTypeItemAttr = 'type',
kSecScriptCodeItemAttr = 'scrp',
kSecLabelItemAttr = 'labl',
kSecInvisibleItemAttr = 'invi',
kSecNegativeItemAttr = 'nega',
kSecCustomIconItemAttr = 'cusi',
kSecAccountItemAttr = 'acct',
kSecServiceItemAttr = 'svce',
kSecGenericItemAttr = 'gena',
kSecSecurityDomainItemAttr = 'sdmn',
kSecServerItemAttr = 'srvr',
kSecAuthenticationTypeItemAttr = 'atyp',
kSecPortItemAttr = 'port',
kSecPathItemAttr = 'path',
kSecVolumeItemAttr = 'vlme',
kSecAddressItemAttr = 'addr',
kSecSignatureItemAttr = 'ssig',
kSecProtocolItemAttr = 'ptcl',
kSecCertificateType = 'ctyp',
kSecCertificateEncoding = 'cenc',
kSecCrlType = 'crtp',
kSecCrlEncoding = 'crnc',
kSecAlias = 'alis'
};
/*!
@typedef SecAFPServerSignature
@abstract Represents a 16-byte Apple File Protocol server signature block.
*/
typedef UInt8 SecAFPServerSignature[16];
/*!
@typedef SecPublicKeyHash
@abstract Represents a 20-byte public key hash.
*/
typedef UInt8 SecPublicKeyHash[20];
#pragma mark ---- Keychain Item Management ----
/*!
@function SecKeychainItemGetTypeID
@abstract Returns the type identifier of SecKeychainItem instances.
@result The CFTypeID of SecKeychainItem instances.
*/
CFTypeID SecKeychainItemGetTypeID(void);
/*!
@function SecKeychainItemModifyAttributesAndData
@abstract Updates an existing keychain item after changing its attributes or data.
@param itemRef A reference to the keychain item to modify.
@param attrList The list of attributes to modify, along with their new values. Pass NULL if you don't need to modify any attributes.
@param length The length of the buffer pointed to by data.
@param data Pointer to a buffer containing the data to store. Pass NULL if you don't need to modify the data.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion The keychain item is written to the keychain's permanent data store. If the keychain item has not previously been added to a keychain, a call to the SecKeychainItemModifyContent function does nothing and returns errSecSuccess.
*/
OSStatus SecKeychainItemModifyAttributesAndData(SecKeychainItemRef itemRef, const SecKeychainAttributeList * __nullable attrList, UInt32 length, const void * __nullable data) API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
/*!
@function SecKeychainItemCreateFromContent
@abstract Creates a new keychain item from the supplied parameters.
@param itemClass A constant identifying the class of item to create.
@param attrList The list of attributes of the item to create.
@param length The length of the buffer pointed to by data.
@param data A pointer to a buffer containing the data to store.
@param initialAccess A reference to the access for this keychain item.
@param keychainRef A reference to the keychain in which to add the item.
@param itemRef On return, a pointer to a reference to the newly created keychain item (optional). When the item reference is no longer required, call CFRelease to deallocate memory occupied by the item.
@result A result code. See "Security Error Codes" (SecBase.h). In addition, errSecParam (-50) may be returned if not enough valid parameters are supplied, or errSecAllocate (-108) if there is not enough memory in the current heap zone to create the object.
*/
OSStatus SecKeychainItemCreateFromContent(SecItemClass itemClass, SecKeychainAttributeList *attrList,
UInt32 length, const void * __nullable data, SecKeychainRef __nullable keychainRef,
SecAccessRef __nullable initialAccess, SecKeychainItemRef * __nullable CF_RETURNS_RETAINED itemRef) API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
/*!
@function SecKeychainItemModifyContent
@abstract Updates an existing keychain item after changing its attributes or data. This call should only be used in conjunction with SecKeychainItemCopyContent().
@param itemRef A reference to the keychain item to modify.
@param attrList The list of attributes to modify, along with their new values. Pass NULL if you don't need to modify any attributes.
@param length The length of the buffer pointed to by data.
@param data A pointer to a buffer containing the data to store. Pass NULL if you don't need to modify the data.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecKeychainItemModifyContent(SecKeychainItemRef itemRef, const SecKeychainAttributeList * __nullable attrList, UInt32 length, const void * __nullable data) API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
/*!
@function SecKeychainItemCopyContent
@abstract Copies the data and/or attributes stored in the given keychain item. It is recommended that you use SecKeychainItemCopyAttributesAndData(). You must call SecKeychainItemFreeContent when you no longer need the attributes and data. If you want to modify the attributes returned here, use SecKeychainModifyContent().
@param itemRef A reference to the keychain item to modify.
@param itemClass On return, the item's class. Pass NULL if you don't require this information.
@param attrList On input, the list of attributes to retrieve. On output, the attributes are filled in. Pass NULL if you don't need to retrieve any attributes. You must call SecKeychainItemFreeContent when you no longer need the attributes.
@param length On return, the length of the buffer pointed to by outData.
@param outData On return, a pointer to a buffer containing the data in this item. Pass NULL if you don't need to retrieve the data. You must call SecKeychainItemFreeContent when you no longer need the data.
@result A result code. See "Security Error Codes" (SecBase.h). In addition, errSecParam (-50) may be returned if not enough valid parameters are supplied.
*/
OSStatus SecKeychainItemCopyContent(SecKeychainItemRef itemRef, SecItemClass * __nullable itemClass, SecKeychainAttributeList * __nullable attrList, UInt32 * __nullable length, void * __nullable * __nullable outData) API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
/*!
@function SecKeychainItemFreeContent
@abstract Releases the memory used by the keychain attribute list and the keychain data retrieved in a previous call to SecKeychainItemCopyContent.
@param attrList A pointer to the attribute list to release. Pass NULL to ignore this parameter.
@param data A pointer to the data buffer to release. Pass NULL to ignore this parameter.
*/
OSStatus SecKeychainItemFreeContent(SecKeychainAttributeList * __nullable attrList, void * __nullable data) API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
/*!
@function SecKeychainItemCopyAttributesAndData
@abstract Copies the data and/or attributes stored in the given keychain item. You must call SecKeychainItemFreeAttributesAndData when you no longer need the attributes and data. If you want to modify the attributes returned here, use SecKeychainModifyAttributesAndData.
@param itemRef A reference to the keychain item to copy.
@param info A list of tags and formats of the attributes you wish to retrieve. Pass NULL if you don't need to retrieve any attributes. You can call SecKeychainAttributeInfoForItemID to obtain a list with all possible attribute tags and formats for the item's class.
@param itemClass On return, the item's class. Pass NULL if you don't require this information.
@param attrList On return, a pointer to the list of retrieved attributes. Pass NULL if you don't need to retrieve any attributes. You must call SecKeychainItemFreeAttributesAndData when you no longer need this list.
@param length On return, the length of the buffer pointed to by outData.
@param outData On return, a pointer to a buffer containing the data in this item. Pass NULL if you don't need to retrieve the data. You must call SecKeychainItemFreeAttributesAndData when you no longer need the data.
@result A result code. See "Security Error Codes" (SecBase.h). In addition, errSecParam (-50) may be returned if not enough valid parameters are supplied.
*/
OSStatus SecKeychainItemCopyAttributesAndData(SecKeychainItemRef itemRef, SecKeychainAttributeInfo * __nullable info, SecItemClass * __nullable itemClass, SecKeychainAttributeList * __nullable * __nullable attrList, UInt32 * __nullable length, void * __nullable * __nullable outData) API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
/*!
@function SecKeychainItemFreeAttributesAndData
@abstract Releases the memory used by the keychain attribute list and the keychain data retrieved in a previous call to SecKeychainItemCopyAttributesAndData.
@param attrList A pointer to the attribute list to release. Pass NULL to ignore this parameter.
@param data A pointer to the data buffer to release. Pass NULL to ignore this parameter.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecKeychainItemFreeAttributesAndData(SecKeychainAttributeList * __nullable attrList, void * __nullable data) API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
/*!
@function SecKeychainItemDelete
@abstract Deletes a keychain item from the default keychain's permanent data store.
@param itemRef A keychain item reference of the item to delete.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion If itemRef has not previously been added to the keychain, SecKeychainItemDelete does nothing and returns errSecSuccess. IMPORTANT: SecKeychainItemDelete does not dispose the memory occupied by the item reference itself; use the CFRelease function when you are completely finished with an item.
*/
OSStatus SecKeychainItemDelete(SecKeychainItemRef itemRef) API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
/*!
@function SecKeychainItemCopyKeychain
@abstract Copies an existing keychain reference from a keychain item.
@param itemRef A keychain item reference.
@param keychainRef On return, the keychain reference for the specified item. Release this reference by calling the CFRelease function.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecKeychainItemCopyKeychain(SecKeychainItemRef itemRef, SecKeychainRef * __nonnull CF_RETURNS_RETAINED keychainRef) API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
/*!
@function SecKeychainItemCreateCopy
@abstract Copies a keychain item.
@param itemRef A reference to the keychain item to copy.
@param destKeychainRef A reference to the keychain in which to insert the copied keychain item.
@param initialAccess The initial access for the copied keychain item.
@param itemCopy On return, a reference to the copied keychain item.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecKeychainItemCreateCopy(SecKeychainItemRef itemRef, SecKeychainRef __nullable destKeychainRef,
SecAccessRef __nullable initialAccess, SecKeychainItemRef * __nonnull CF_RETURNS_RETAINED itemCopy) API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
/*!
@function SecKeychainItemCreatePersistentReference
@abstract Returns a CFDataRef which can be used as a persistent reference to the given keychain item. The data obtained can be turned back into a SecKeychainItemRef later by calling SecKeychainItemCopyFromPersistentReference().
@param itemRef A reference to a keychain item.
@param persistentItemRef On return, a CFDataRef containing a persistent reference. You must release this data reference by calling the CFRelease function.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecKeychainItemCreatePersistentReference(SecKeychainItemRef itemRef, CFDataRef * __nonnull CF_RETURNS_RETAINED persistentItemRef) API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
/*!
@function SecKeychainItemCopyFromPersistentReference
@abstract Returns a SecKeychainItemRef, given a persistent reference previously obtained by calling SecKeychainItemCreatePersistentReference().
@param persistentItemRef A CFDataRef containing a persistent reference to a keychain item.
@param itemRef On return, a SecKeychainItemRef for the keychain item described by the persistent reference. You must release this item reference by calling the CFRelease function.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecKeychainItemCopyFromPersistentReference(CFDataRef persistentItemRef, SecKeychainItemRef * __nonnull CF_RETURNS_RETAINED itemRef) API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
#pragma mark ---- CSSM Bridge Functions ----
/*!
@function SecKeychainItemGetDLDBHandle
@abstract Returns the CSSM_DL_DB_HANDLE for a given keychain item reference.
@param keyItemRef A keychain item reference.
@param dldbHandle On return, a CSSM_DL_DB_HANDLE for the keychain database containing the given item. The handle is valid until the keychain reference is released.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This API is deprecated for 10.7. It should no longer be needed.
*/
OSStatus SecKeychainItemGetDLDBHandle(SecKeychainItemRef keyItemRef, CSSM_DL_DB_HANDLE * __nonnull dldbHandle)
CSSM_DEPRECATED;
/*!
@function SecKeychainItemGetUniqueRecordID
@abstract Returns a CSSM_DB_UNIQUE_RECORD for the given keychain item reference.
@param itemRef A keychain item reference.
@param uniqueRecordID On return, a pointer to a CSSM_DB_UNIQUE_RECORD structure for the given item. The unique record is valid until the item reference is released.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This API is deprecated for 10.7. It should no longer be needed.
*/
OSStatus SecKeychainItemGetUniqueRecordID(SecKeychainItemRef itemRef, const CSSM_DB_UNIQUE_RECORD * __nullable * __nonnull uniqueRecordID)
CSSM_DEPRECATED;
#pragma mark ---- Keychain Item Access Management ----
/*!
@function SecKeychainItemCopyAccess
@abstract Copies the access of a given keychain item.
@param itemRef A reference to a keychain item.
@param access On return, a reference to the keychain item's access.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecKeychainItemCopyAccess(SecKeychainItemRef itemRef, SecAccessRef * __nonnull CF_RETURNS_RETAINED access) API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
/*!
@function SecKeychainItemSetAccess
@abstract Sets the access of a given keychain item.
@param itemRef A reference to a keychain item.
@param access A reference to an access to replace the keychain item's current access.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecKeychainItemSetAccess(SecKeychainItemRef itemRef, SecAccessRef access) API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
CF_ASSUME_NONNULL_END
#if defined(__cplusplus)
}
#endif
#endif /* !_SECURITY_SECKEYCHAINITEM_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/CMSEncoder.h | /*
* Copyright (c) 2006-2018 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
* CMSEncoder.h - encode, sign, and/or encrypt messages in the Cryptographic
* Message Syntax (CMS), per RFC 3852.
*
* A CMS message can be signed, encrypted, or both. A message can be signed by
* an arbitrary number of signers; in this module, signers are expressed as
* SecIdentityRefs. A message can be encrypted for an arbitrary number of
* recipients; recipients are expressed here as SecCertificateRefs.
*
* In CMS terminology, this module performs encryption using the EnvelopedData
* ContentType and signing using the SignedData ContentType.
*
* If the message is both signed and encrypted, it uses "nested ContentInfos"
* in CMS terminology; in this implementation, signed & encrypted messages
* are implemented as an EnvelopedData containing a SignedData.
*/
#ifndef _CMS_ENCODER_H_
#define _CMS_ENCODER_H_
#include <CoreFoundation/CoreFoundation.h>
#include <AvailabilityMacros.h>
#include <stdint.h>
#include <Security/SecBase.h>
#if SEC_OS_OSX
#include <Security/cssmtype.h>
#endif
__BEGIN_DECLS
CF_ASSUME_NONNULL_BEGIN
/*
* Opaque reference to a CMS encoder object.
* This is a CF object, with standard CF semantics; dispose of it
* with CFRelease().
*/
typedef struct CF_BRIDGED_TYPE(id) _CMSEncoder *CMSEncoderRef;
CFTypeID CMSEncoderGetTypeID(void)
__API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, macCatalyst);
/*
* Create a CMSEncoder. Result must eventually be freed via CFRelease().
*/
OSStatus CMSEncoderCreate(CMSEncoderRef * __nonnull CF_RETURNS_RETAINED cmsEncoderOut) /* RETURNED */
__API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, macCatalyst);
extern const CFStringRef kCMSEncoderDigestAlgorithmSHA1;
extern const CFStringRef kCMSEncoderDigestAlgorithmSHA256;
OSStatus CMSEncoderSetSignerAlgorithm(
CMSEncoderRef cmsEncoder,
CFStringRef digestAlgorithm)
__API_AVAILABLE(macos(10.11)) API_UNAVAILABLE(ios, tvos, watchos, macCatalyst);
/*
* Specify signers of the CMS message; implies that the message will be signed.
*
* -- Caller can pass in one signer, as a SecIdentityRef, or an array of
* signers, as a CFArray of SecIdentityRefs.
* -- Can be called multiple times.
* -- If the message is not to be signed, don't call this.
* -- If this is called, it must be called before the first call to
* CMSEncoderUpdateContent().
*/
OSStatus CMSEncoderAddSigners(
CMSEncoderRef cmsEncoder,
CFTypeRef signerOrArray)
__API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, macCatalyst);
/*
* Obtain an array of signers as specified in CMSEncoderSetSigners().
* Returns a NULL signers array if CMSEncoderSetSigners() has not been called.
* Caller must CFRelease the result.
*/
OSStatus CMSEncoderCopySigners(
CMSEncoderRef cmsEncoder,
CFArrayRef * __nonnull CF_RETURNS_RETAINED signersOut) /* RETURNED */
__API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, macCatalyst);
/*
* Specify recipients of the message. Implies that the message will
* be encrypted.
*
* -- Caller can pass in one recipient, as a SecCertificateRef, or an
* array of recipients, as a CFArray of SecCertificateRefs.
* -- Can be called multiple times.
* -- If the message is not to be encrypted, don't call this.
* -- If this is called, it must be called before the first call to
* CMSEncoderUpdateContent().
*/
OSStatus CMSEncoderAddRecipients(
CMSEncoderRef cmsEncoder,
CFTypeRef recipientOrArray)
__API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, macCatalyst);
/*
* Obtain an array of recipients as specified in CMSEncoderSetRecipients().
* Returns a NULL recipients array if CMSEncoderSetRecipients() has not been
* called.
* Caller must CFRelease the result.
*/
OSStatus CMSEncoderCopyRecipients(
CMSEncoderRef cmsEncoder,
CFArrayRef * __nonnull CF_RETURNS_RETAINED recipientsOut) /* RETURNED */
__API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, macCatalyst);
/*
* A signed message optionally includes the data to be signed. If the message
* is *not* to include the data to be signed, call this function with a value
* of TRUE for detachedContent. The default, if this function is not called,
* is detachedContent=FALSE, i.e., the message contains the data to be signed.
*
* -- Encrypted messages can not use detached content. (This restriction
* also applies to messages that are both signed and encrypted.)
* -- If this is called, it must be called before the first call to
* CMSEncoderUpdateContent().
*/
OSStatus CMSEncoderSetHasDetachedContent(
CMSEncoderRef cmsEncoder,
Boolean detachedContent)
__API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, macCatalyst);
/*
* Obtain a Boolean indicating whether the current message will have detached
* content.
* Returns the value specified in CMSEncoderHasDetachedContent() if that
* function has been called; else returns the default FALSE.
*/
OSStatus CMSEncoderGetHasDetachedContent(
CMSEncoderRef cmsEncoder,
Boolean *detachedContentOut) /* RETURNED */
__API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, macCatalyst);
#if SEC_OS_OSX
/*
* Optionally specify an eContentType OID for the inner EncapsulatedData for
* a signed message. The default eContentType, used if this function is not
* called, is id-data (which is the normal eContentType for applications such
* as SMIME).
*
* If this is called, it must be called before the first call to
* CMSEncoderUpdateContent().
*
* NOTE: This function is deprecated in Mac OS X 10.7 and later;
* please use CMSEncoderSetEncapsulatedContentTypeOID() instead.
*/
OSStatus CMSEncoderSetEncapsulatedContentType(
CMSEncoderRef cmsEncoder,
const CSSM_OID *eContentType)
API_DEPRECATED_WITH_REPLACEMENT("CMSEncoderSetEncapsulatedContentTypeOID", macos(10.5, 10.7)) API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
#endif // SEC_OS_OSX
/*
* Optionally specify an eContentType OID for the inner EncapsulatedData for
* a signed message. The default eContentTypeOID, used if this function is not
* called, is id-data (which is the normal eContentType for applications such
* as SMIME).
*
* The eContentTypeOID parameter may be specified as a CF string, e.g.:
* CFSTR("1.2.840.113549.1.7.1")
*
* If this is called, it must be called before the first call to
* CMSEncoderUpdateContent().
*/
OSStatus CMSEncoderSetEncapsulatedContentTypeOID(
CMSEncoderRef cmsEncoder,
CFTypeRef eContentTypeOID)
__API_AVAILABLE(macos(10.7)) API_UNAVAILABLE(ios, tvos, watchos, macCatalyst);
/*
* Obtain the eContentType OID specified in CMSEncoderSetEncapsulatedContentType().
* If CMSEncoderSetEncapsulatedContentType() has not been called this returns a
* NULL pointer.
* The returned OID's data is in the same format as the data provided to
* CMSEncoderSetEncapsulatedContentType;, i.e., it's the encoded content of
* the OID, not including the tag and length bytes.
*/
OSStatus CMSEncoderCopyEncapsulatedContentType(
CMSEncoderRef cmsEncoder,
CFDataRef * __nonnull CF_RETURNS_RETAINED eContentTypeOut) /* RETURNED */
__API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, macCatalyst);
/*
* Signed CMS messages can contain arbitrary sets of certificates beyond those
* indicating the identity of the signer(s). This function provides a means of
* adding these other certs. For normal signed messages it is not necessary to
* call this; the signer cert(s) and the intermediate certs needed to verify the
* signer(s) will be included in the message implicitly.
*
* -- Caller can pass in one cert, as a SecCertificateRef, or an array of certs,
* as a CFArray of SecCertificateRefs.
* -- If this is called, it must be called before the first call to
* CMSEncoderUpdateContent().
* -- There is a "special case" use of CMS messages which involves neither
* signing nor encryption, but does include certificates. This is commonly
* used to transport "bags" of certificates. When constructing such a
* message, all an application needs to do is to create a CMSEncoderRef,
* call CMSEncoderAddSupportingCerts() one or more times, and then call
* CMSEncoderCopyEncodedContent() to get the resulting cert bag. No 'content'
* need be specified. (This is in fact the primary intended use for
* this function.)
*/
OSStatus CMSEncoderAddSupportingCerts(
CMSEncoderRef cmsEncoder,
CFTypeRef certOrArray)
__API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, macCatalyst);
/*
* Obtain the SecCertificates provided in CMSEncoderAddSupportingCerts().
* If CMSEncoderAddSupportingCerts() has not been called this will return a
* NULL value for *certs.
* Caller must CFRelease the result.
*/
OSStatus CMSEncoderCopySupportingCerts(
CMSEncoderRef cmsEncoder,
CFArrayRef * __nonnull CF_RETURNS_RETAINED certsOut) /* RETURNED */
__API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, macCatalyst);
/*
* Standard signed attributes, optionally specified in
* CMSEncoderAddSignedAttributes().
*/
typedef CF_OPTIONS(uint32_t, CMSSignedAttributes) {
kCMSAttrNone = 0x0000,
/*
* S/MIME Capabilities - identifies supported signature, encryption, and
* digest algorithms.
*/
kCMSAttrSmimeCapabilities = 0x0001,
/*
* Indicates that a cert is the preferred cert for S/MIME encryption.
*/
kCMSAttrSmimeEncryptionKeyPrefs = 0x0002,
/*
* Same as kCMSSmimeEncryptionKeyPrefs, using an attribute OID preferred
* by Microsoft.
*/
kCMSAttrSmimeMSEncryptionKeyPrefs = 0x0004,
/*
* Include the signing time.
*/
kCMSAttrSigningTime = 0x0008,
/*
* Include the Apple Codesigning Hash Agility.
*/
kCMSAttrAppleCodesigningHashAgility = 0x0010,
kCMSAttrAppleCodesigningHashAgilityV2 = 0x0020,
/*
* Include the expiration time.
*/
kCMSAttrAppleExpirationTime = 0x0040,
};
/*
* Optionally specify signed attributes. Only meaningful when creating a
* signed message. If this is called, it must be called before
* CMSEncoderUpdateContent().
*/
OSStatus CMSEncoderAddSignedAttributes(
CMSEncoderRef cmsEncoder,
CMSSignedAttributes signedAttributes)
__API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, macCatalyst);
/*
* Specification of what certificates to include in a signed message.
*/
typedef CF_ENUM(uint32_t, CMSCertificateChainMode) {
kCMSCertificateNone = 0, /* don't include any certificates */
kCMSCertificateSignerOnly, /* only include signer certificate(s) */
kCMSCertificateChain, /* signer certificate chain up to but not
* including root certiticate */
kCMSCertificateChainWithRoot, /* signer certificate chain including root */
kCMSCertificateChainWithRootOrFail, /* signer certificate chain including root
* and if chain not terminated by a self-signed cert,
* fail to create CMS */
};
/*
* Optionally specify which certificates, if any, to include in a
* signed CMS message. The default, if this is not called, is
* kCMSCertificateChain, in which case the signer cert plus all CA
* certs needed to verify the signer cert, except for the root
* cert, are included.
* If this is called, it must be called before
* CMSEncoderUpdateContent().
*/
OSStatus CMSEncoderSetCertificateChainMode(
CMSEncoderRef cmsEncoder,
CMSCertificateChainMode chainMode)
__API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, macCatalyst);
/*
* Obtain indication of which signer certs are to be included
* in a signed CMS message.
*/
OSStatus CMSEncoderGetCertificateChainMode(
CMSEncoderRef cmsEncoder,
CMSCertificateChainMode *chainModeOut)
__API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, macCatalyst);
/*
* Feed content bytes into the encoder.
* Can be called multiple times.
* No 'setter' routines can be called after this function has been called.
*/
OSStatus CMSEncoderUpdateContent(
CMSEncoderRef cmsEncoder,
const void *content,
size_t contentLen)
__API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, macCatalyst);
/*
* Finish encoding the message and obtain the encoded result.
* Caller must CFRelease the result.
*/
OSStatus CMSEncoderCopyEncodedContent(
CMSEncoderRef cmsEncoder,
CFDataRef * __nonnull CF_RETURNS_RETAINED encodedContentOut) /* RETURNED */
__API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, tvos, watchos, macCatalyst);
#if TARGET_OS_OSX
/*
* High-level, one-shot encoder function.
*
* Inputs (all except for content optional, though at least one
* of {signers, recipients} must be non-NULL)
* ------------------------------------------------------------
* signers : signer identities. Either a SecIdentityRef, or a
* CFArray of them.
* recipients : recipient certificates. Either a SecCertificateRef,
* or a CFArray of them.
* eContentType : contentType for inner EncapsulatedData.
* detachedContent : when true, do not include the signed data in the message.
* signedAttributes : Specifies which standard signed attributes are to be
* included in the message.
* content : raw content to be signed and/or encrypted.
*
* Output
* ------
* encodedContent : the result of the encoding.
*
* NOTE: This function is deprecated in Mac OS X 10.7 and later;
* please use CMSEncodeContent() instead.
*/
OSStatus CMSEncode(
CFTypeRef __nullable signers,
CFTypeRef __nullable recipients,
const CSSM_OID * __nullable eContentType,
Boolean detachedContent,
CMSSignedAttributes signedAttributes,
const void * content,
size_t contentLen,
CFDataRef * __nonnull CF_RETURNS_RETAINED encodedContentOut) /* RETURNED */
API_DEPRECATED_WITH_REPLACEMENT("CMSEncodeContent", macos(10.5, 10.7)) API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
#endif // TARGET_OS_OSX
/*
* High-level, one-shot encoder function.
*
* Inputs (all except for content optional, though at least one
* of {signers, recipients} must be non-NULL)
* ------------------------------------------------------------
* signers : signer identities. Either a SecIdentityRef, or a
* CFArray of them.
* recipients : recipient certificates. Either a SecCertificateRef,
* or a CFArray of them.
* eContentTypeOID : contentType OID for inner EncapsulatedData, e.g.:
* CFSTR("1.2.840.113549.1.7.1")
* detachedContent : when true, do not include the signed data in the message.
* signedAttributes : Specifies which standard signed attributes are to be
* included in the message.
* content : raw content to be signed and/or encrypted.
*
* Output
* ------
* encodedContent : the result of the encoding.
*/
OSStatus CMSEncodeContent(
CFTypeRef __nullable signers,
CFTypeRef __nullable recipients,
CFTypeRef __nullable eContentTypeOID,
Boolean detachedContent,
CMSSignedAttributes signedAttributes,
const void *content,
size_t contentLen,
CFDataRef * __nullable CF_RETURNS_RETAINED encodedContentOut) /* RETURNED */
__API_AVAILABLE(macos(10.7)) API_UNAVAILABLE(ios, tvos, watchos, macCatalyst);
OSStatus CMSEncoderCopySignerTimestamp(
CMSEncoderRef cmsEncoder,
size_t signerIndex, /* usually 0 */
CFAbsoluteTime *timestamp) /* RETURNED */
API_AVAILABLE(macos(10.8)) API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
OSStatus CMSEncoderCopySignerTimestampWithPolicy(
CMSEncoderRef cmsEncoder,
CFTypeRef __nullable timeStampPolicy,
size_t signerIndex, /* usually 0 */
CFAbsoluteTime *timestamp) /* RETURNED */
API_AVAILABLE(macos(10.10)) API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
CF_ASSUME_NONNULL_END
__END_DECLS
#endif /* _CMS_ENCODER_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecDigestTransform.h | #ifndef __TRANSFORM_DIGEST__
#define __TRANSFORM_DIGEST__
/*
* Copyright (c) 2010-2011 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#include <Security/SecTransform.h>
#ifdef __cplusplus
extern "C" {
#endif
CF_ASSUME_NONNULL_BEGIN
CF_IMPLICIT_BRIDGING_ENABLED
/*!
@abstract
Specifies an MD2 digest
*/
extern const CFStringRef kSecDigestMD2;
/*!
@abstract
Specifies an MD4 digest
*/
extern const CFStringRef kSecDigestMD4;
/*!
@abstract
Specifies an MD5 digest
*/
extern const CFStringRef kSecDigestMD5;
/*!
@abstract
Specifies a SHA1 digest
*/
extern const CFStringRef kSecDigestSHA1;
/*!
@abstract
Specifies a SHA2 digest.
*/
extern const CFStringRef kSecDigestSHA2;
/*!
@abstract
Specifies an HMAC using the MD5 digest algorithm.
*/
extern const CFStringRef kSecDigestHMACMD5;
/*!
@abstract
Specifies an HMAC using the SHA1 digest algorithm.
*/
extern const CFStringRef kSecDigestHMACSHA1;
/*!
@abstract
Specifies an HMAC using one of the SHA2 digest algorithms.
*/
extern const CFStringRef kSecDigestHMACSHA2;
/*!
@constant kSecDigestTypeAttribute
Used with SecTransformGetAttribute to query the attribute type.
Returns one of the strings defined in the previous section.
*/
extern const CFStringRef kSecDigestTypeAttribute;
/*!
@constant kSecDigestLengthAttribute
Used with SecTransformGetAttribute to query the length attribute.
Returns a CFNumberRef that contains the length in bytes.
*/
extern const CFStringRef kSecDigestLengthAttribute;
/*!
@constant kSecDigestHMACKeyAttribute
When set and used with one of the HMAC digest types, sets the key
for the HMAC operation. The data type for this attribute must be
a CFDataRef. If this value is not set, the transform will assume
a zero length key.
*/
extern const CFStringRef kSecDigestHMACKeyAttribute;
/*!
@function SecDigestTransformCreate
@abstract Creates a digest computation object.
@param digestType The type of digest to compute. You may pass NULL
for this parameter, in which case an appropriate
algorithm will be chosen for you.
@param digestLength The desired digest length. Note that certain
algorithms may only support certain sizes. You may
pass 0 for this parameter, in which case an
appropriate length will be chosen for you.
@param error A pointer to a CFErrorRef. This pointer will be set
if an error occurred. This value may be NULL if you
do not want an error returned.
@result A pointer to a SecTransformRef object. This object must
be released with CFRelease when you are done with
it. This function will return NULL if an error
occurred.
@discussion This function creates a transform which computes a
cryptographic digest.
*/
SecTransformRef SecDigestTransformCreate(CFTypeRef __nullable digestType,
CFIndex digestLength,
CFErrorRef* error
)
__OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_NA);
/*!
@function SecDigestTransformGetTypeID
@abstract Return the CFTypeID of a SecDigestTransform
@result The CFTypeID
*/
CFTypeID SecDigestTransformGetTypeID(void)
__OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_NA);
CF_IMPLICIT_BRIDGING_DISABLED
CF_ASSUME_NONNULL_END
#ifdef __cplusplus
};
#endif
#endif
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecTransform.h | /*
* Copyright (c) 2010-2012 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _SEC_TRANSFORM_H__
#define _SEC_TRANSFORM_H__
#include <CoreFoundation/CoreFoundation.h>
CF_EXTERN_C_BEGIN
CF_ASSUME_NONNULL_BEGIN
CF_IMPLICIT_BRIDGING_ENABLED
/*!
@header
To better follow this header, you should understand the following
terms:
Transform A transform converts data from one form to another.
Digests, encryption and decryption are all examples
of transforms. Each transform performs a single
operation.
Transform
Group A transform group is a directed (typically) acyclic
graph of transforms. Results from a transform flow
to the next Transform in the graph, and so on until
the end of the graph is reached.
Attribute Transforms may have one or more attributes. These
attributes are parameters for the transforms and
may affect the operation of the transform. The value
of an attribute may be set with static data or from
the value of an attribute in another transform
by connecting the attributes using the
SecTransformConnectTransforms API.
External
Representation Transforms may be created programmatically or from
an external representation. External representations
may be created from existing transforms.
There are many types of transforms available. These are documented
in their own headers. The functions in this header are applicable
to all transforms.
*/
/*!
@constant kSecTransformErrorDomain
The domain for CFErrorRefs created by Transforms
*/
CF_EXPORT const CFStringRef kSecTransformErrorDomain;
/*!
@constant kSecTransformPreviousErrorKey
If multiple errors occurred, the CFErrorRef that
is returned from a Transfo]rm API will have a userInfo
dictionary and that dictionary will have the previous
error keyed by the kSecTransformPreviousErrorKey.
*/
CF_EXPORT const CFStringRef kSecTransformPreviousErrorKey;
/*!
@constant kSecTransformAbortOriginatorKey
The value of this key will be the transform that caused
the transform chain to abort.
*/
CF_EXPORT const CFStringRef kSecTransformAbortOriginatorKey;
/**************** Transform Error Codes ****************/
/*!
@enum Security Transform Error Codes
@discussion
@const kSecTransformErrorAttributeNotFound
The attribute was not found.
@const kSecTransformErrorInvalidOperation
An invalid operation was attempted.
@const kSecTransformErrorNotInitializedCorrectly
A required initialization is missing. It
is most likely a missing required attribute.
@const kSecTransformErrorMoreThanOneOutput
A transform has an internal routing error
that has caused multiple outputs instead
of a single discrete output. This will
occur if SecTransformExecute has already
been called.
@const kSecTransformErrorInvalidInputDictionary
A dictionary given to
SecTransformCreateFromExternalRepresentation has invalid data.
@const kSecTransformErrorInvalidAlgorithm
A transform that needs an algorithm as an attribute
i.e the Sign and Verify transforms, received an invalid
algorithm.
@const kSecTransformErrorInvalidLength
A transform that needs a length such as a digest
transform has been given an invalid length.
@const kSecTransformErrorInvalidType
An invalid type has been set on an attribute.
@const kSecTransformErrorInvalidInput
The input set on a transform is invalid. This can
occur if the data set for an attribute does not
meet certain requirements such as correct key
usage for signing data.
@const kSecTransformErrorNameAlreadyRegistered
A custom transform of a particular name has already
been registered.
@const kSecTransformErrorUnsupportedAttribute
An illegal action such as setting a read only
attribute has occurred.
@const kSecTransformOperationNotSupportedOnGroup
An illegal action on a group transform such as
trying to call SecTransformSetAttribute has occurred.
@const kSecTransformErrorMissingParameter
A transform is missing a required attribute.
@const kSecTransformErrorInvalidConnection
A SecTransformConnectTransforms was called with
transforms in different groups.
@const kSecTransformTransformIsExecuting
An illegal operation was called on a Transform
while it was executing. Please see the sequencing documentation
in the discussion area of the SecTransformExecute API
@const kSecTransformInvalidOverride
An illegal override was given to a custom transform
@const kSecTransformTransformIsNotRegistered
A custom transform was asked to be created but the transform
has not been registered.
@const kSecTransformErrorAbortInProgress
The abort attribute has been set and the transform is in the
process of shutting down
@const kSecTransformErrorAborted
The transform was aborted.
@const kSecTransformInvalidArgument
An invalid argument was given to a Transform API
*/
CF_ENUM(CFIndex)
{
kSecTransformErrorAttributeNotFound = 1,
kSecTransformErrorInvalidOperation = 2,
kSecTransformErrorNotInitializedCorrectly = 3,
kSecTransformErrorMoreThanOneOutput = 4,
kSecTransformErrorInvalidInputDictionary = 5,
kSecTransformErrorInvalidAlgorithm = 6,
kSecTransformErrorInvalidLength = 7,
kSecTransformErrorInvalidType = 8,
kSecTransformErrorInvalidInput = 10,
kSecTransformErrorNameAlreadyRegistered = 11,
kSecTransformErrorUnsupportedAttribute = 12,
kSecTransformOperationNotSupportedOnGroup = 13,
kSecTransformErrorMissingParameter = 14,
kSecTransformErrorInvalidConnection = 15,
kSecTransformTransformIsExecuting = 16,
kSecTransformInvalidOverride = 17,
kSecTransformTransformIsNotRegistered = 18,
kSecTransformErrorAbortInProgress = 19,
kSecTransformErrorAborted = 20,
kSecTransformInvalidArgument = 21
};
typedef CFTypeRef SecTransformRef;
typedef CFTypeRef SecGroupTransformRef;
/*!
@function SecTransformGetTypeID
@abstract Return the CFTypeID for a SecTransform.
@result The CFTypeID
*/
CF_EXPORT CFTypeID SecTransformGetTypeID(void)
API_DEPRECATED("SecTransform is no longer supported", macos(10.7, 12.0), ios(NA, NA), tvos(NA, NA), watchos(NA, NA), macCatalyst(NA, NA));
/*!
@function SecGroupTransformGetTypeID
@abstract Return the CFTypeID for a SecTransformGroup.
@result The CFTypeID
*/
CF_EXPORT CFTypeID SecGroupTransformGetTypeID(void)
API_DEPRECATED("SecTransform is no longer supported", macos(10.7, 12.0), ios(NA, NA), tvos(NA, NA), watchos(NA, NA), macCatalyst(NA, NA));
/**************** Transform Attribute Names ****************/
/*!
@constant kSecTransformInputAttributeName
The name of the input attribute.
*/
CF_EXPORT const CFStringRef kSecTransformInputAttributeName
API_DEPRECATED("SecTransform is no longer supported", macos(10.7, 12.0), ios(NA, NA), tvos(NA, NA), watchos(NA, NA), macCatalyst(NA, NA));
/*!
@constant kSecTransformOutputAttributeName
The name of the output attribute.
*/
CF_EXPORT const CFStringRef kSecTransformOutputAttributeName
API_DEPRECATED("SecTransform is no longer supported", macos(10.7, 12.0), ios(NA, NA), tvos(NA, NA), watchos(NA, NA), macCatalyst(NA, NA));
/*!
@constant kSecTransformDebugAttributeName
Set this attribute to a CFWriteStream.
This will signal the transform to write debugging
information to the stream.
If this attribute is set to kCFBooleanTrue then
the debugging data will be written out to
stderr.
*/
CF_EXPORT const CFStringRef kSecTransformDebugAttributeName
API_DEPRECATED("SecTransform is no longer supported", macos(10.7, 12.0), ios(NA, NA), tvos(NA, NA), watchos(NA, NA), macCatalyst(NA, NA));
/*!
@constant kSecTransformTransformName
The name of the transform.
*/
CF_EXPORT const CFStringRef kSecTransformTransformName
API_DEPRECATED("SecTransform is no longer supported", macos(10.7, 12.0), ios(NA, NA), tvos(NA, NA), watchos(NA, NA), macCatalyst(NA, NA));
/*!
@constant kSecTransformAbortAttributeName
The name of the abort attribute.
*/
CF_EXPORT const CFStringRef kSecTransformAbortAttributeName
API_DEPRECATED("SecTransform is no longer supported", macos(10.7, 12.0), ios(NA, NA), tvos(NA, NA), watchos(NA, NA), macCatalyst(NA, NA));
/*!
@function SecTransformCreateFromExternalRepresentation
@abstract Creates a transform instance from a CFDictionary of
parameters.
@param dictionary The dictionary of parameters.
@param error An optional pointer to a CFErrorRef. This value is
set if an error occurred. If not NULL the caller is
responsible for releasing the CFErrorRef.
@result A pointer to a SecTransformRef object. You
must release the object with CFRelease when you are done
with it. A NULL will be returned if an error occurred during
initialization, and if the error parameter
is non-null, it contains the specific error data.
*/
CF_EXPORT __nullable
SecTransformRef SecTransformCreateFromExternalRepresentation(
CFDictionaryRef dictionary,
CFErrorRef *error)
API_DEPRECATED("SecTransform is no longer supported", macos(10.7, 12.0), ios(NA, NA), tvos(NA, NA), watchos(NA, NA), macCatalyst(NA, NA));
/*!
@function SecTransformCopyExternalRepresentation
@abstract Create a CFDictionaryRef that contains enough
information to be able to recreate a transform.
@param transformRef The transformRef to be externalized.
@discussion This function returns a CFDictionaryRef that contains
sufficient information to be able to recreate this
transform. You can pass this CFDictionaryRef to
SecTransformCreateFromExternalRepresentation
to be able to recreate the transform. The dictionary
can also be written out to disk using the techniques
described here.
http://developer.apple.com/mac/library/documentation/CoreFoundation/Conceptual/CFPropertyLists/Articles/Saving.html
*/
CF_EXPORT
CFDictionaryRef SecTransformCopyExternalRepresentation(
SecTransformRef transformRef)
API_DEPRECATED("SecTransform is no longer supported", macos(10.7, 12.0), ios(NA, NA), tvos(NA, NA), watchos(NA, NA), macCatalyst(NA, NA));
/*!
@function SecTransformCreateGroupTransform
@abstract Create a SecGroupTransformRef that acts as a
container for a set of connected transforms.
@result A reference to a SecGroupTransform.
@discussion A SecGroupTransformRef is a container for all of
the transforms that are in a directed graph.
A SecGroupTransformRef can be used with
SecTransformExecute, SecTransformExecuteAsync
and SecTransformCopyExternalRepresentation
APIs. While the intention is that a
SecGroupTransformRef willwork just like a S
SecTransformRef that is currently not the case.
Using a SecGroupTransformRef with the
SecTransformConnectTransforms,
SecTransformSetAttribute and
SecTransformGetAttribute is undefined.
*/
CF_EXPORT
SecGroupTransformRef SecTransformCreateGroupTransform(void)
API_DEPRECATED("SecTransform is no longer supported", macos(10.7, 12.0), ios(NA, NA), tvos(NA, NA), watchos(NA, NA), macCatalyst(NA, NA));
/*!
@function SecTransformConnectTransforms
@abstract Pipe fitting for transforms.
@param sourceTransformRef
The transform that sends the data to the
destinationTransformRef.
@param sourceAttributeName
The name of the attribute in the sourceTransformRef that
supplies the data to the destinationTransformRef.
Any attribute of the transform may be used as a source.
@param destinationTransformRef
The transform that has one of its attributes
be set with the data from the sourceTransformRef
parameter.
@param destinationAttributeName
The name of the attribute within the
destinationTransformRef whose data is set with the
data from the sourceTransformRef sourceAttributeName
attribute. Any attribute of the transform may be set.
@param group In order to ensure referential integrity, transforms
are chained together into a directed graph and
placed into a group. Each transform that makes up the
graph must be placed into the same group. After
a SecTransformRef has been placed into a group by
calling the SecTransformConnectTransforms it may be
released as the group will retain the transform.
CFRelease the group after you execute
it, or when you determine you will never execute it.
In the example below, the output of trans1 is
set to be the input of trans2. The output of trans2
is set to be the input of trans3. Since the
same group was used for the connections, the three
transforms are in the same group.
<pre>
@textblock
SecGroupTransformRef group =SecTransformCreateGroupTransform();
CFErrorRef error = NULL;
SecTransformRef trans1; // previously created using a
// Transform construction API
// like SecEncryptTransformCreate
SecTransformRef trans2; // previously created using a
// Transform construction API
// like SecEncryptTransformCreate
SecTransformRef trans3; // previously created using a
// Transform construction API
// like SecEncryptTransformCreate
SecTransformConnectTransforms(trans1, kSecTransformOutputAttributeName,
trans2, kSecTransformInputAttributeName,
group, &error);
SecTransformConnectTransforms(trans2, kSecTransformOutputAttributeName,
trans3, kSecTransformInputAttributeName.
group, &error);
CFRelease(trans1);
CFRelease(trans2);
CFRelease(trans3);
CFDataRef = (CFDataRef)SecTransformExecute(group, &error, NULL, NULL);
CFRelease(group);
@/textblock
</pre>
@param error An optional pointer to a CFErrorRef. This value
is set if an error occurred. If not NULL, the caller
is responsible for releasing the CFErrorRef.
@result The value returned is SecGroupTransformRef parameter.
This will allow for chaining calls to
SecTransformConnectTransforms.
@discussion This function places transforms into a group by attaching
the value of an attribute of one transform to the
attribute of another transform. Typically the attribute
supplying the data is the kSecTransformAttrOutput
attribute but that is not a requirement. It can be used to
set an attribute like Salt with the output attribute of
a random number transform. This function returns an
error and the named attribute will not be changed if
SecTransformExecute had previously been called on the
transform.
*/
CF_EXPORT __nullable
SecGroupTransformRef SecTransformConnectTransforms(SecTransformRef sourceTransformRef,
CFStringRef sourceAttributeName,
SecTransformRef destinationTransformRef,
CFStringRef destinationAttributeName,
SecGroupTransformRef group,
CFErrorRef *error)
API_DEPRECATED("SecTransform is no longer supported", macos(10.7, 12.0), ios(NA, NA), tvos(NA, NA), watchos(NA, NA), macCatalyst(NA, NA));
/*!
@function SecTransformSetAttribute
@abstract Set a static value as the value of an attribute in a
transform. This is useful for things like iteration
counts and other non-changing values.
@param transformRef The transform whose attribute is to be set.
@param key The name of the attribute to be set.
@param value The static value to set for the named attribute.
@param error An optional pointer to a CFErrorRef. This value
is set if an error occurred. If not NULL the caller
is responsible for releasing the CFErrorRef.
@result Returns true if the call succeeded. If an error occurred,
the error parameter has more information
about the failure case.
@discussion This API allows for setting static data into an
attribute for a transform. This is in contrast to
the SecTransformConnectTransforms function which sets derived
data. This function will return an error and the
named attribute will not be changed if SecTransformExecute
has been called on the transform.
*/
CF_EXPORT
Boolean SecTransformSetAttribute(SecTransformRef transformRef,
CFStringRef key,
CFTypeRef value,
CFErrorRef *error)
API_DEPRECATED("SecTransform is no longer supported", macos(10.7, 12.0), ios(NA, NA), tvos(NA, NA), watchos(NA, NA), macCatalyst(NA, NA));
/*!
@function SecTransformGetAttribute
@abstract Get the current value of a transform attribute.
@param transformRef The transform whose attribute value will be retrieved.
@param key The name of the attribute to retrieve.
@result The value of an attribute. If this attribute
is being set as the output of another transform
and SecTransformExecute has not been called on the
transform or if the attribute does not exists
then NULL will be returned.
@discussion This may be called after SecTransformExecute.
*/
CF_EXPORT __nullable
CFTypeRef SecTransformGetAttribute(SecTransformRef transformRef,
CFStringRef key)
API_DEPRECATED("SecTransform is no longer supported", macos(10.7, 12.0), ios(NA, NA), tvos(NA, NA), watchos(NA, NA), macCatalyst(NA, NA));
/*!
@function SecTransformFindByName
@abstract Finds a member of a transform group by its name.
@param transform The transform group to be searched.
@param name The name of the transform to be found.
@discussion When a transform instance is created it will be given a
unique name. This name can be used to find that instance
in a group. While it is possible to change this unique
name using the SecTransformSetAttribute API, developers
should not do so. This allows
SecTransformFindTransformByName to work correctly.
@result The transform group member, or NULL if the member
was not found.
*/
CF_EXPORT __nullable
SecTransformRef SecTransformFindByName(SecGroupTransformRef transform,
CFStringRef name)
API_DEPRECATED("SecTransform is no longer supported", macos(10.7, 12.0), ios(NA, NA), tvos(NA, NA), watchos(NA, NA), macCatalyst(NA, NA));
/*!
@function SecTransformExecute
@abstract Executes a Transform or transform group synchronously.
@param transformRef The transform to execute.
@param errorRef An optional pointer to a CFErrorRef. This value
will be set if an error occurred during
initialization or execution of the transform or group.
If not NULL the caller will be responsible for releasing
the returned CFErrorRef.
@result This is the result of the transform. The specific value
is determined by the transform being executed.
@discussion There are two phases that occur when executing a
transform. The first phase checks to see if the tranforms
have all of their required attributes set.
If a GroupTransform is being executed, then a required
attribute for a transform is valid if it is connected
to another attribute that supplies the required value.
If any of the required attributes are not set or connected
then SecTransformExecute will not run the transform but will
return NULL and the apporiate error is placed in the
error parameter if it is not NULL.
The second phase is the actual execution of the transform.
SecTransformExecute executes the transform or
GroupTransform and when all of the processing is completed
it returns the result. If an error occurs during
execution, then all processing will stop and NULL will be
returned and the appropriate error will be placed in the
error parameter if it is not NULL.
*/
CF_EXPORT CF_RETURNS_RETAINED
CFTypeRef SecTransformExecute(SecTransformRef transformRef, CFErrorRef* errorRef)
API_DEPRECATED("SecTransform is no longer supported", macos(10.7, 12.0), ios(NA, NA), tvos(NA, NA), watchos(NA, NA), macCatalyst(NA, NA));
/*!
@typedef SecMessageBlock
@abstract A SecMessageBlock is used by a transform instance to
deliver messages during asynchronous operations.
@param message A CFType containing the message. This is where
either intermediate or final results are returned.
@param error If an error occurred, this will contain a CFErrorRef,
otherwise this will be NULL. If not NULL the caller
is responsible for releasing the CFErrorRef.
@param isFinal If set the message returned is the final result
otherwise it is an intermediate result.
*/
typedef void (^SecMessageBlock)(CFTypeRef __nullable message, CFErrorRef __nullable error,
Boolean isFinal);
/*!
@function SecTransformExecuteAsync
@abstract Executes Transform or transform group asynchronously.
@param transformRef The transform to execute.
@param deliveryQueue
A dispatch queue on which to deliver the results of
this transform.
@param deliveryBlock
A SecMessageBlock to asynchronously receive the
results of the transform.
@discussion SecTransformExecuteAsync works just like the
SecTransformExecute API except that it
returns results to the deliveryBlock. There
may be multple results depending on the transform.
The block knows that the processing is complete
when the isFinal parameter is set to true. If an
error occurs the block's error parameter is
set and the isFinal parameter will be set to
true.
*/
CF_EXPORT
void SecTransformExecuteAsync(SecTransformRef transformRef,
dispatch_queue_t deliveryQueue,
SecMessageBlock deliveryBlock)
API_DEPRECATED("SecTransform is no longer supported", macos(10.7, 12.0), ios(NA, NA), tvos(NA, NA), watchos(NA, NA), macCatalyst(NA, NA));
CF_IMPLICIT_BRIDGING_DISABLED
CF_ASSUME_NONNULL_END
CF_EXTERN_C_END
#endif /* _SEC_TRANSFORM_H__ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecAccess.h | /*
* Copyright (c) 2002-2004,2011,2014 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
@header SecAccess
SecAccess implements a way to set and manipulate access control rules and
restrictions on SecKeychainItems.
*/
#ifndef _SECURITY_SECACCESS_H_
#define _SECURITY_SECACCESS_H_
#include <Security/SecBase.h>
#include <Security/cssmtype.h>
#include <CoreFoundation/CFArray.h>
#include <CoreFoundation/CFError.h>
#include <sys/types.h>
#include <unistd.h>
#if defined(__cplusplus)
extern "C" {
#endif
CF_ASSUME_NONNULL_BEGIN
CF_IMPLICIT_BRIDGING_ENABLED
typedef UInt32 SecAccessOwnerType;
enum
{
kSecUseOnlyUID = 1,
kSecUseOnlyGID = 2,
kSecHonorRoot = 0x100,
kSecMatchBits = (kSecUseOnlyUID | kSecUseOnlyGID)
};
/* No restrictions. Permission to perform all operations on
the resource or available to an ACL owner. */
extern const CFStringRef kSecACLAuthorizationAny
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecACLAuthorizationLogin
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecACLAuthorizationGenKey
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecACLAuthorizationDelete
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecACLAuthorizationExportWrapped
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecACLAuthorizationExportClear
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecACLAuthorizationImportWrapped
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecACLAuthorizationImportClear
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecACLAuthorizationSign
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecACLAuthorizationEncrypt
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecACLAuthorizationDecrypt
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecACLAuthorizationMAC
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecACLAuthorizationDerive
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
/* Defined authorization tag values for Keychain */
extern const CFStringRef kSecACLAuthorizationKeychainCreate
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecACLAuthorizationKeychainDelete
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecACLAuthorizationKeychainItemRead
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecACLAuthorizationKeychainItemInsert
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecACLAuthorizationKeychainItemModify
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecACLAuthorizationKeychainItemDelete
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
extern const CFStringRef kSecACLAuthorizationChangeACL
__OSX_AVAILABLE_STARTING(__MAC_10_13_4, __IPHONE_NA);
extern const CFStringRef kSecACLAuthorizationChangeOwner
__OSX_AVAILABLE_STARTING(__MAC_10_13_4, __IPHONE_NA);
extern const CFStringRef kSecACLAuthorizationPartitionID
__OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_NA);
extern const CFStringRef kSecACLAuthorizationIntegrity
__OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_NA);
/*!
@function SecAccessGetTypeID
@abstract Returns the type identifier of SecAccess instances.
@result The CFTypeID of SecAccess instances.
*/
CFTypeID SecAccessGetTypeID(void);
/*!
@function SecAccessCreate
@abstract Creates a new SecAccessRef that is set to the currently designated system default
configuration of a (newly created) security object. Note that the precise nature of
this default may change between releases.
@param descriptor The name of the item as it should appear in security dialogs
@param trustedlist A CFArray of TrustedApplicationRefs, specifying which applications
should be allowed to access an item without triggering confirmation dialogs.
If NULL, defaults to (just) the application creating the item. To set no applications,
pass a CFArray with no elements.
@param accessRef On return, a pointer to the new access reference.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecAccessCreate(CFStringRef descriptor, CFArrayRef __nullable trustedlist, SecAccessRef * __nonnull CF_RETURNS_RETAINED accessRef) API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
/*!
@function SecAccessCreateFromOwnerAndACL
@abstract Creates a new SecAccessRef using the owner and access control list you provide.
@param owner A pointer to a CSSM access control list owner.
@param aclCount An unsigned 32-bit integer representing the number of items in the access control list.
@param acls A pointer to the access control list.
@param accessRef On return, a pointer to the new access reference.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion For 10.7 and later please use the SecAccessCreateWithOwnerAndACL API
*/
OSStatus SecAccessCreateFromOwnerAndACL(const CSSM_ACL_OWNER_PROTOTYPE *owner, uint32 aclCount, const CSSM_ACL_ENTRY_INFO *acls, SecAccessRef * __nonnull CF_RETURNS_RETAINED accessRef)
CSSM_DEPRECATED;
/*!
@function SecAccessCreateWithOwnerAndACL
@abstract Creates a new SecAccessRef using either for a user or a group with a list of ACLs
@param userId An user id that specifies the user to associate with this SecAccessRef.
@param groupId A group id that specifies the group to associate with this SecAccessRef.
@param ownerType Specifies the how the ownership of the new SecAccessRef is defined.
@param acls A CFArrayRef of the ACLs to associate with this SecAccessRef
@param error Optionally a pointer to a CFErrorRef to return any errors with may have occured
@result A pointer to the new access reference.
*/
__nullable
SecAccessRef SecAccessCreateWithOwnerAndACL(uid_t userId, gid_t groupId, SecAccessOwnerType ownerType, CFArrayRef __nullable acls, CFErrorRef *error)
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
/*!
@function SecAccessGetOwnerAndACL
@abstract Retrieves the owner and the access control list of a given access.
@param accessRef A reference to the access from which to retrieve the information.
@param owner On return, a pointer to the access control list owner.
@param aclCount On return, a pointer to an unsigned 32-bit integer representing the number of items in the access control list.
@param acls On return, a pointer to the access control list.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion For 10.7 and later please use the SecAccessCopyOwnerAndACL API
*/
OSStatus SecAccessGetOwnerAndACL(SecAccessRef accessRef, CSSM_ACL_OWNER_PROTOTYPE_PTR __nullable * __nonnull owner, uint32 *aclCount, CSSM_ACL_ENTRY_INFO_PTR __nullable * __nonnull acls)
CSSM_DEPRECATED;
/*!
@function SecAccessCopyOwnerAndACL
@abstract Retrieves the owner and the access control list of a given access.
@param accessRef A reference to the access from which to retrieve the information.
@param userId On return, the user id of the owner
@param groupId On return, the group id of the owner
@param ownerType On return, the type of owner for this AccessRef
@param aclList On return, a pointer to a new created CFArray of SecACL instances. The caller is responsible for calling CFRelease on this array.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecAccessCopyOwnerAndACL(SecAccessRef accessRef, uid_t * __nullable userId, gid_t * __nullable groupId, SecAccessOwnerType * __nullable ownerType, CFArrayRef * __nullable CF_RETURNS_RETAINED aclList)
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
/*!
@function SecAccessCopyACLList
@abstract Copies all the access control lists of a given access.
@param accessRef A reference to the access from which to retrieve the information.
@param aclList On return, a pointer to a new created CFArray of SecACL instances. The caller is responsible for calling CFRelease on this array.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecAccessCopyACLList(SecAccessRef accessRef, CFArrayRef * __nonnull CF_RETURNS_RETAINED aclList) API_UNAVAILABLE(ios, watchos, tvos, macCatalyst);
/*!
@function SecAccessCopySelectedACLList
@abstract Copies selected access control lists from a given access.
@param accessRef A reference to the access from which to retrieve the information.
@param action An authorization tag specifying what action with which to select the action control lists.
@param aclList On return, a pointer to the selected access control lists.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion For 10.7 and later please use the SecAccessCopyMatchingACLList API
*/
OSStatus SecAccessCopySelectedACLList(SecAccessRef accessRef, CSSM_ACL_AUTHORIZATION_TAG action, CFArrayRef * __nonnull CF_RETURNS_RETAINED aclList)
CSSM_DEPRECATED;
/*!
@function SecAccessCopyMatchingACLList
@abstract Copies selected access control lists from a given access.
@param accessRef A reference to the access from which to retrieve the information.
@param authorizationTag An authorization tag specifying what action with which to select the action control lists.
@result A pointer to the selected access control lists.
*/
__nullable
CFArrayRef SecAccessCopyMatchingACLList(SecAccessRef accessRef, CFTypeRef authorizationTag)
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
CF_IMPLICIT_BRIDGING_DISABLED
CF_ASSUME_NONNULL_END
#if defined(__cplusplus)
}
#endif
#endif /* !_SECURITY_SECACCESS_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/mds_schema.h | /*
* Copyright (c) 2000-2001,2011,2014 Apple Inc. All Rights Reserved.
*
* The contents of this file constitute Original Code as defined in and are
* subject to the Apple Public Source License Version 1.2 (the 'License').
* You may not use this file except in compliance with the License. Please obtain
* a copy of the License at http://www.apple.com/publicsource and read it before
* using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
* OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
* LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
* specific language governing rights and limitations under the License.
*/
/*
File: mds_schema.h
Contains: Module Directory Services Schema for CSSM.
Copyright (c) 1999-2000,2011,2014 Apple Inc. All Rights Reserved.
*/
#ifndef _MDS_SCHEMA_H_
#define _MDS_SCHEMA_H_ 1
#include <Security/cssmtype.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Names of the databases supported by MDS. */
#define MDS_OBJECT_DIRECTORY_NAME "MDS Object Directory"
#define MDS_CDSA_DIRECTORY_NAME "MDS CDSA Directory"
/* MDS predefined values for a 16K name space */
#define CSSM_DB_RELATIONID_MDS_START (0x40000000)
#define CSSM_DB_RELATIONID_MDS_END (0x40004000)
#define MDS_OBJECT_RECORDTYPE (CSSM_DB_RELATIONID_MDS_START)
#define MDS_CDSA_SCHEMA_START (MDS_OBJECT_RECORDTYPE)
#define MDS_CDSADIR_CSSM_RECORDTYPE (MDS_CDSA_SCHEMA_START + 1)
#define MDS_CDSADIR_KRMM_RECORDTYPE (MDS_CDSA_SCHEMA_START + 2)
#define MDS_CDSADIR_EMM_RECORDTYPE (MDS_CDSA_SCHEMA_START + 3)
#define MDS_CDSADIR_COMMON_RECORDTYPE (MDS_CDSA_SCHEMA_START + 4)
#define MDS_CDSADIR_CSP_PRIMARY_RECORDTYPE (MDS_CDSA_SCHEMA_START + 5)
#define MDS_CDSADIR_CSP_CAPABILITY_RECORDTYPE (MDS_CDSA_SCHEMA_START + 6)
#define MDS_CDSADIR_CSP_ENCAPSULATED_PRODUCT_RECORDTYPE (MDS_CDSA_SCHEMA_START + 7)
#define MDS_CDSADIR_CSP_SC_INFO_RECORDTYPE (MDS_CDSA_SCHEMA_START + 8)
#define MDS_CDSADIR_DL_PRIMARY_RECORDTYPE (MDS_CDSA_SCHEMA_START + 9)
#define MDS_CDSADIR_DL_ENCAPSULATED_PRODUCT_RECORDTYPE (MDS_CDSA_SCHEMA_START + 10)
#define MDS_CDSADIR_CL_PRIMARY_RECORDTYPE (MDS_CDSA_SCHEMA_START + 11)
#define MDS_CDSADIR_CL_ENCAPSULATED_PRODUCT_RECORDTYPE (MDS_CDSA_SCHEMA_START + 12)
#define MDS_CDSADIR_TP_PRIMARY_RECORDTYPE (MDS_CDSA_SCHEMA_START + 13)
#define MDS_CDSADIR_TP_OIDS_RECORDTYPE (MDS_CDSA_SCHEMA_START + 14)
#define MDS_CDSADIR_TP_ENCAPSULATED_PRODUCT_RECORDTYPE (MDS_CDSA_SCHEMA_START + 15)
#define MDS_CDSADIR_EMM_PRIMARY_RECORDTYPE (MDS_CDSA_SCHEMA_START + 16)
#define MDS_CDSADIR_AC_PRIMARY_RECORDTYPE (MDS_CDSA_SCHEMA_START + 17)
#define MDS_CDSADIR_KR_PRIMARY_RECORDTYPE (MDS_CDSA_SCHEMA_START + 18)
#define MDS_CDSADIR_MDS_SCHEMA_RELATIONS (MDS_CDSA_SCHEMA_START + 19)
#define MDS_CDSADIR_MDS_SCHEMA_ATTRIBUTES (MDS_CDSA_SCHEMA_START + 20)
#define MDS_CDSADIR_MDS_SCHEMA_INDEXES (MDS_CDSA_SCHEMA_START + 21)
/* MDS predefined values for a 16K name space */
#define CSSM_DB_ATTRIBUTE_MDS_START (0x40000000)
#define CSSM_DB_ATTRIBUTE_MDS_END (0x40004000)
#define MDS_CDSAATTR_MODULE_ID (CSSM_DB_ATTRIBUTE_MDS_START + 1)
#define MDS_CDSAATTR_MANIFEST (CSSM_DB_ATTRIBUTE_MDS_START + 2)
#define MDS_CDSAATTR_MODULE_NAME (CSSM_DB_ATTRIBUTE_MDS_START + 3)
#define MDS_CDSAATTR_PATH (CSSM_DB_ATTRIBUTE_MDS_START + 4)
#define MDS_CDSAATTR_CDSAVERSION (CSSM_DB_ATTRIBUTE_MDS_START + 5)
#define MDS_CDSAATTR_VENDOR (CSSM_DB_ATTRIBUTE_MDS_START + 6)
#define MDS_CDSAATTR_DESC (CSSM_DB_ATTRIBUTE_MDS_START + 8)
#define MDS_CDSAATTR_INTERFACE_GUID (CSSM_DB_ATTRIBUTE_MDS_START + 9)
#define MDS_CDSAATTR_POLICY_STMT (CSSM_DB_ATTRIBUTE_MDS_START + 10)
#define MDS_CDSAATTR_EMMSPECVERSION (CSSM_DB_ATTRIBUTE_MDS_START + 11)
#define MDS_CDSAATTR_EMM_VERSION (CSSM_DB_ATTRIBUTE_MDS_START + 12)
#define MDS_CDSAATTR_EMM_VENDOR (CSSM_DB_ATTRIBUTE_MDS_START + 13)
#define MDS_CDSAATTR_EMM_TYPE (CSSM_DB_ATTRIBUTE_MDS_START + 14)
#define MDS_CDSAATTR_SSID (CSSM_DB_ATTRIBUTE_MDS_START + 15)
#define MDS_CDSAATTR_SERVICE_TYPE (CSSM_DB_ATTRIBUTE_MDS_START + 16)
#define MDS_CDSAATTR_NATIVE_SERVICES (CSSM_DB_ATTRIBUTE_MDS_START + 17)
#define MDS_CDSAATTR_DYNAMIC_FLAG (CSSM_DB_ATTRIBUTE_MDS_START + 18)
#define MDS_CDSAATTR_MULTITHREAD_FLAG (CSSM_DB_ATTRIBUTE_MDS_START + 19)
#define MDS_CDSAATTR_SERVICE_MASK (CSSM_DB_ATTRIBUTE_MDS_START + 20)
#define MDS_CDSAATTR_CSP_TYPE (CSSM_DB_ATTRIBUTE_MDS_START + 21)
#define MDS_CDSAATTR_CSP_FLAGS (CSSM_DB_ATTRIBUTE_MDS_START + 22)
#define MDS_CDSAATTR_CSP_CUSTOMFLAGS (CSSM_DB_ATTRIBUTE_MDS_START + 23)
#define MDS_CDSAATTR_USEE_TAGS (CSSM_DB_ATTRIBUTE_MDS_START + 24)
#define MDS_CDSAATTR_CONTEXT_TYPE (CSSM_DB_ATTRIBUTE_MDS_START + 25)
#define MDS_CDSAATTR_ALG_TYPE (CSSM_DB_ATTRIBUTE_MDS_START + 26)
#define MDS_CDSAATTR_GROUP_ID (CSSM_DB_ATTRIBUTE_MDS_START + 27)
#define MDS_CDSAATTR_ATTRIBUTE_TYPE (CSSM_DB_ATTRIBUTE_MDS_START + 28)
#define MDS_CDSAATTR_ATTRIBUTE_VALUE (CSSM_DB_ATTRIBUTE_MDS_START + 29)
#define MDS_CDSAATTR_PRODUCT_DESC (CSSM_DB_ATTRIBUTE_MDS_START + 30)
#define MDS_CDSAATTR_PRODUCT_VENDOR (CSSM_DB_ATTRIBUTE_MDS_START + 31)
#define MDS_CDSAATTR_PRODUCT_VERSION (CSSM_DB_ATTRIBUTE_MDS_START + 32)
#define MDS_CDSAATTR_PRODUCT_FLAGS (CSSM_DB_ATTRIBUTE_MDS_START + 33)
#define MDS_CDSAATTR_PRODUCT_CUSTOMFLAGS (CSSM_DB_ATTRIBUTE_MDS_START + 34)
#define MDS_CDSAATTR_STANDARD_DESC (CSSM_DB_ATTRIBUTE_MDS_START + 35)
#define MDS_CDSAATTR_STANDARD_VERSION (CSSM_DB_ATTRIBUTE_MDS_START + 36)
#define MDS_CDSAATTR_READER_DESC (CSSM_DB_ATTRIBUTE_MDS_START + 37)
#define MDS_CDSAATTR_READER_VENDOR (CSSM_DB_ATTRIBUTE_MDS_START + 38)
#define MDS_CDSAATTR_READER_VERSION (CSSM_DB_ATTRIBUTE_MDS_START + 39)
#define MDS_CDSAATTR_READER_FWVERSION (CSSM_DB_ATTRIBUTE_MDS_START + 40)
#define MDS_CDSAATTR_READER_FLAGS (CSSM_DB_ATTRIBUTE_MDS_START + 41)
#define MDS_CDSAATTR_READER_CUSTOMFLAGS (CSSM_DB_ATTRIBUTE_MDS_START + 42)
#define MDS_CDSAATTR_READER_SERIALNUMBER (CSSM_DB_ATTRIBUTE_MDS_START + 43)
#define MDS_CDSAATTR_SC_DESC (CSSM_DB_ATTRIBUTE_MDS_START + 44)
#define MDS_CDSAATTR_SC_VENDOR (CSSM_DB_ATTRIBUTE_MDS_START + 45)
#define MDS_CDSAATTR_SC_VERSION (CSSM_DB_ATTRIBUTE_MDS_START + 46)
#define MDS_CDSAATTR_SC_FWVERSION (CSSM_DB_ATTRIBUTE_MDS_START + 47)
#define MDS_CDSAATTR_SC_FLAGS (CSSM_DB_ATTRIBUTE_MDS_START + 48)
#define MDS_CDSAATTR_SC_CUSTOMFLAGS (CSSM_DB_ATTRIBUTE_MDS_START + 49)
#define MDS_CDSAATTR_SC_SERIALNUMBER (CSSM_DB_ATTRIBUTE_MDS_START + 50)
#define MDS_CDSAATTR_DL_TYPE (CSSM_DB_ATTRIBUTE_MDS_START + 51)
#define MDS_CDSAATTR_QUERY_LIMITS (CSSM_DB_ATTRIBUTE_MDS_START + 52)
#define MDS_CDSAATTR_CONJUNCTIVE_OPS (CSSM_DB_ATTRIBUTE_MDS_START + 53)
#define MDS_CDSAATTR_RELATIONAL_OPS (CSSM_DB_ATTRIBUTE_MDS_START + 54)
#define MDS_CDSAATTR_PROTOCOL (CSSM_DB_ATTRIBUTE_MDS_START + 55)
#define MDS_CDSAATTR_CERT_TYPEFORMAT (CSSM_DB_ATTRIBUTE_MDS_START + 56)
#define MDS_CDSAATTR_CRL_TYPEFORMAT (CSSM_DB_ATTRIBUTE_MDS_START + 57)
#define MDS_CDSAATTR_CERT_FIELDNAMES (CSSM_DB_ATTRIBUTE_MDS_START + 58)
#define MDS_CDSAATTR_BUNDLE_TYPEFORMAT (CSSM_DB_ATTRIBUTE_MDS_START + 59)
#define MDS_CDSAATTR_CERT_CLASSNAME (CSSM_DB_ATTRIBUTE_MDS_START + 60)
#define MDS_CDSAATTR_ROOTCERT (CSSM_DB_ATTRIBUTE_MDS_START + 61)
#define MDS_CDSAATTR_ROOTCERT_TYPEFORMAT (CSSM_DB_ATTRIBUTE_MDS_START + 62)
#define MDS_CDSAATTR_VALUE (CSSM_DB_ATTRIBUTE_MDS_START + 63)
#define MDS_CDSAATTR_REQCREDENTIALS (CSSM_DB_ATTRIBUTE_MDS_START + 64)
#define MDS_CDSAATTR_SAMPLETYPES (CSSM_DB_ATTRIBUTE_MDS_START + 65)
#define MDS_CDSAATTR_ACLSUBJECTTYPES (CSSM_DB_ATTRIBUTE_MDS_START + 66)
#define MDS_CDSAATTR_AUTHTAGS (CSSM_DB_ATTRIBUTE_MDS_START + 67)
#define MDS_CDSAATTR_USEETAG (CSSM_DB_ATTRIBUTE_MDS_START + 68)
#define MDS_CDSAATTR_RETRIEVALMODE (CSSM_DB_ATTRIBUTE_MDS_START + 69)
#define MDS_CDSAATTR_OID (CSSM_DB_ATTRIBUTE_MDS_START + 70)
#define MDS_CDSAATTR_XLATIONTYPEFORMAT (CSSM_DB_ATTRIBUTE_MDS_START + 71)
#define MDS_CDSAATTR_DEFAULT_TEMPLATE_TYPE (CSSM_DB_ATTRIBUTE_MDS_START + 72)
#define MDS_CDSAATTR_TEMPLATE_FIELD_NAMES (CSSM_DB_ATTRIBUTE_MDS_START + 73)
#define MDS_CDSAATTR_AUTHORITY_REQUEST_TYPE (CSSM_DB_ATTRIBUTE_MDS_START + 74)
/* Meta-data names for the MDS Object directory relation */
#define MDS_OBJECT_NUM_RELATIONS (1)
#define MDS_OBJECT_NUM_ATTRIBUTES (4)
/* Defined constant for # of relations in the CDSA directory */
#define MDS_CDSADIR_NUM_RELATIONS (19)
/* Meta-data names for the MDS CSSM relation */
#define MDS_CDSADIR_CSSM_NUM_ATTRIBUTES (4)
/* Meta-data names for the MDS EMM relation */
#define MDS_CDSADIR_EMM_NUM_ATTRIBUTES (11)
/* Meta-data names for the MDS Common relation */
#define MDS_CDSADIR_COMMON_NUM_ATTRIBUTES (9)
/* Meta-data names for the MDS CSP Primary relation */
#define MDS_CDSADIR_CSP_PRIMARY_NUM_ATTRIBUTES (13)
/* Meta-data names for the MDS CSP Capabilities relation */
#define MDS_CDSADIR_CSP_CAPABILITY_NUM_ATTRIBUTES (9)
/* Meta-data names for the MDS CSP Encapsulated Product relation */
#define MDS_CDSADIR_CSP_ENCAPSULATED_PRODUCT_NUM_ATTRIBUTES (16)
/* Meta-data names for the MDS CSP SmartcardInfo relation */
#define MDS_CDSADIR_CSP_SC_INFO_NUM_ATTRIBUTES (9)
/* Meta-data names for the MDS DL Primary relation */
#define MDS_CDSADIR_DL_PRIMARY_NUM_ATTRIBUTES (13)
/* Meta-data names for the MDS DL Encapsulated Product relation */
#define MDS_CDSADIR_DL_ENCAPSULATED_PRODUCT_NUM_ATTRIBUTES (10)
/* Meta-data names for the MDS CL Primary relation */
#define MDS_CDSADIR_CL_PRIMARY_NUM_ATTRIBUTES (13)
/* Meta-data names for the MDS CL Encapsulated Product relation */
#define MDS_CDSADIR_CL_ENCAPSULATED_PRODUCT_NUM_ATTRIBUTES (8)
/* Meta-data names for the MDS TP Primary relation */
#define MDS_CDSADIR_TP_PRIMARY_NUM_ATTRIBUTES (10)
/* Meta-data names for the MDS TP Policy-OIDS relation */
#define MDS_CDSADIR_TP_OIDS_NUM_ATTRIBUTES (4)
/* Meta-data names for the MDS TP Encapsulated Product relation */
#define MDS_CDSADIR_TP_ENCAPSULATED_PRODUCT_NUM_ATTRIBUTES (14)
/* Meta-data names for MDS EMM Service Provider Primary relation */
#define MDS_CDSADIR_EMM_PRIMARY_NUM_ATTRIBUTES (9)
/* Meta-data names for MDS AC Primary relation */
#define MDS_CDSADIR_AC_PRIMARY_NUM_ATTRIBUTES (6)
/* Meta-data names for MDS Schema relation */
#define MDS_CDSADIR_SCHEMA_RELATONS_NUM_ATTRIBUTES (2)
#define MDS_CDSADIR_SCHEMA_ATTRIBUTES_NUM_ATTRIBUTES (6)
#define MDS_CDSADIR_SCHEMA_INDEXES_NUM_ATTRIBUTES (5)
#ifdef __cplusplus
}
#endif
#endif /* _MDS_SCHEMA_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/certextensions.h | /*
* Copyright (c) 2000-2009,2011,2012,2014,2016 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*
* CertExtensions.h -- X.509 Cert Extensions as C structs
*/
#ifndef _CERT_EXTENSIONS_H_
#define _CERT_EXTENSIONS_H_
#include <Security/SecBase.h>
#if SEC_OS_OSX
#include <Security/cssmtype.h>
#include <Security/x509defs.h> /* CSSM_X509_RDN_PTR */
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#else /* SEC_OS_IPHONE */
#include <stdbool.h>
#include <libDER/libDER.h>
#endif /* SEC_OS_IPHONE */
/***
*** Structs for declaring extension-specific data.
***/
/*
* GeneralName, used in AuthorityKeyID, SubjectAltName, and
* IssuerAltName.
*
* For now, we just provide explicit support for the types which are
* represented as IA5Strings, OIDs, and octet strings. Constructed types
* such as EDIPartyName and x400Address are not explicitly handled
* right now and must be encoded and decoded by the caller. (See exception
* for Name and OtherName, below). In those cases the SecECGeneralName.name.Data / CE_GeneralName.name.Data field
* represents the BER contents octets; SecCEGeneralName.name.Length / CE_GeneralName.name.Length is the
* length of the contents; the tag of the field is not needed - the BER
* encoding uses context-specific implicit tagging. The berEncoded field
* is set to true / CSSM_TRUE in these case. Simple types have berEncoded = false / CSSM_FALSE.
*
* In the case of a GeneralName in the form of a Name, we parse the Name
* into a CSSM_X509_NAME and place a pointer to the CSSM_X509_NAME in the
* CE_GeneralName.name.Data field. SecCEGeneralName.name.Length / CE_GeneralName.name.Length is set to
* sizeof(CSSM_X509_NAME). In this case berEncoded is false.
*
* In the case of a GeneralName in the form of a OtherName, we parse the fields
* into a CE_OtherName and place a pointer to the SecCEOtherName / CE_OtherName in the
* SecCEGeneralName.name.Data / CE_GeneralName.name.Data field. SecCEGeneralName.name.Length / CE_GeneralName.name.Length is set to
* sizeof(SecCEOtherName) / sizeof(CE_OtherName). In this case berEncoded is false.
*
* GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName
*
* GeneralName ::= CHOICE {
* otherName [0] OtherName
* rfc822Name [1] IA5String,
* dNSName [2] IA5String,
* x400Address [3] ORAddress,
* directoryName [4] Name,
* ediPartyName [5] EDIPartyName,
* uniformResourceIdentifier [6] IA5String,
* iPAddress [7] OCTET STRING,
* registeredID [8] OBJECT IDENTIFIER}
*
* OtherName ::= SEQUENCE {
* type-id OBJECT IDENTIFIER,
* value [0] EXPLICIT ANY DEFINED BY type-id }
*
* EDIPartyName ::= SEQUENCE {
* nameAssigner [0] DirectoryString OPTIONAL,
* partyName [1] DirectoryString }
*/
typedef enum __CE_GeneralNameType {
GNT_OtherName = 0,
GNT_RFC822Name,
GNT_DNSName,
GNT_X400Address,
GNT_DirectoryName,
GNT_EdiPartyName,
GNT_URI,
GNT_IPAddress,
GNT_RegisteredID
} CE_GeneralNameType;
#define SecCEGeneralNameType CE_GeneralNameType
#if SEC_OS_OSX
typedef struct __CE_OtherName {
CSSM_OID typeId;
CSSM_DATA value; // unparsed, BER-encoded
} CE_OtherName DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef struct __CE_GeneralName {
CE_GeneralNameType nameType; // GNT_RFC822Name, etc.
CSSM_BOOL berEncoded;
CSSM_DATA name;
} CE_GeneralName DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef struct __CE_GeneralNames {
uint32 numNames;
CE_GeneralName *generalName;
} CE_GeneralNames DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
#elif SEC_OS_IPHONE
typedef struct {
DERItem typeId;
DERItem value; // unparsed, BER-encoded
} SecCEOtherName;
typedef struct {
SecCEGeneralNameType nameType; // GNT_RFC822Name, etc.
bool berEncoded;
DERItem name;
} SecCEGeneralName;
typedef struct {
uint32_t numNames;
SecCEGeneralName *generalName;
} SecCEGeneralNames;
#endif /* SEC_OS_IPHONE */
/*
* id-ce-authorityKeyIdentifier OBJECT IDENTIFIER ::= { id-ce 35 }
*
* AuthorityKeyIdentifier ::= SEQUENCE {
* keyIdentifier [0] KeyIdentifier OPTIONAL,
* authorityCertIssuer [1] GeneralNames OPTIONAL,
* authorityCertSerialNumber [2] CertificateSerialNumber OPTIONAL }
*
* KeyIdentifier ::= OCTET STRING
*
* CSSM OID = CSSMOID_AuthorityKeyIdentifier
*/
#if SEC_OS_OSX
typedef struct __CE_AuthorityKeyID {
CSSM_BOOL keyIdentifierPresent;
CSSM_DATA keyIdentifier;
CSSM_BOOL generalNamesPresent;
CE_GeneralNames *generalNames;
CSSM_BOOL serialNumberPresent;
CSSM_DATA serialNumber;
} CE_AuthorityKeyID DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
#elif SEC_OS_IPHONE
typedef struct {
bool keyIdentifierPresent;
DERItem keyIdentifier;
bool generalNamesPresent;
SecCEGeneralNames *generalNames;
bool serialNumberPresent;
DERItem serialNumber;
} SecCEAuthorityKeyID;
#endif /* SEC_OS_IPHONE */
/*
* id-ce-subjectKeyIdentifier OBJECT IDENTIFIER ::= { id-ce 14 }
* SubjectKeyIdentifier ::= KeyIdentifier
*
* CSSM OID = CSSMOID_SubjectKeyIdentifier
*/
#if SEC_OS_OSX
typedef CSSM_DATA CE_SubjectKeyID DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
#elif SEC_OS_IPHONE
typedef DERItem SecCESubjectKeyID;
#endif /* SEC_OS_IPHONE */
/*
* id-ce-keyUsage OBJECT IDENTIFIER ::= { id-ce 15 }
*
* KeyUsage ::= BIT STRING {
* digitalSignature (0),
* nonRepudiation (1),
* keyEncipherment (2),
* dataEncipherment (3),
* keyAgreement (4),
* keyCertSign (5),
* cRLSign (6),
* encipherOnly (7),
* decipherOnly (8) }
*
* CSSM OID = CSSMOID_KeyUsage
*
*/
#if SEC_OS_OSX
typedef uint16 CE_KeyUsage DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
#elif SEC_OS_IPHONE
typedef uint16_t SecCEKeyUsage;
#endif /* SEC_OS_IPHONE */
#if SEC_OS_OSX
#define CE_KU_DigitalSignature 0x8000
#define CE_KU_NonRepudiation 0x4000
#define CE_KU_KeyEncipherment 0x2000
#define CE_KU_DataEncipherment 0x1000
#define CE_KU_KeyAgreement 0x0800
#define CE_KU_KeyCertSign 0x0400
#define CE_KU_CRLSign 0x0200
#define CE_KU_EncipherOnly 0x0100
#define CE_KU_DecipherOnly 0x0080
#else /* SEC_OS_IPHONE */
#define SecCEKU_DigitalSignature 0x8000
#define SecCEKU_NonRepudiation 0x4000
#define SecCEKU_KeyEncipherment 0x2000
#define SecCEKU_DataEncipherment 0x1000
#define SecCEKU_KeyAgreement 0x0800
#define SecCEKU_KeyCertSign 0x0400
#define SecCEKU_CRLSign 0x0200
#define SecCEKU_EncipherOnly 0x0100
#define SecCEKU_DecipherOnly 0x0080
#endif /* SEC_OS_IPHONE */
/*
* id-ce-cRLReason OBJECT IDENTIFIER ::= { id-ce 21 }
*
* -- reasonCode ::= { CRLReason }
*
* CRLReason ::= ENUMERATED {
* unspecified (0),
* keyCompromise (1),
* cACompromise (2),
* affiliationChanged (3),
* superseded (4),
* cessationOfOperation (5),
* certificateHold (6),
* removeFromCRL (8) }
*
* CSSM OID = CSSMOID_CrlReason
*
*/
#if SEC_OS_OSX
typedef uint32 CE_CrlReason DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
#elif SEC_OS_IPHONE
typedef uint32_t SecCECrlReason;
#endif /* SEC_OS_IPHONE */
#if SEC_OS_OSX
#define CE_CR_Unspecified 0
#define CE_CR_KeyCompromise 1
#define CE_CR_CACompromise 2
#define CE_CR_AffiliationChanged 3
#define CE_CR_Superseded 4
#define CE_CR_CessationOfOperation 5
#define CE_CR_CertificateHold 6
#define CE_CR_RemoveFromCRL 8
#elif SEC_OS_IPHONE
#define SecCECR_Unspecified 0
#define SecCECR_KeyCompromise 1
#define SecCECR_CACompromise 2
#define SecCECR_AffiliationChanged 3
#define SecCECR_Superseded 4
#define SecCECR_CessationOfOperation 5
#define SecCECR_CertificateHold 6
#define SecCECR_RemoveFromCRL 8
#endif /* SEC_OS_IPHONE */
/*
* id-ce-subjectAltName OBJECT IDENTIFIER ::= { id-ce 17 }
*
* SubjectAltName ::= GeneralNames
*
* CSSM OID = CSSMOID_SubjectAltName
*
* GeneralNames defined above.
*/
/*
* id-ce-extKeyUsage OBJECT IDENTIFIER ::= {id-ce 37}
*
* ExtKeyUsageSyntax ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId*
*
* KeyPurposeId ::= OBJECT IDENTIFIER
*
* CSSM OID = CSSMOID_ExtendedKeyUsage
*/
#if SEC_OS_OSX
typedef struct __CE_ExtendedKeyUsage {
uint32 numPurposes;
CSSM_OID_PTR purposes; // in Intel pre-encoded format
} CE_ExtendedKeyUsage;
#elif SEC_OS_IPHONE
typedef struct {
uint32_t numPurposes;
DERItem *purposes; // in Intel pre-encoded format
} SecCEExtendedKeyUsage;
#endif /* SEC_OS_IPHONE */
/*
* id-ce-basicConstraints OBJECT IDENTIFIER ::= { id-ce 19 }
*
* BasicConstraints ::= SEQUENCE {
* cA BOOLEAN DEFAULT FALSE,
* pathLenConstraint INTEGER (0..MAX) OPTIONAL }
*
* CSSM OID = CSSMOID_BasicConstraints
*/
#if SEC_OS_OSX
typedef struct __CE_BasicConstraints {
CSSM_BOOL cA;
CSSM_BOOL pathLenConstraintPresent;
uint32 pathLenConstraint;
} CE_BasicConstraints DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
#elif SEC_OS_IPHONE
typedef struct {
bool present;
bool critical;
bool isCA;
bool pathLenConstraintPresent;
uint32_t pathLenConstraint;
} SecCEBasicConstraints;
typedef struct {
bool present;
bool critical;
bool requireExplicitPolicyPresent;
uint32_t requireExplicitPolicy;
bool inhibitPolicyMappingPresent;
uint32_t inhibitPolicyMapping;
} SecCEPolicyConstraints;
#endif /* SEC_OS_IPHONE */
/*
* id-ce-certificatePolicies OBJECT IDENTIFIER ::= { id-ce 32 }
*
* certificatePolicies ::= SEQUENCE SIZE (1..MAX) OF PolicyInformation
*
* PolicyInformation ::= SEQUENCE {
* policyIdentifier CertPolicyId,
* policyQualifiers SEQUENCE SIZE (1..MAX) OF
* PolicyQualifierInfo OPTIONAL }
*
* CertPolicyId ::= OBJECT IDENTIFIER
*
* PolicyQualifierInfo ::= SEQUENCE {
* policyQualifierId PolicyQualifierId,
* qualifier ANY DEFINED BY policyQualifierId }
*
* -- policyQualifierIds for Internet policy qualifiers
*
* id-qt OBJECT IDENTIFIER ::= { id-pkix 2 }
* id-qt-cps OBJECT IDENTIFIER ::= { id-qt 1 }
* id-qt-unotice OBJECT IDENTIFIER ::= { id-qt 2 }
*
* PolicyQualifierId ::=
* OBJECT IDENTIFIER ( id-qt-cps | id-qt-unotice )
*
* Qualifier ::= CHOICE {
* cPSuri CPSuri,
* userNotice UserNotice }
*
* CPSuri ::= IA5String
*
* UserNotice ::= SEQUENCE {
* noticeRef NoticeReference OPTIONAL,
* explicitText DisplayText OPTIONAL}
*
* NoticeReference ::= SEQUENCE {
* organization DisplayText,
* noticeNumbers SEQUENCE OF INTEGER }
*
* DisplayText ::= CHOICE {
* visibleString VisibleString (SIZE (1..200)),
* bmpString BMPString (SIZE (1..200)),
* utf8String UTF8String (SIZE (1..200)) }
*
* CSSM OID = CSSMOID_CertificatePolicies
*
* We only support down to the level of Qualifier, and then only the CPSuri
* choice. UserNotice is transmitted to and from this library as a raw
* CSSM_DATA containing the BER-encoded UserNotice sequence.
*/
#if SEC_OS_OSX
typedef struct __CE_PolicyQualifierInfo {
CSSM_OID policyQualifierId; // CSSMOID_QT_CPS, CSSMOID_QT_UNOTICE
CSSM_DATA qualifier; // CSSMOID_QT_CPS: IA5String contents
#elif SEC_OS_IPHONE
#if 0
typedef struct {
DERItem policyQualifierId; // CSSMOID_QT_CPS, CSSMOID_QT_UNOTICE
DERItem qualifier; // CSSMOID_QT_CPS: IA5String contents
} SecCEPolicyQualifierInfo;
#endif
typedef struct {
DERItem policyIdentifier;
DERItem policyQualifiers;
} SecCEPolicyInformation;
typedef struct {
bool present;
bool critical;
size_t numPolicies; // size of *policies;
SecCEPolicyInformation *policies;
} SecCECertificatePolicies;
typedef struct {
DERItem issuerDomainPolicy;
DERItem subjectDomainPolicy;
} SecCEPolicyMapping;
/*
PolicyMappings ::= SEQUENCE SIZE (1..MAX) OF SEQUENCE {
issuerDomainPolicy CertPolicyId,
subjectDomainPolicy CertPolicyId }
*/
typedef struct {
bool present;
bool critical;
size_t numMappings; // size of *mappings;
SecCEPolicyMapping *mappings;
} SecCEPolicyMappings;
/*
InhibitAnyPolicy ::= SkipCerts
SkipCerts ::= INTEGER (0..MAX)
*/
typedef struct {
bool present;
bool critical;
uint32_t skipCerts;
} SecCEInhibitAnyPolicy;
#endif /* SEC_OS_IPHONE */
// CSSMOID_QT_UNOTICE : Sequence contents
#if SEC_OS_OSX
} CE_PolicyQualifierInfo DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef struct __CE_PolicyInformation {
CSSM_OID certPolicyId;
uint32 numPolicyQualifiers; // size of *policyQualifiers;
CE_PolicyQualifierInfo *policyQualifiers;
} CE_PolicyInformation DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef struct __CE_CertPolicies {
uint32 numPolicies; // size of *policies;
CE_PolicyInformation *policies;
} CE_CertPolicies DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/*
* netscape-cert-type, a bit string.
*
* CSSM OID = CSSMOID_NetscapeCertType
*
* Bit fields defined in oidsattr.h: CE_NCT_SSL_Client, etc.
*/
typedef uint16 CE_NetscapeCertType DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/*
* CRLDistributionPoints.
*
* id-ce-cRLDistributionPoints OBJECT IDENTIFIER ::= { id-ce 31 }
*
* cRLDistributionPoints ::= {
* CRLDistPointsSyntax }
*
* CRLDistPointsSyntax ::= SEQUENCE SIZE (1..MAX) OF DistributionPoint
*
* NOTE: RFC 2459 claims that the tag for the optional DistributionPointName
* is IMPLICIT as shown here, but in practice it is EXPLICIT. It has to be -
* because the underlying type also uses an implicit tag for distinguish
* between CHOICEs.
*
* DistributionPoint ::= SEQUENCE {
* distributionPoint [0] DistributionPointName OPTIONAL,
* reasons [1] ReasonFlags OPTIONAL,
* cRLIssuer [2] GeneralNames OPTIONAL }
*
* DistributionPointName ::= CHOICE {
* fullName [0] GeneralNames,
* nameRelativeToCRLIssuer [1] RelativeDistinguishedName }
*
* ReasonFlags ::= BIT STRING {
* unused (0),
* keyCompromise (1),
* cACompromise (2),
* affiliationChanged (3),
* superseded (4),
* cessationOfOperation (5),
* certificateHold (6) }
*
* CSSM OID = CSSMOID_CrlDistributionPoints
*/
/*
* Note that this looks similar to CE_CrlReason, but that's an enum and this
* is an OR-able bit string.
*/
typedef uint8 CE_CrlDistReasonFlags DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
#define CE_CD_Unspecified 0x80
#define CE_CD_KeyCompromise 0x40
#define CE_CD_CACompromise 0x20
#define CE_CD_AffiliationChanged 0x10
#define CE_CD_Superseded 0x08
#define CE_CD_CessationOfOperation 0x04
#define CE_CD_CertificateHold 0x02
typedef enum __CE_CrlDistributionPointNameType {
CE_CDNT_FullName,
CE_CDNT_NameRelativeToCrlIssuer
} CE_CrlDistributionPointNameType DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef struct __CE_DistributionPointName {
CE_CrlDistributionPointNameType nameType;
union {
CE_GeneralNames *fullName;
CSSM_X509_RDN_PTR rdn;
} dpn;
} CE_DistributionPointName DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/*
* The top-level CRLDistributionPoint.
* All fields are optional; NULL pointers indicate absence.
*/
typedef struct __CE_CRLDistributionPoint {
CE_DistributionPointName *distPointName;
CSSM_BOOL reasonsPresent;
CE_CrlDistReasonFlags reasons;
CE_GeneralNames *crlIssuer;
} CE_CRLDistributionPoint DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef struct __CE_CRLDistPointsSyntax {
uint32 numDistPoints;
CE_CRLDistributionPoint *distPoints;
} CE_CRLDistPointsSyntax DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/*
* Authority Information Access and Subject Information Access.
*
* CSSM OID = CSSMOID_AuthorityInfoAccess
* CSSM OID = CSSMOID_SubjectInfoAccess
*
* SubjAuthInfoAccessSyntax ::=
* SEQUENCE SIZE (1..MAX) OF AccessDescription
*
* AccessDescription ::= SEQUENCE {
* accessMethod OBJECT IDENTIFIER,
* accessLocation GeneralName }
*/
typedef struct __CE_AccessDescription {
CSSM_OID accessMethod;
CE_GeneralName accessLocation;
} CE_AccessDescription DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef struct __CE_AuthorityInfoAccess {
uint32 numAccessDescriptions;
CE_AccessDescription *accessDescriptions;
} CE_AuthorityInfoAccess DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/*
* Qualified Certificate Statement support, per RFC 3739.
*
* First, NameRegistrationAuthorities, a component of
* SemanticsInformation; it's the same as a GeneralNames -
* a sequence of GeneralName.
*/
typedef CE_GeneralNames CE_NameRegistrationAuthorities DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/*
* SemanticsInformation, identified as the qcType field
* of a CE_QC_Statement for statementId value id-qcs-pkixQCSyntax-v2.
* Both fields optional; at least one must be present.
*/
typedef struct __CE_SemanticsInformation {
CSSM_OID *semanticsIdentifier;
CE_NameRegistrationAuthorities *nameRegistrationAuthorities;
} CE_SemanticsInformation DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/*
* One Qualified Certificate Statement.
* The statementId OID is required; zero or one of {semanticsInfo,
* otherInfo} can be valid, depending on the value of statementId.
* For statementId id-qcs-pkixQCSyntax-v2 (CSSMOID_OID_QCS_SYNTAX_V2),
* the semanticsInfo field may be present; otherwise, DER-encoded
* information may be present in otherInfo. Both semanticsInfo and
* otherInfo are optional.
*/
typedef struct __CE_QC_Statement {
CSSM_OID statementId;
CE_SemanticsInformation *semanticsInfo;
CSSM_DATA *otherInfo;
} CE_QC_Statement DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/*
* The top-level Qualified Certificate Statements extension.
*/
typedef struct __CE_QC_Statements {
uint32 numQCStatements;
CE_QC_Statement *qcStatements;
} CE_QC_Statements DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/*** CRL extensions ***/
/*
* cRLNumber, an integer.
*
* CSSM OID = CSSMOID_CrlNumber
*/
typedef uint32 CE_CrlNumber;
/*
* deltaCRLIndicator, an integer.
*
* CSSM OID = CSSMOID_DeltaCrlIndicator
*/
typedef uint32 CE_DeltaCrl;
/*
* IssuingDistributionPoint
*
* id-ce-issuingDistributionPoint OBJECT IDENTIFIER ::= { id-ce 28 }
*
* issuingDistributionPoint ::= SEQUENCE {
* distributionPoint [0] DistributionPointName OPTIONAL,
* onlyContainsUserCerts [1] BOOLEAN DEFAULT FALSE,
* onlyContainsCACerts [2] BOOLEAN DEFAULT FALSE,
* onlySomeReasons [3] ReasonFlags OPTIONAL,
* indirectCRL [4] BOOLEAN DEFAULT FALSE }
*
* CSSM OID = CSSMOID_IssuingDistributionPoint
*/
typedef struct __CE_IssuingDistributionPoint {
CE_DistributionPointName *distPointName; // optional
CSSM_BOOL onlyUserCertsPresent;
CSSM_BOOL onlyUserCerts;
CSSM_BOOL onlyCACertsPresent;
CSSM_BOOL onlyCACerts;
CSSM_BOOL onlySomeReasonsPresent;
CE_CrlDistReasonFlags onlySomeReasons;
CSSM_BOOL indirectCrlPresent;
CSSM_BOOL indirectCrl;
} CE_IssuingDistributionPoint DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/*
* NameConstraints
*
* id-ce-nameConstraints OBJECT IDENTIFIER ::= { id-ce 30 }
*
* NameConstraints ::= SEQUENCE {
* permittedSubtrees [0] GeneralSubtrees OPTIONAL,
* excludedSubtrees [1] GeneralSubtrees OPTIONAL }
*
* GeneralSubtrees ::= SEQUENCE SIZE (1..MAX) OF GeneralSubtree
*
* GeneralSubtree ::= SEQUENCE {
* base GeneralName,
* minimum [0] BaseDistance DEFAULT 0,
* maximum [1] BaseDistance OPTIONAL }
*
* BaseDistance ::= INTEGER (0..MAX)
*/
typedef struct __CE_GeneralSubtree {
CE_GeneralNames *base;
uint32 minimum; // default=0
CSSM_BOOL maximumPresent;
uint32 maximum; // optional
} CE_GeneralSubtree DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef struct __CE_GeneralSubtrees {
uint32 numSubtrees;
CE_GeneralSubtree *subtrees;
} CE_GeneralSubtrees DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef struct __CE_NameConstraints {
CE_GeneralSubtrees *permitted; // optional
CE_GeneralSubtrees *excluded; // optional
} CE_NameConstraints DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/*
* PolicyMappings
*
* id-ce-policyMappings OBJECT IDENTIFIER ::= { id-ce 33 }
*
* PolicyMappings ::= SEQUENCE SIZE (1..MAX) OF SEQUENCE {
* issuerDomainPolicy CertPolicyId,
* subjectDomainPolicy CertPolicyId }
*
* Note that both issuer and subject policy OIDs are required,
* and are stored by value in this structure.
*/
typedef struct __CE_PolicyMapping {
CSSM_OID issuerDomainPolicy;
CSSM_OID subjectDomainPolicy;
} CE_PolicyMapping DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef struct __CE_PolicyMappings {
uint32 numPolicyMappings;
CE_PolicyMapping *policyMappings;
} CE_PolicyMappings DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/*
* PolicyConstraints
*
* id-ce-policyConstraints OBJECT IDENTIFIER ::= { id-ce 36 }
*
* PolicyConstraints ::= SEQUENCE {
* requireExplicitPolicy [0] SkipCerts OPTIONAL,
* inhibitPolicyMapping [1] SkipCerts OPTIONAL }
*
* SkipCerts ::= INTEGER (0..MAX)
*/
typedef struct __CE_PolicyConstraints {
CSSM_BOOL requireExplicitPolicyPresent;
uint32 requireExplicitPolicy; // optional
CSSM_BOOL inhibitPolicyMappingPresent;
uint32 inhibitPolicyMapping; // optional
} CE_PolicyConstraints DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/*
* InhibitAnyPolicy, an integer.
*
* CSSM OID = CSSMOID_InhibitAnyPolicy
*/
typedef uint32 CE_InhibitAnyPolicy DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
/*
* An enumerated list identifying one of the above per-extension
* structs.
*/
typedef enum __CE_DataType {
DT_AuthorityKeyID, // CE_AuthorityKeyID
DT_SubjectKeyID, // CE_SubjectKeyID
DT_KeyUsage, // CE_KeyUsage
DT_SubjectAltName, // implies CE_GeneralName
DT_IssuerAltName, // implies CE_GeneralName
DT_ExtendedKeyUsage, // CE_ExtendedKeyUsage
DT_BasicConstraints, // CE_BasicConstraints
DT_CertPolicies, // CE_CertPolicies
DT_NetscapeCertType, // CE_NetscapeCertType
DT_CrlNumber, // CE_CrlNumber
DT_DeltaCrl, // CE_DeltaCrl
DT_CrlReason, // CE_CrlReason
DT_CrlDistributionPoints, // CE_CRLDistPointsSyntax
DT_IssuingDistributionPoint,// CE_IssuingDistributionPoint
DT_AuthorityInfoAccess, // CE_AuthorityInfoAccess
DT_Other, // unknown, raw data as a CSSM_DATA
DT_QC_Statements, // CE_QC_Statements
DT_NameConstraints, // CE_NameConstraints
DT_PolicyMappings, // CE_PolicyMappings
DT_PolicyConstraints, // CE_PolicyConstraints
DT_InhibitAnyPolicy // CE_InhibitAnyPolicy
} CE_DataType;
/*
* One unified representation of all the cert and CRL extensions we know about.
*/
typedef union {
CE_AuthorityKeyID authorityKeyID;
CE_SubjectKeyID subjectKeyID;
CE_KeyUsage keyUsage;
CE_GeneralNames subjectAltName;
CE_GeneralNames issuerAltName;
CE_ExtendedKeyUsage extendedKeyUsage;
CE_BasicConstraints basicConstraints;
CE_CertPolicies certPolicies;
CE_NetscapeCertType netscapeCertType;
CE_CrlNumber crlNumber;
CE_DeltaCrl deltaCrl;
CE_CrlReason crlReason;
CE_CRLDistPointsSyntax crlDistPoints;
CE_IssuingDistributionPoint issuingDistPoint;
CE_AuthorityInfoAccess authorityInfoAccess;
CE_QC_Statements qualifiedCertStatements;
CE_NameConstraints nameConstraints;
CE_PolicyMappings policyMappings;
CE_PolicyConstraints policyConstraints;
CE_InhibitAnyPolicy inhibitAnyPolicy;
CSSM_DATA rawData; // unknown, not decoded
} CE_Data DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
typedef struct __CE_DataAndType {
CE_DataType type;
CE_Data extension;
CSSM_BOOL critical;
} CE_DataAndType DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
#endif /* SEC_OS_OSX */
#if SEC_OS_OSX
#pragma clang diagnostic pop
#endif
#endif /* _CERT_EXTENSIONS_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Headers/SecTrust.h | /*
* Copyright (c) 2002-2021 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
@header SecTrust
The functions and data types in SecTrust implement trust computation
and allow the caller to apply trust decisions to the evaluation.
*/
#ifndef _SECURITY_SECTRUST_H_
#define _SECURITY_SECTRUST_H_
#include <Security/SecBase.h>
#include <CoreFoundation/CoreFoundation.h>
#include <AvailabilityMacros.h>
#include <Availability.h>
__BEGIN_DECLS
CF_ASSUME_NONNULL_BEGIN
CF_IMPLICIT_BRIDGING_ENABLED
/*!
@typedef SecTrustResultType
@abstract Specifies the trust result type.
@discussion SecTrustResultType results have two dimensions. They specify
both whether evaluation succeeded and whether this is because of a user
decision. The commonly expected result is kSecTrustResultUnspecified,
which indicates a positive result that wasn't decided by the user. The
common failure is kSecTrustResultRecoverableTrustFailure, which means a
negative result. kSecTrustResultProceed and kSecTrustResultDeny are the
positive and negative result respectively when decided by the user. User
decisions are persisted through the use of SecTrustCopyExceptions() and
SecTrustSetExceptions(). Finally, kSecTrustResultFatalTrustFailure is a
negative result that must not be circumvented.
@constant kSecTrustResultInvalid Indicates an invalid setting or result.
This result usually means that SecTrustEvaluate has not yet been called.
@constant kSecTrustResultProceed Indicates you may proceed. This value
may be returned by the SecTrustEvaluate function or stored as part of
the user trust settings.
@constant kSecTrustResultConfirm Indicates confirmation with the user
is required before proceeding. Important: this value is no longer returned
or supported by SecTrustEvaluate or the SecTrustSettings API starting in
OS X 10.5; its use is deprecated in OS X 10.9 and later, as well as in iOS.
@constant kSecTrustResultDeny Indicates a user-configured deny; do not
proceed. This value may be returned by the SecTrustEvaluate function
or stored as part of the user trust settings.
@constant kSecTrustResultUnspecified Indicates the evaluation succeeded
and the certificate is implicitly trusted, but user intent was not
explicitly specified. This value may be returned by the SecTrustEvaluate
function or stored as part of the user trust settings.
@constant kSecTrustResultRecoverableTrustFailure Indicates a trust policy
failure which can be overridden by the user. This value may be returned
by the SecTrustEvaluate function but not stored as part of the user
trust settings.
@constant kSecTrustResultFatalTrustFailure Indicates a trust failure
which cannot be overridden by the user. This value may be returned by the
SecTrustEvaluate function but not stored as part of the user trust
settings.
@constant kSecTrustResultOtherError Indicates a failure other than that
of trust evaluation. This value may be returned by the SecTrustEvaluate
function but not stored as part of the user trust settings.
*/
typedef CF_ENUM(uint32_t, SecTrustResultType) {
kSecTrustResultInvalid CF_ENUM_AVAILABLE(10_3, 2_0) = 0,
kSecTrustResultProceed CF_ENUM_AVAILABLE(10_3, 2_0) = 1,
kSecTrustResultConfirm CF_ENUM_DEPRECATED(10_3, 10_9, 2_0, 7_0) = 2,
kSecTrustResultDeny CF_ENUM_AVAILABLE(10_3, 2_0) = 3,
kSecTrustResultUnspecified CF_ENUM_AVAILABLE(10_3, 2_0) = 4,
kSecTrustResultRecoverableTrustFailure CF_ENUM_AVAILABLE(10_3, 2_0) = 5,
kSecTrustResultFatalTrustFailure CF_ENUM_AVAILABLE(10_3, 2_0) = 6,
kSecTrustResultOtherError CF_ENUM_AVAILABLE(10_3, 2_0) = 7
};
/*!
@typedef SecTrustRef
@abstract CFType used for performing X.509 certificate trust evaluations.
*/
typedef struct CF_BRIDGED_TYPE(id) __SecTrust *SecTrustRef;
/*!
@enum Trust Property Constants
@discussion Predefined key constants used to obtain values in a
per-certificate dictionary of trust evaluation results,
as retrieved from a call to SecTrustCopyProperties.
@constant kSecPropertyTypeTitle Specifies a key whose value is a
CFStringRef containing the title (display name) of this certificate.
@constant kSecPropertyTypeError Specifies a key whose value is a
CFStringRef containing the reason for a trust evaluation failure.
*/
extern const CFStringRef kSecPropertyTypeTitle
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_7_0);
extern const CFStringRef kSecPropertyTypeError
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_7_0);
/*!
@enum Trust Result Constants
@discussion Predefined key constants used to obtain values in a
dictionary of trust evaluation results for a certificate chain,
as retrieved from a call to SecTrustCopyResult.
@constant kSecTrustEvaluationDate
This key will be present if a trust evaluation has been performed
and results are available. Its value is a CFDateRef representing
when the evaluation for this trust object took place.
@constant kSecTrustExtendedValidation
This key will be present and have a value of kCFBooleanTrue
if this chain was validated for EV.
@constant kSecTrustOrganizationName
Organization name field of subject of leaf certificate. This
field is meant to be displayed to the user as the validated
name of the company or entity that owns the certificate if the
kSecTrustExtendedValidation key is present.
@constant kSecTrustResultValue
This key will be present if a trust evaluation has been performed.
Its value is a CFNumberRef representing the SecTrustResultType result
for the evaluation.
@constant kSecTrustRevocationChecked
This key will be present iff this chain had its revocation checked.
The value will be a kCFBooleanTrue if revocation checking was
successful and none of the certificates in the chain were revoked.
The value will be kCFBooleanFalse if no current revocation status
could be obtained for one or more certificates in the chain due
to connection problems or timeouts. This is a hint to a client
to retry revocation checking at a later time.
@constant kSecTrustRevocationValidUntilDate
This key will be present iff kSecTrustRevocationChecked has a
value of kCFBooleanTrue. The value will be a CFDateRef representing
the earliest date at which the revocation info for one of the
certificates in this chain might change.
@constant kSecTrustCertificateTransparency
This key will be present and have a value of kCFBooleanTrue
if this chain is CT qualified.
@constant kSecTrustCertificateTransparencyWhiteList
This key will be present and have a value of kCFBooleanTrue
if this chain is EV, but not CT qualified, and is permitted
as an exception to CT policy requirements.
Note: in macOS 10.12 and iOS 10, previously-issued EV certificates
were considered exempt from the CT requirement. As those certificates
expired, exempting them was no longer needed. This key is deprecated
in macOS 10.13 and iOS 11, and is no longer returned in the trust
results dictionary as of those releases.
*/
extern const CFStringRef kSecTrustEvaluationDate
__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
extern const CFStringRef kSecTrustExtendedValidation
__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
extern const CFStringRef kSecTrustOrganizationName
__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
extern const CFStringRef kSecTrustResultValue
__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
extern const CFStringRef kSecTrustRevocationChecked
__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
extern const CFStringRef kSecTrustRevocationValidUntilDate
__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
extern const CFStringRef kSecTrustCertificateTransparency
__OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_9_0);
extern const CFStringRef kSecTrustCertificateTransparencyWhiteList
__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_12, __MAC_10_13, __IPHONE_10_0, __IPHONE_11_0);
#ifdef __BLOCKS__
/*!
@typedef SecTrustCallback
@abstract Delivers the result from an asynchronous trust evaluation.
@param trustRef A reference to the trust object which has been evaluated.
@param trustResult The trust result of the evaluation. Additional status
information can be obtained by calling SecTrustCopyProperties().
*/
typedef void (^SecTrustCallback)(SecTrustRef trustRef, SecTrustResultType trustResult);
#endif /* __BLOCKS__ */
/*!
@function SecTrustGetTypeID
@abstract Returns the type identifier of SecTrust instances.
@result The CFTypeID of SecTrust instances.
*/
CFTypeID SecTrustGetTypeID(void)
__OSX_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_2_0);
/*!
@function SecTrustCreateWithCertificates
@abstract Creates a trust object based on the given certificates and
policies.
@param certificates The group of certificates to verify. This can either
be a CFArrayRef of SecCertificateRef objects or a single SecCertificateRef
@param policies An array of one or more policies. You may pass a
SecPolicyRef to represent a single policy.
@param trust On return, a pointer to the trust management reference.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion If multiple policies are passed in, all policies must verify
for the chain to be considered valid.
*/
OSStatus SecTrustCreateWithCertificates(CFTypeRef certificates,
CFTypeRef __nullable policies, SecTrustRef * __nonnull CF_RETURNS_RETAINED trust)
__OSX_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_2_0);
/*!
@function SecTrustSetPolicies
@abstract Set the policies for which trust should be verified.
@param trust A trust reference.
@param policies An array of one or more policies. You may pass a
SecPolicyRef to represent a single policy.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This function will invalidate the existing trust result,
requiring a fresh evaluation for the newly-set policies.
*/
OSStatus SecTrustSetPolicies(SecTrustRef trust, CFTypeRef policies)
__OSX_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_6_0);
/*!
@function SecTrustCopyPolicies
@abstract Returns an array of policies used for this evaluation.
@param trust A reference to a trust object.
@param policies On return, an array of policies used by this trust.
Call the CFRelease function to release this reference.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecTrustCopyPolicies(SecTrustRef trust, CFArrayRef * __nonnull CF_RETURNS_RETAINED policies)
__OSX_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_7_0);
/*!
@function SecTrustSetNetworkFetchAllowed
@abstract Specifies whether a trust evaluation is permitted to fetch missing
intermediate certificates from the network.
@param trust A trust reference.
@param allowFetch If true, and a certificate's issuer is not present in the
trust reference but its network location is known, the evaluation is permitted
to attempt to download it automatically. Pass false to disable network fetch
for this trust evaluation.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion By default, network fetch of missing certificates is enabled if
the trust evaluation includes the SSL policy, otherwise it is disabled.
*/
OSStatus SecTrustSetNetworkFetchAllowed(SecTrustRef trust,
Boolean allowFetch)
__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
/*!
@function SecTrustGetNetworkFetchAllowed
@abstract Returns whether a trust evaluation is permitted to fetch missing
intermediate certificates from the network.
@param trust A trust reference.
@param allowFetch On return, the boolean pointed to by this parameter is
set to true if the evaluation is permitted to download missing certificates.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion By default, network fetch of missing certificates is enabled if
the trust evaluation includes the SSL policy, otherwise it is disabled.
*/
OSStatus SecTrustGetNetworkFetchAllowed(SecTrustRef trust,
Boolean *allowFetch)
__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
/*!
@function SecTrustSetAnchorCertificates
@abstract Sets the anchor certificates for a given trust.
@param trust A reference to a trust object.
@param anchorCertificates An array of anchor certificates.
Pass NULL to restore the default set of anchor certificates.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion Calling this function without also calling
SecTrustSetAnchorCertificatesOnly() will disable trusting any
anchors other than the ones in anchorCertificates.
*/
OSStatus SecTrustSetAnchorCertificates(SecTrustRef trust,
CFArrayRef __nullable anchorCertificates)
__OSX_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_2_0);
/*!
@function SecTrustSetAnchorCertificatesOnly
@abstract Reenables trusting anchor certificates in addition to those
passed in via the SecTrustSetAnchorCertificates API.
@param trust A reference to a trust object.
@param anchorCertificatesOnly If true, disables trusting any anchors other
than the ones passed in via SecTrustSetAnchorCertificates(). If false,
the built in anchor certificates are also trusted.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecTrustSetAnchorCertificatesOnly(SecTrustRef trust,
Boolean anchorCertificatesOnly)
__OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_2_0);
/*!
@function SecTrustCopyCustomAnchorCertificates
@abstract Returns an array of custom anchor certificates used by a given
trust, as set by a prior call to SecTrustSetAnchorCertificates, or NULL if
no custom anchors have been specified.
@param trust A reference to a trust object.
@param anchors On return, an array of custom anchor certificates (roots)
used by this trust, or NULL if no custom anchors have been specified. Call
the CFRelease function to release this reference.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecTrustCopyCustomAnchorCertificates(SecTrustRef trust,
CFArrayRef * __nonnull CF_RETURNS_RETAINED anchors)
__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_7_0);
/*!
@function SecTrustSetVerifyDate
@abstract Set the date for which the trust should be verified.
@param trust A reference to a trust object.
@param verifyDate The date for which to verify trust.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This function lets you evaluate certificate validity for a
given date (for example, to determine if a signature was valid on the date
it was signed, even if the certificate has since expired.) If this function
is not called, the time at which SecTrustEvaluate() is called is used
implicitly as the verification time.
*/
OSStatus SecTrustSetVerifyDate(SecTrustRef trust, CFDateRef verifyDate)
__OSX_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_2_0);
/*!
@function SecTrustGetVerifyTime
@abstract Returns the verify time.
@param trust A reference to the trust object being verified.
@result A CFAbsoluteTime value representing the time at which certificates
should be checked for validity.
@discussion This function retrieves the verification time for the given
trust reference, as set by a prior call to SecTrustSetVerifyDate(). If the
verification time has not been set, this function returns a value of 0,
indicating that the current date/time is implicitly used for verification.
*/
CFAbsoluteTime SecTrustGetVerifyTime(SecTrustRef trust)
__OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_2_0);
/*!
@function SecTrustEvaluate
@abstract Evaluates a trust reference synchronously.
@param trust A reference to the trust object to evaluate.
@param result A pointer to a result type.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This function will completely evaluate trust before returning,
possibly including network access to fetch intermediate certificates or to
perform revocation checking. Since this function can block during those
operations, you should call it from within a function that is placed on a
dispatch queue, or in a separate thread from your application's main
run loop. Alternatively, you can use the SecTrustEvaluateAsync function.
*/
OSStatus SecTrustEvaluate(SecTrustRef trust, SecTrustResultType *result)
API_DEPRECATED_WITH_REPLACEMENT("SecTrustEvaluateWithError",
macos(10.3, 10.15),
ios(2.0, 13.0),
watchos(1.0, 6.0),
tvos(2.0, 13.0));
#ifdef __BLOCKS__
/*!
@function SecTrustEvaluateAsync
@abstract Evaluates a trust reference asynchronously.
@param trust A reference to the trust object to evaluate.
@param queue A dispatch queue on which the result callback should be
executed. Pass NULL to use the current dispatch queue.
@param result A SecTrustCallback block which will be executed when the
trust evaluation is complete.
@result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecTrustEvaluateAsync(SecTrustRef trust,
dispatch_queue_t __nullable queue, SecTrustCallback result)
API_DEPRECATED_WITH_REPLACEMENT("SecTrustEvaluateAsyncWithError",
macos(10.7, 10.15),
ios(7.0, 13.0),
watchos(1.0, 6.0),
tvos(7.0, 13.0));
#endif
/*!
@function SecTrustEvaluateWithError
@abstract Evaluates a trust reference synchronously.
@param trust A reference to the trust object to evaluate.
@param error A pointer to an error object
@result A boolean value indicating whether the certificate is trusted
@discussion This function will completely evaluate trust before returning,
possibly including network access to fetch intermediate certificates or to
perform revocation checking. Since this function can block during those
operations, you should call it from within a function that is placed on a
dispatch queue, or in a separate thread from your application's main
run loop.
If the certificate is trusted and the result is true, the error will be set to NULL.
If the certificate is not trusted or the evaluation was unable to complete, the result
will be false and the error will be set with a description of the failure.
The error contains a code for the most serious error encountered (if multiple trust
failures occurred). The localized description indicates the certificate with the most
serious problem and the type of error. The underlying error contains a localized
description of each certificate in the chain that had an error and all errors found
with that certificate.
*/
__attribute__((warn_unused_result)) bool
SecTrustEvaluateWithError(SecTrustRef trust, CFErrorRef _Nullable * _Nullable CF_RETURNS_RETAINED error)
API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0));
#ifdef __BLOCKS__
/*!
@typedef SecTrustWithErrorCallback
@abstract Delivers the result from an asynchronous trust evaluation.
@param trustRef A reference to the trust object which has been evaluated.
@param result A boolean value indicating whether the certificate is trusted.
@param error An error if the trust evaluation failed.
*/
typedef void (^SecTrustWithErrorCallback)(SecTrustRef trustRef, bool result, CFErrorRef _Nullable error);
/*!
@function SecTrustEvaluateAsyncWithError
@abstract Evaluates a trust reference asynchronously.
@param trust A reference to the trust object to evaluate.
@param queue A dispatch queue on which the result callback will be executed. Note that this
function MUST be called from that queue.
@param result A SecTrustWithErrorCallback block which will be executed when the trust evaluation
is complete.
The block is guaranteed to be called exactly once when the result code is errSecSuccess, and not
called otherwise. Note that this block may be called synchronously inline if no asynchronous
operations are required.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion If the certificate is trusted, the callback will return a result parameter of true
and the error will be set to NULL.
If the certificate is not trusted or the evaluation was unable to complete, the result parameter
will be false and the error will be set with a description of the failure. The error contains a
code for the most serious error encountered (if multiple trust failures occurred). The localized
description indicates the certificate with the most serious problem and the type of error. The
underlying error contains a localized description of each certificate in the chain that had an
error and all errors found with that certificate.
*/
OSStatus SecTrustEvaluateAsyncWithError(SecTrustRef trust, dispatch_queue_t queue, SecTrustWithErrorCallback result)
API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0));
#endif /* __BLOCKS__ */
/*!
@function SecTrustGetTrustResult
@param trust A reference to a trust object.
@param result A pointer to the result from the most recent call to
SecTrustEvaluate for this trust reference. If SecTrustEvaluate has not been
called or trust parameters have changed, the result is kSecTrustResultInvalid.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This function replaces SecTrustGetResult for the purpose of
obtaining the current evaluation result of a given trust reference.
*/
OSStatus SecTrustGetTrustResult(SecTrustRef trust,
SecTrustResultType *result)
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_7_0);
/*!
@function SecTrustCopyPublicKey
@abstract Return the public key for a leaf certificate after it has
been evaluated.
@param trust A reference to the trust object which has been evaluated.
@result The certificate's public key, or NULL if it the public key could
not be extracted (this can happen if the public key algorithm is not
supported). The caller is responsible for calling CFRelease on the
returned key when it is no longer needed.
*/
__nullable
SecKeyRef SecTrustCopyPublicKey(SecTrustRef trust)
API_DEPRECATED_WITH_REPLACEMENT("SecTrustCopyKey", macos(10.7, 11.0), ios(2.0, 14.0), watchos(1.0, 7.0), tvos(9.0, 14.0));
/*!
@function SecTrustCopyKey
@abstract Return the public key for a leaf certificate after it has
been evaluated.
@param trust A reference to the trust object which has been evaluated.
@result The certificate's public key, or NULL if it the public key could
not be extracted (this can happen if the public key algorithm is not
supported). The caller is responsible for calling CFRelease on the
returned key when it is no longer needed.
@discussion RSA and ECDSA public keys are supported. All other public key algorithms are unsupported.
*/
__nullable
SecKeyRef SecTrustCopyKey(SecTrustRef trust)
API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0));
/*!
@function SecTrustGetCertificateCount
@abstract Returns the number of certificates in an evaluated certificate
chain.
@param trust A reference to a trust object.
@result The number of certificates in the trust chain, including the anchor.
@discussion Important: if the trust reference has not yet been evaluated,
this function will evaluate it first before returning. If speed is critical,
you may want to call SecTrustGetTrustResult first to make sure that a
result other than kSecTrustResultInvalid is present for the trust object.
*/
CFIndex SecTrustGetCertificateCount(SecTrustRef trust)
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_2_0);
/*!
@function SecTrustGetCertificateAtIndex
@abstract Returns a certificate from the trust chain.
@param trust Reference to a trust object.
@param ix The index of the requested certificate. Indices run from 0
(leaf) to the anchor (or last certificate found if no anchor was found).
The leaf cert (index 0) is always present regardless of whether the trust
reference has been evaluated or not.
@result A SecCertificateRef for the requested certificate.
@discussion This API is fundamentally not thread-safe -- other threads using the same
trust object may trigger trust evaluations that release the returned certificate or change the
certificate chain as a thread is iterating through the certificate chain. The replacement function
SecTrustCopyCertificateChain provides thread-safe results.
*/
__nullable
SecCertificateRef SecTrustGetCertificateAtIndex(SecTrustRef trust, CFIndex ix)
API_DEPRECATED_WITH_REPLACEMENT("SecTrustCopyCertificateChain", macos(10.7, 12.0), ios(2.0, 15.0), watchos(1.0, 8.0), tvos(9.0, 15.0));
/*!
@function SecTrustCopyExceptions
@abstract Returns an opaque cookie which will allow future evaluations
of the current certificate to succeed.
@param trust A reference to an evaluated trust object.
@result An opaque cookie which when passed to SecTrustSetExceptions() will
cause a call to SecTrustEvaluate() return kSecTrustResultProceed. This
will happen upon subsequent evaluation of the current certificate unless
some new error starts happening that wasn't being reported when the cookie
was returned from this function (for example, if the certificate expires
then evaluation will start failing again until a new cookie is obtained.)
@discussion Normally this API should only be called once the errors have
been presented to the user and the user decided to trust the current
certificate chain regardless of the errors being presented, for the
current application/server/protocol combination.
*/
CFDataRef SecTrustCopyExceptions(SecTrustRef trust)
__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_4_0);
/*!
@function SecTrustSetExceptions
@abstract Set a trust cookie to be used for evaluating this certificate chain.
@param trust A reference to a trust object.
@param exceptions An exceptions cookie as returned by a call to
SecTrustCopyExceptions() in the past. You may pass NULL to clear any
exceptions which have been previously set on this trust reference.
@result Upon calling SecTrustEvaluate(), any failures that were present at the
time the exceptions object was created are ignored, and instead of returning
kSecTrustResultRecoverableTrustFailure, kSecTrustResultProceed will be returned
(if the certificate for which exceptions was created matches the current leaf
certificate).
@result Returns true if the exceptions cookies was valid and matches the current
leaf certificate, false otherwise. This function will invalidate the existing
trust result, requiring a subsequent evaluation for the newly-set exceptions.
Note that this function returning true doesn't mean the caller can skip calling
SecTrustEvaluate, as there may be new errors since the exceptions cookie was
created (for example, a certificate may have subsequently expired.)
@discussion Clients of this interface will need to establish the context of this
exception to later decide when this exception cookie is to be used.
Examples of this context would be the server we are connecting to, the ssid
of the wireless network for which this cert is needed, the account for which
this cert should be considered valid, and so on.
*/
bool SecTrustSetExceptions(SecTrustRef trust, CFDataRef __nullable exceptions)
__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_4_0);
/*!
@function SecTrustCopyProperties
@abstract Return a property array for this trust evaluation.
@param trust A reference to a trust object. If the trust has not been
evaluated, the returned property array will be empty.
@result A property array. It is the caller's responsibility to CFRelease
the returned array when it is no longer needed.
@discussion On macOS, this function returns an ordered array of CFDictionaryRef
instances for each certificate in the chain. Indices run from 0 (leaf) to
the anchor (or last certificate found if no anchor was found.)
On other platforms, this function returns an unordered array of CFDictionary instances.
See the "Trust Property Constants" section for a list of currently defined keys.
The error information conveyed via this interface is also conveyed via the
returned error of SecTrustEvaluateWithError.
*/
__nullable
CFArrayRef SecTrustCopyProperties(SecTrustRef trust)
API_DEPRECATED_WITH_REPLACEMENT("SecTrustEvaluateWithError", macos(10.7, 12.0), ios(2.0, 15.0), watchos(1.0, 8.0), tvos(9.0, 15.0)) API_UNAVAILABLE(macCatalyst);
/*!
@function SecTrustCopyResult
@abstract Returns a dictionary containing information about the
evaluated certificate chain for use by clients.
@param trust A reference to a trust object.
@result A dictionary with various fields that can be displayed to the user,
or NULL if no additional info is available or the trust has not yet been
validated. The caller is responsible for calling CFRelease on the value
returned when it is no longer needed.
@discussion Returns a dictionary for the overall trust evaluation. See the
"Trust Result Constants" section for a list of currently defined keys.
*/
__nullable
CFDictionaryRef SecTrustCopyResult(SecTrustRef trust)
__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
/*!
@function SecTrustSetOCSPResponse
@abstract Attach OCSPResponse data to a trust object.
@param trust A reference to a trust object.
@param responseData This may be either a CFData object containing a single
DER-encoded OCSPResponse (per RFC 2560), or a CFArray of these.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion Allows the caller to provide OCSPResponse data (which may be
obtained during a TLS/SSL handshake, per RFC 3546) as input to a trust
evaluation. If this data is available, it can obviate the need to contact
an OCSP server for current revocation information.
*/
OSStatus SecTrustSetOCSPResponse(SecTrustRef trust, CFTypeRef __nullable responseData)
__OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
/*!
@function SecTrustSignedCertificateTimestamps
@abstract Attach SignedCertificateTimestamp data to a trust object.
@param trust A reference to a trust object.
@param sctArray is a CFArray of CFData objects each containing a SCT (per RFC 6962).
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion Allows the caller to provide SCT data (which may be
obtained during a TLS/SSL handshake, per RFC 6962) as input to a trust
evaluation.
*/
OSStatus SecTrustSetSignedCertificateTimestamps(SecTrustRef trust, CFArrayRef __nullable sctArray)
API_AVAILABLE(macos(10.14.2), ios(12.1.1), tvos(12.1.1), watchos(5.1.1));
/*!
@function SecTrustCopyCertificateChain
@abstract Returns the certificate trust chain
@param trust Reference to a trust object.
@result A CFArray of the SecCertificateRefs for the resulting certificate chain
*/
_Nullable CF_RETURNS_RETAINED
CFArrayRef SecTrustCopyCertificateChain(SecTrustRef trust)
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), watchos(8.0));
CF_IMPLICIT_BRIDGING_DISABLED
CF_ASSUME_NONNULL_END
/*
* Legacy functions (OS X only)
*/
#if TARGET_OS_OSX
#include <Security/cssmtype.h>
#include <Security/cssmapple.h>
CF_ASSUME_NONNULL_BEGIN
CF_IMPLICIT_BRIDGING_ENABLED
/*!
@typedef SecTrustUserSetting
@abstract Specifies a user-specified trust setting value.
@discussion Deprecated in OS X 10.9. User trust settings are managed by
functions in SecTrustSettings.h (starting with OS X 10.5), and by the
SecTrustCopyExceptions and SecTrustSetExceptions functions (starting with
iOS 4 and OS X 10.9). The latter two functions are recommended for both OS X
and iOS, as they avoid the need to explicitly specify these values.
*/
typedef SecTrustResultType SecTrustUserSetting
__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_9, __IPHONE_NA, __IPHONE_NA);
/*!
@typedef SecTrustOptionFlags
@abstract Options for customizing trust evaluation.
@constant kSecTrustOptionAllowExpired Allow expired certificates.
@constant kSecTrustOptionLeafIsCA Allow CA as leaf certificate.
@constant kSecTrustOptionFetchIssuerFromNet Allow network fetch of CA cert.
@constant kSecTrustOptionAllowExpiredRoot Allow expired roots.
@constant kSecTrustOptionRequireRevPerCert Require positive revocation
check per certificate.
@constant kSecTrustOptionUseTrustSettings Use TrustSettings instead of
anchors.
@constant kSecTrustOptionImplicitAnchors Properly self-signed certs are
treated as anchors implicitly.
*/
typedef CF_OPTIONS(uint32_t, SecTrustOptionFlags) {
kSecTrustOptionAllowExpired = 0x00000001,
kSecTrustOptionLeafIsCA = 0x00000002,
kSecTrustOptionFetchIssuerFromNet = 0x00000004,
kSecTrustOptionAllowExpiredRoot = 0x00000008,
kSecTrustOptionRequireRevPerCert = 0x00000010,
kSecTrustOptionUseTrustSettings = 0x00000020,
kSecTrustOptionImplicitAnchors = 0x00000040
};
/*!
@function SecTrustSetOptions
@abstract Sets optional flags for customizing a trust evaluation.
@param trustRef A trust reference.
@param options Flags to change evaluation behavior for this trust.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This function is not available on iOS. Use SecTrustSetExceptions
and SecTrustCopyExceptions to modify default trust results, and
SecTrustSetNetworkFetchAllowed to specify whether missing CA certificates
can be fetched from the network.
*/
OSStatus SecTrustSetOptions(SecTrustRef trustRef, SecTrustOptionFlags options)
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
/*!
@function SecTrustSetParameters
@abstract Sets the action and action data for a trust object.
@param trustRef The reference to the trust to change.
@param action A trust action.
@param actionData A reference to data associated with this action.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This function is deprecated in OS X 10.7 and later, where it
was replaced by SecTrustSetOptions, and is not available on iOS. Your code
should use SecTrustSetExceptions and SecTrustCopyExceptions to modify default
trust results, and SecTrustSetNetworkFetchAllowed to specify whether missing
CA certificates can be fetched from the network.
*/
OSStatus SecTrustSetParameters(SecTrustRef trustRef,
CSSM_TP_ACTION action, CFDataRef actionData)
__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_7, __IPHONE_NA, __IPHONE_NA);
/*!
@function SecTrustSetKeychains
@abstract Sets the keychains for a given trust object.
@param trust A reference to a trust object.
@param keychainOrArray A reference to an array of keychains to search, a
single keychain, or NULL to use the default keychain search list.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This function is deprecated in macOS 10.13 and later. Beginning in
macOS 10.12, this function no longer affected the behavior of the trust
evaluation: the user's keychain search list and the system
anchors keychain are searched for certificates to complete the chain. To change
the keychains that are searched, callers must use SecKeychainSetSearchList to
change the user's keychain search list.
Note: this function was never applicable to iOS.
*/
OSStatus SecTrustSetKeychains(SecTrustRef trust, CFTypeRef __nullable keychainOrArray)
__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3, __MAC_10_13, __IPHONE_NA, __IPHONE_NA);
/*!
@function SecTrustGetResult
@abstract Returns detailed information on the outcome of an evaluation.
@param trustRef A reference to a trust object.
@param result A pointer to the result from the call to SecTrustEvaluate.
@param certChain On return, a pointer to the certificate chain used to
validate the input certificate. Call the CFRelease function to release
this pointer.
@param statusChain On return, a pointer to the status of the certificate
chain. Do not attempt to free this pointer; it remains valid until the
trust is destroyed or the next call to SecTrustEvaluate.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This function is deprecated in OS X 10.7 and later,
and is not available on iOS.
To get the complete certificate chain, use SecTrustGetCertificateCount and
SecTrustGetCertificateAtIndex. To get detailed status information for each
certificate, use SecTrustCopyProperties. To get the overall trust result
for the evaluation, use SecTrustGetTrustResult.
*/
OSStatus SecTrustGetResult(SecTrustRef trustRef, SecTrustResultType * __nullable result,
CFArrayRef * __nullable CF_RETURNS_RETAINED certChain, CSSM_TP_APPLE_EVIDENCE_INFO * __nullable * __nullable statusChain)
__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_7, __IPHONE_NA, __IPHONE_NA);
/*!
@function SecTrustGetCssmResult
@abstract Gets the CSSM trust result.
@param trust A reference to a trust.
@param result On return, a pointer to the CSSM trust result.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This function is deprecated in OS X 10.7 and later,
and is not available on iOS.
To get detailed status information for each certificate, use
SecTrustCopyProperties. To get the overall trust result for the evaluation,
use SecTrustGetTrustResult.
*/
OSStatus SecTrustGetCssmResult(SecTrustRef trust,
CSSM_TP_VERIFY_CONTEXT_RESULT_PTR __nullable * __nonnull result)
__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_7, __IPHONE_NA, __IPHONE_NA);
/*!
@function SecTrustGetCssmResultCode
@abstract Gets the result code from the most recent call to SecTrustEvaluate
for the specified trust.
@param trust A reference to a trust.
@param resultCode On return, the result code produced by the most recent
evaluation of the given trust (cssmerr.h). The value of resultCode is
undefined if SecTrustEvaluate has not been called.
@result A result code. See "Security Error Codes" (SecBase.h). Returns
errSecTrustNotAvailable if SecTrustEvaluate has not been called for the
specified trust.
@discussion This function is deprecated in OS X 10.7 and later,
and is not available on iOS.
To get detailed status information for each certificate, use
SecTrustCopyProperties. To get the overall trust result for the evaluation,
use SecTrustGetTrustResult.
*/
OSStatus SecTrustGetCssmResultCode(SecTrustRef trust, OSStatus *resultCode)
__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_7, __IPHONE_NA, __IPHONE_NA);
/*!
@function SecTrustGetTPHandle
@abstract Gets the CSSM trust handle
@param trust A reference to a trust.
@param handle On return, a CSSM trust handle.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This function is deprecated in OS X 10.7 and later.
*/
OSStatus SecTrustGetTPHandle(SecTrustRef trust, CSSM_TP_HANDLE *handle)
__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2, __MAC_10_7, __IPHONE_NA, __IPHONE_NA);
/*!
@function SecTrustCopyAnchorCertificates
@abstract Returns an array of default anchor (root) certificates used by
the system.
@param anchors On return, an array containing the system's default anchors
(roots). Call the CFRelease function to release this pointer.
@result A result code. See "Security Error Codes" (SecBase.h).
@discussion This function is not available on iOS, as certificate data
for system-trusted roots is currently unavailable on that platform.
*/
OSStatus SecTrustCopyAnchorCertificates(CFArrayRef * __nonnull CF_RETURNS_RETAINED anchors)
__OSX_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_NA);
CF_IMPLICIT_BRIDGING_DISABLED
CF_ASSUME_NONNULL_END
#endif /* TARGET_OS_MAC && !TARGET_OS_IPHONE */
__END_DECLS
#endif /* !_SECURITY_SECTRUST_H_ */
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/Security.framework/Modules/module.modulemap | framework module Security [extern_c][system] {
umbrella header "Security.h"
export *
module * {
export *
}
explicit module AuthorizationPlugin {
header "AuthorizationPlugin.h"
export *
}
explicit module AuthSession {
header "AuthSession.h"
export *
}
explicit module CodeSigning {
header "CodeSigning.h"
export *
}
explicit module eisl {
header "eisl.h"
export *
}
explicit module SecAsn1Coder {
header "SecAsn1Coder.h"
export *
}
explicit module SecAsn1Templates {
header "SecAsn1Templates.h"
export *
}
explicit module SecKey {
header "SecKey.h"
export *
}
explicit module SecureDownload {
header "SecureDownload.h"
export *
}
explicit module SecRandom {
header "SecRandom.h"
export *
}
explicit module SecureTransport {
header "SecureTransport.h"
export *
}
}
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/CoreData.tbd | --- !tapi-tbd
tbd-version: 4
targets: [ x86_64-macos, x86_64-maccatalyst, x86_64h-macos, x86_64h-maccatalyst,
arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]
uuids:
- target: x86_64-macos
value: 4B66F478-916E-37B8-B488-3274F917B3AC
- target: x86_64-maccatalyst
value: 4B66F478-916E-37B8-B488-3274F917B3AC
- target: x86_64h-macos
value: 6D7CD32F-99C8-3793-9094-E184F64B040B
- target: x86_64h-maccatalyst
value: 6D7CD32F-99C8-3793-9094-E184F64B040B
- target: arm64-macos
value: 00000000-0000-0000-0000-000000000000
- target: arm64-maccatalyst
value: 00000000-0000-0000-0000-000000000000
- target: arm64e-macos
value: 6666F5CA-13EF-368E-B20D-2CEE9EA4D6DA
- target: arm64e-maccatalyst
value: 6666F5CA-13EF-368E-B20D-2CEE9EA4D6DA
install-name: '/System/Library/Frameworks/CoreData.framework/Versions/A/CoreData'
current-version: 1134
exports:
- targets: [ arm64e-macos, x86_64-macos, x86_64h-macos, x86_64-maccatalyst,
x86_64h-maccatalyst, arm64e-maccatalyst, arm64-macos, arm64-maccatalyst ]
symbols: [ _NSAddedPersistentStoresKey, _NSAffectedObjectsErrorKey, _NSAffectedStoresErrorKey,
_NSAutomaticMigrationUseDocumentDestinationOption, _NSBinaryExternalRecordType,
_NSBinaryStoreInsecureDecodingCompatibilityOption, _NSBinaryStoreSecureDecodingClasses,
_NSBinaryStoreType, _NSCKRecordIDAttributeName, _NSCKRecordSystemFieldsAttributeName,
_NSCloudKitMirroringDelegateDidResetSyncNotificationName,
_NSCloudKitMirroringDelegateIgnoredPropertyKey, _NSCloudKitMirroringDelegateResetSyncReasonKey,
_NSCloudKitMirroringDelegateWillResetSyncNotificationName,
_NSCoreDataCoreSpotlightDelegateIndexDidUpdateNotification,
_NSCoreDataCoreSpotlightExporter, _NSCoreDataVersionNumber,
_NSDeletedObjectIDsKey, _NSDeletedObjectsKey, _NSDetailedErrorsKey,
_NSEntityNameInPathKey, _NSEntityRenamingShouldRebaseKey,
_NSErrorMergePolicy, _NSExternalRecordExtensionOption, _NSExternalRecordsDirectoryOption,
_NSExternalRecordsFileFormatOption, _NSFetchRequestLimitSubstitutionKey,
_NSFetchRequestOffsetSubstitutionKey, _NSIgnorePersistentStoreVersioningOption,
_NSInMemoryStoreType, _NSInferMappingModelAutomaticallyOption,
_NSInsertedObjectIDsKey, _NSInsertedObjectsKey, _NSInvalidatedAllObjectsKey,
_NSInvalidatedObjectIDsKey, _NSInvalidatedObjectsKey, _NSManagedObjectContextDidMergeChangesObjectIDsNotification,
_NSManagedObjectContextDidSaveFromPersistentDocumentNotification,
_NSManagedObjectContextDidSaveNotification, _NSManagedObjectContextDidSaveObjectIDsNotification,
_NSManagedObjectContextKey, _NSManagedObjectContextObjectsDidChangeNotification,
_NSManagedObjectContextQueryGenerationKey, _NSManagedObjectContextTransactionAuthorKey,
_NSManagedObjectContextWillSaveFromPersistentDocumentNotification,
_NSManagedObjectContextWillSaveNotification, _NSMergeByPropertyObjectTrumpMergePolicy,
_NSMergeByPropertyStoreTrumpMergePolicy, _NSMigratePersistentStoresAutomaticallyOption,
_NSMigrationDestinationObjectKey, _NSMigrationEntityMappingKey,
_NSMigrationEntityPolicyKey, _NSMigrationManagerKey, _NSMigrationPropertyMappingKey,
_NSMigrationSourceObjectKey, _NSModelPathKey, _NSObjectURIKey,
_NSOverwriteMergePolicy, _NSPersistentCloudKitContainerEncryptedAttributeKey,
_NSPersistentCloudKitContainerEventChangedNotification, _NSPersistentCloudKitContainerEventUserInfoKey,
_NSPersistentHistoryAllowPartialHistoryMigration, _NSPersistentHistoryTokenKey,
_NSPersistentHistoryTombstoneAttributes, _NSPersistentHistoryTrackingEntitiesToExclude,
_NSPersistentHistoryTrackingEntitiesToInclude, _NSPersistentHistoryTrackingExcludeUnmodifiedPropertiesForBatchUpdate,
_NSPersistentHistoryTrackingKey, _NSPersistentHistoryUseContextObjectsForDeletes,
_NSPersistentStoreConnectionPoolMaxSizeKey, _NSPersistentStoreCoordinatorResourceBundlesForMigration,
_NSPersistentStoreCoordinatorStoresDidChangeNotification,
_NSPersistentStoreCoordinatorStoresWillChangeNotification,
_NSPersistentStoreCoordinatorWillRemoveStoreNotification,
_NSPersistentStoreDeferredLightweightMigrationOptionKey, _NSPersistentStoreDidImportUbiquitousContentChangesNotification,
_NSPersistentStoreFileProtectionKey, _NSPersistentStoreForceDestroyOption,
_NSPersistentStoreForceLightweightMigrationOption, _NSPersistentStoreMirroringDelegateOptionKey,
_NSPersistentStoreMirroringOptionsKey, _NSPersistentStoreOSCompatibility,
_NSPersistentStoreOrderKeyUpdateNotification, _NSPersistentStoreRebuildFromUbiquitousContentOption,
_NSPersistentStoreRemoteChangeNotification, _NSPersistentStoreRemoteChangeNotificationOptionKey,
_NSPersistentStoreRemoteChangeNotificationPostOptionKey, _NSPersistentStoreRemoveUbiquitousMetadataOption,
_NSPersistentStoreSaveConflictsErrorKey, _NSPersistentStoreServiceConfigurationOptionKey,
_NSPersistentStoreTimeoutOption, _NSPersistentStoreTrackIndexUseOptionKey,
_NSPersistentStoreTypeKey, _NSPersistentStoreURLKey, _NSPersistentStoreUbiquitousContainerIdentifierKey,
_NSPersistentStoreUbiquitousContentNameKey, _NSPersistentStoreUbiquitousContentURLKey,
_NSPersistentStoreUbiquitousPeerTokenOption, _NSPersistentStoreUbiquitousTransitionTypeKey,
_NSPersistentStoreUnlinkDestroyOption, _NSReadOnlyPersistentStoreOption,
_NSRefreshedObjectIDsKey, _NSRefreshedObjectsKey, _NSRelationshipDescriptionOrderKeyIndexOption,
_NSRemotePersistentStoreDidChangeNotification, _NSRemovedPersistentStoresKey,
_NSRollbackMergePolicy, _NSSQLiteAnalyzeOption, _NSSQLiteErrorDomain,
_NSSQLiteManualVacuumOption, _NSSQLitePersistWALOption, _NSSQLitePragmasOption,
_NSSQLiteSEEKeychainItemOption, _NSSQLiteStoreType, _NSStoreModelVersionHashesKey,
_NSStoreModelVersionIdentifiersKey, _NSStorePathKey, _NSStoreTypeKey,
_NSStoreUUIDInPathKey, _NSStoreUUIDKey, _NSUUIDChangedPersistentStoresKey,
_NSUpdatedObjectIDsKey, _NSUpdatedObjectsKey, _NSValidateXMLStoreOption,
_NSValidationKeyErrorKey, _NSValidationObjectErrorKey, _NSValidationPredicateErrorKey,
_NSValidationValueErrorKey, _NSXMLExternalRecordType, _NSXMLStoreType,
_NSXPCStoreAnonymousListenerKey, _NSXPCStoreDaemonizeKey,
_NSXPCStoreEntitlementNamesKey, _NSXPCStorePostUpdateNotificationsKey,
_NSXPCStoreServerEndpointFactoryKey, _NSXPCStoreServiceNameKey,
_NSXPCStoreSkipModelCheckKey, _NSXPCStoreSkipRetryWaitKey,
_NSXPCStoreType, __NSBackgroundThreadConfinementConcurrencyType,
__NSCoreDataLog, __NSManagedObjectContextObjectsDidChangePrivateNotification,
__NSPersistentStoreCoordinatorStoresDidChangePrivateNotification,
__NSTriggerModifiedObjectIDsKey, __NSTriggerModifiedObjectsKey ]
objc-classes: [ NSAsynchronousFetchRequest, NSAsynchronousFetchResult, NSAtomicStore,
NSAtomicStoreCacheNode, NSAttributeDescription, NSBatchDeleteRequest,
NSBatchDeleteResult, NSBatchInsertRequest, NSBatchInsertResult,
NSBatchUpdateRequest, NSBatchUpdateResult, NSCachingFetchRequest,
NSCloudKitMirroringDelegate, NSCloudKitMirroringDelegateOptions,
NSCloudKitMirroringDelegateSerializationRequest, NSCloudKitMirroringDelegateSerializationRequestResult,
NSCloudKitMirroringExportProgressRequest, NSCloudKitMirroringExportProgressResult,
NSCloudKitMirroringExportRequest, NSCloudKitMirroringFetchRecordsRequest,
NSCloudKitMirroringFetchRecordsResult, NSCloudKitMirroringImportRequest,
NSCloudKitMirroringInitializeSchemaRequest, NSCloudKitMirroringRequest,
NSCloudKitMirroringRequestOptions, NSCloudKitMirroringResetMetadataRequest,
NSCloudKitMirroringResetZoneRequest, NSCloudKitMirroringResult,
NSConstraintConflict, NSCoreDataCoreSpotlightDelegate, NSDerivedAttributeDescription,
NSEntityDescription, NSEntityMapping, NSEntityMigrationPolicy,
NSExpressionDescription, NSFetchIndexDescription, NSFetchIndexElementDescription,
NSFetchRequest, NSFetchRequestExpression, NSFetchedPropertyDescription,
NSFetchedResultsController, NSIncrementalStore, NSIncrementalStoreNode,
NSKnownKeysDictionary, NSKnownKeysMappingStrategy, NSManagedImmutableObject,
NSManagedObject, NSManagedObjectContext, NSManagedObjectID,
NSManagedObjectModel, NSMappingModel, NSMergeConflict, NSMergePolicy,
NSMigrationManager, NSPersistentCloudKitContainer, NSPersistentCloudKitContainerEvent,
NSPersistentCloudKitContainerEventRequest, NSPersistentCloudKitContainerEventResult,
NSPersistentCloudKitContainerOptions, NSPersistentContainer,
NSPersistentHistoryChange, NSPersistentHistoryChangeRequest,
NSPersistentHistoryResult, NSPersistentHistoryToken, NSPersistentHistoryTransaction,
NSPersistentStore, NSPersistentStoreAsynchronousResult, NSPersistentStoreCoordinator,
NSPersistentStoreDescription, NSPersistentStoreRequest, NSPersistentStoreResult,
NSPropertyDescription, NSPropertyMapping, NSQueryGenerationToken,
NSRelationshipDescription, NSSQLiteIndexStatistics, NSSQLiteIndexStatisticsRequest,
NSSQLiteIndexStatisticsResult, NSSaveChangesRequest, NSXPCStore,
NSXPCStoreConnectionInfo, NSXPCStoreServer, NSXPCStoreServerConnectionContext,
NSXPCStoreServerRequestHandlingPolicy, _NSCoreDataInternal,
_NSPersistenceUtilities ]
...
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSBatchDeleteRequest.h | /*
NSBatchDeleteRequest.h
Core Data
Copyright (c) 2015-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <CoreData/NSPersistentStoreRequest.h>
#import <CoreData/NSPersistentStoreResult.h>
@class NSFetchRequest;
@class NSManagedObjectID;
NS_ASSUME_NONNULL_BEGIN
// Used to request that Core Data do a batch deletion of objects without faulting in
// objects to be deleted.
// May not be supported by all store types.
// WARNING:
// It is up to the developer creating the request to ensure that changes made by the request to
// the underlying store do not violate any validation rules specified in the model beyond basic
// delete rules (for example, minimum relationship counts).
API_AVAILABLE(macosx(10.11),ios(9.0))
@interface NSBatchDeleteRequest : NSPersistentStoreRequest {
}
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithFetchRequest:(NSFetchRequest *)fetch NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithObjectIDs:(NSArray<NSManagedObjectID *> *)objects;
// The type of result that should be returned from this request. Defaults to NSBatchDeleteResultTypeStatusOnly
@property NSBatchDeleteRequestResultType resultType;
@property (readonly, copy) NSFetchRequest *fetchRequest;
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentStoreRequest.h | /*
NSPersistentStoreRequest.h
Core Data
Copyright (c) 2004-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
NS_ASSUME_NONNULL_BEGIN
@class NSPersistentStore;
typedef NS_ENUM(NSUInteger, NSPersistentStoreRequestType) {
NSFetchRequestType = 1,
NSSaveRequestType,
NSBatchInsertRequestType API_AVAILABLE(macosx(10.15),ios(13.0),tvos(13.0),watchos(6.0)) = 5,
NSBatchUpdateRequestType API_AVAILABLE(macosx(10.10), ios(8.0)) = 6,
NSBatchDeleteRequestType API_AVAILABLE(macosx(10.11), ios(9.0)) = 7
};
API_AVAILABLE(macosx(10.7),ios(5.0))
@interface NSPersistentStoreRequest : NSObject <NSCopying> {
}
// Stores this request should be sent to.
@property (nullable, nonatomic, strong) NSArray<NSPersistentStore *> *affectedStores;
// The type of the request.
@property (readonly) NSPersistentStoreRequestType requestType;
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSEntityMapping.h | /*
NSEntityMapping.h
Core Data
Copyright (c) 2004-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSExpression.h>
#import <Foundation/NSData.h>
NS_ASSUME_NONNULL_BEGIN
@class NSEntityDescription;
@class NSPropertyMapping;
/* mapping types */
typedef NS_ENUM(NSUInteger, NSEntityMappingType) {
NSUndefinedEntityMappingType = 0x00,
NSCustomEntityMappingType = 0x01, /* developer handles destination instance creation */
NSAddEntityMappingType = 0x02, /* new entity in destination */
NSRemoveEntityMappingType = 0x03, /* source instances aren't mapped to destination */
NSCopyEntityMappingType = 0x04, /* migrate instances as-is */
NSTransformEntityMappingType = 0x05, /* entity exists in source and destination and is mapped */
};
API_AVAILABLE(macosx(10.5),ios(3.0))
@interface NSEntityMapping : NSObject {
}
/* Returns/sets the name of the mapping. The name is used only as a means of distinguishing mappings in a model. If not specified, defaults to the string composed by the source entity name followed by the destination entity name (ex. SourceName->DestinationName)
*/
@property (null_resettable, copy) NSString *name;
/* Returns/sets the mapping type. (If a custom entity mapping type is utilized, the developer must specify a migrationPolicyClassName as well.)
*/
@property () NSEntityMappingType mappingType;
/* Returns/sets the source entity name for the mapping. (Mappings are not directly bound to NSEntityDescriptions; developers can use the sourceEntityForEntityMapping: API on the NSMigrationManager to retrieve the entity description for this name.)
*/
@property (nullable, copy) NSString *sourceEntityName;
/* Returns/sets the version hash for the source entity for the mapping. VersionHashes are calculated by the Core Data framework (see NSEntityDescrition's versionHash method). The sourceEntityVersionHash must equal the version hash of the source entity represented by the mapping.
*/
@property (nullable, copy) NSData *sourceEntityVersionHash;
/* Returns/sets the destination entity name for the mapping. (Mappings are not directly bound to NSEntityDescriptions; developers can use the destinationEntityForEntityMapping: API on the NSMigrationManager to retrieve the entity description for this name.)
*/
@property (nullable, copy) NSString *destinationEntityName;
/* Returns/sets the version hash for the destination entity for the mapping. VersionHashes are calculated by the Core Data framework (see NSEntityDescrition's versionHash method). The destinationEntityVersionHash must equal the version hash of the destination entity represented by the mapping.
*/
@property (nullable, copy) NSData *destinationEntityVersionHash;
/* Returns/sets the array of attribute mappings for the entity mapping. The order of mappings in this collection dictates the order in which the mappings will be processed during a migration.
*/
@property (nullable, strong) NSArray<NSPropertyMapping *> *attributeMappings;
/* Returns/sets the array of relationship mappings for the entity mapping. The order of mappings in this collection dictates the order in which the mappings will be processed during a migration.
*/
@property (nullable, strong) NSArray<NSPropertyMapping *> *relationshipMappings;
/* Returns/sets the source expression for the mapping. The source expression is used to obtain the collection of managed object instances to process through the mapping. The expression can be a fetch request expression, or any other expression which evaluates to a collection.
*/
@property (nullable, strong) NSExpression *sourceExpression;
/* Returns/sets the user info dictionary for the mapping
*/
@property (nullable, nonatomic, strong) NSDictionary *userInfo;
/* Returns/sets the class name of the migration policy for the class. If not specified, the default migration class name is NSEntityMigrationPolicy, though developers can specify a subclass for specific behavior.
*/
@property (nullable, copy) NSString *entityMigrationPolicyClassName;
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentContainer.h | /*
NSPersistentContainer.h
Core Data
Copyright (c) 2016-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSError.h>
#import <CoreData/NSManagedObjectContext.h>
#import <CoreData/NSPersistentStoreCoordinator.h>
#import <CoreData/NSManagedObjectModel.h>
#import <CoreData/NSPersistentStoreDescription.h>
@class NSURL;
NS_ASSUME_NONNULL_BEGIN
// An instance of NSPersistentContainer includes all objects needed to represent a functioning Core Data stack, and provides convenience methods and properties for common patterns.
API_AVAILABLE(macosx(10.12),ios(10.0),tvos(10.0),watchos(3.0))
@interface NSPersistentContainer : NSObject {
}
+ (instancetype)persistentContainerWithName:(NSString *)name;
+ (instancetype)persistentContainerWithName:(NSString *)name managedObjectModel:(NSManagedObjectModel *)model;
+ (NSURL *)defaultDirectoryURL;
@property (copy, readonly) NSString *name;
@property (strong, readonly) NSManagedObjectContext *viewContext;
@property (strong, readonly) NSManagedObjectModel *managedObjectModel;
@property (strong, readonly) NSPersistentStoreCoordinator *persistentStoreCoordinator;
@property (copy) NSArray<NSPersistentStoreDescription *> *persistentStoreDescriptions;
// Creates a container using the model named `name` in the main bundle
- (instancetype)initWithName:(NSString *)name;
- (instancetype)initWithName:(NSString *)name managedObjectModel:(NSManagedObjectModel *)model NS_DESIGNATED_INITIALIZER;
// Load stores from the storeDescriptions property that have not already been successfully added to the container. The completion handler is called once for each store that succeeds or fails.
- (void)loadPersistentStoresWithCompletionHandler:(void (^)(NSPersistentStoreDescription *, NSError * _Nullable))block NS_SWIFT_DISABLE_ASYNC;
- (NSManagedObjectContext *)newBackgroundContext NS_RETURNS_RETAINED;
- (void)performBackgroundTask:(void (^)(NSManagedObjectContext *))block;
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentCloudKitContainer_Sharing.h | /*
NSPersistentCloudKitContainer_Sharing.h
Core Data
Copyright (c) 2021-2021, Apple Inc.
All rights reserved.
*/
#import <CoreData/NSPersistentCloudKitContainer.h>
NS_ASSUME_NONNULL_BEGIN
@class CKContainer;
@class CKRecordZoneID;
@class CKShare;
@class CKRecordZone;
@class CKShareMetadata;
@class CKShareParticipant;
@class CKUserIdentityLookupInfo;
@interface NSPersistentCloudKitContainer (Sharing)
#pragma mark - Sharing
/*
Accept a sharing invitation with the given share metadata.
The provided persistent store must be configured to use the Shared database scope. If provided the completion block will be invoked
once all operations required to accept the share invitations have finished with the resulting CKShareMetadata objects or with an
error if one occurs.
*/
- (void)acceptShareInvitationsFromMetadata:(NSArray<CKShareMetadata *> *)metadata
intoPersistentStore:(NSPersistentStore *)persistentStore
completion:(void(^_Nullable)(NSArray<CKShareMetadata *> * _Nullable acceptedShareMetadatas, NSError * _Nullable acceptOperationError))completion NS_SWIFT_NAME(acceptShareInvitations(from:into:completion:)) API_AVAILABLE(macosx(12.0),ios(15.0),tvos(15.0),watchos(8.0));
/*
Purges a zone from the CKDatabase associated with the given persistent store (or all active CKDatabases in the persistent cloud container's stores).
If provided the completion block will be invoked once per store with the result of the purge operation.
*/
- (void)purgeObjectsAndRecordsInZoneWithID:(CKRecordZoneID *)zoneID
inPersistentStore:(nullable NSPersistentStore *)persistentStore
completion:(void(^_Nullable)(CKRecordZoneID * _Nullable purgedZoneID, NSError * _Nullable purgeError))completion API_AVAILABLE(macosx(12.0),ios(15.0),tvos(15.0),watchos(8.0));
/*
Saves the given CKShare object to the persistent cloud container's metadata in the provided persistent store.
If provided the completion block will be invoked once the share has been saved to the corresponding CKDatabase with the
result of the operation.
*/
- (void)persistUpdatedShare:(CKShare *)share
inPersistentStore:(NSPersistentStore *)persistentStore
completion:(void(^ _Nullable)(CKShare * _Nullable persistedShare, NSError * _Nullable persistedShareError))completion API_AVAILABLE(macosx(12.0),ios(15.0),tvos(15.0),watchos(8.0));
/*
Fetches a set of CKShareParticipant objects from the CKDatabase associated with the given persistent store.
The completion block will be invoked with the result of the CKFetchShareParticipantsOperation and the retrieved participants (if any).
*/
- (void)fetchParticipantsMatchingLookupInfos:(NSArray<CKUserIdentityLookupInfo *> *)lookupInfos
intoPersistentStore:(NSPersistentStore *)persistentStore
completion:(void(^)(NSArray<CKShareParticipant *> * _Nullable fetchedParticipants, NSError * _Nullable fetchError))completion API_AVAILABLE(macosx(12.0),ios(15.0),tvos(15.0),watchos(8.0));
/*
Returns the associated CKShare object for a given managed object. If the object's backing CKRecord resides in a CKRecordZone that
is currently shared a CKShare will be returned.
If the object is not associated with a shared record zone, or the object has not yet been exported to CloudKit (and it's zone is not known),
it will not have an entry in the resulting dictionary.
*/
- (nullable NSDictionary<NSManagedObjectID *, CKShare *> *)fetchSharesMatchingObjectIDs:(NSArray<NSManagedObjectID *> *)objectIDs
error:(NSError **)error API_AVAILABLE(macosx(12.0),ios(15.0),tvos(15.0),watchos(8.0));
/*
Fetches all known CKShare records in the given persistent store (or all persistent stores in the persistent cloud container if none is set).
This method does not to any network work to attempt to discover additional zones or shares in the CKDatabase that is associated with the persistent store.
*/
- (nullable NSArray<CKShare *> *)fetchSharesInPersistentStore:(nullable NSPersistentStore *)persistentStore
error:(NSError **)error API_AVAILABLE(macosx(12.0),ios(15.0),tvos(15.0),watchos(8.0));
/*
Use this method to share a set of managed objects to either a new CKShare or an existing one if specified as the 'share' parameter.
- managedObjects - the set of objects to be shared. A deep traversal will be performed among the objects and any related objects will also be shared.
- share - The existing share in which to share the objects, or nil if a new one should be created for them
- completion - A completion block when the share is created and the objects are assigned to it (not necessarily when the objects have been exported to the share)
This method will fail if:
1. Any of the objects in 'managedObjects' or those discovered by traversal are already shared
2. Any of the objects in 'managedObjects' are from persistent stores which do not support sharing (for example those using CKDatabaseScopePublic)
3. The current device conditions do not support sharing, for example if there is no CloudKit account on the device, or if NSPersistentCloudKitContainer has failed to initialize.
The completion block is meant to be used directly with UICloudSharingController's preparation block completion handler.
*/
- (void)shareManagedObjects:(NSArray<NSManagedObject *> *)managedObjects
toShare:(nullable CKShare *)share
completion:(void(^)(NSSet<NSManagedObjectID *> * _Nullable sharedObjectIDs, CKShare * _Nullable share, CKContainer * _Nullable cloudKitContainer, NSError * _Nullable sharingError))completion API_AVAILABLE(macosx(12.0),ios(15.0),tvos(15.0),watchos(8.0));
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSPropertyMapping.h | /*
NSPropertyMapping.h
Core Data
Copyright (c) 2004-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
NS_ASSUME_NONNULL_BEGIN
@class NSExpression;
API_AVAILABLE(macosx(10.5),ios(3.0))
@interface NSPropertyMapping : NSObject {
}
/* Returns/sets the name of the property in the destination entity for the mapping.
*/
@property (nullable, copy) NSString *name;
/* Returns/sets the value expression for the property mapping. The expression is used to create the value for the destination property.
*/
@property (nullable, strong) NSExpression *valueExpression;
/* Returns/sets the user info for the property mapping.
*/
@property (nullable, strong) NSDictionary *userInfo;
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentHistoryChangeRequest.h | /*
NSPersistentHistoryChangeRequest.h
Core Data
Copyright (c) 2014-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSDate.h>
#import <CoreData/NSPersistentStoreRequest.h>
#import <CoreData/NSPersistentStoreResult.h>
NS_ASSUME_NONNULL_BEGIN
@class NSPersistentHistoryTransaction;
@class NSPersistentHistoryToken;
API_AVAILABLE(macosx(10.13),ios(11.0),tvos(11.0),watchos(4.0))
@interface NSPersistentHistoryChangeRequest : NSPersistentStoreRequest {
}
+ (nonnull instancetype)fetchHistoryAfterDate:(NSDate *)date;
+ (nonnull instancetype)fetchHistoryAfterToken:(nullable NSPersistentHistoryToken *)token;
+ (nonnull instancetype)fetchHistoryAfterTransaction:(nullable NSPersistentHistoryTransaction *)transaction;
+ (nonnull instancetype)fetchHistoryWithFetchRequest:(NSFetchRequest *)fetchRequest API_AVAILABLE(macosx(10.15),ios(13.0),tvos(13.0),watchos(6.0));
+ (nonnull instancetype)deleteHistoryBeforeDate:(NSDate *)date;
+ (nonnull instancetype)deleteHistoryBeforeToken:(nullable NSPersistentHistoryToken *)token;
+ (nonnull instancetype)deleteHistoryBeforeTransaction:(nullable NSPersistentHistoryTransaction *)transaction;
// The type of result that should be returned from this request. Defaults to NSPersistentHistoryResultTypeTransactionsAndChanges
@property NSPersistentHistoryResultType resultType;
@property (nullable,readonly,strong) NSPersistentHistoryToken *token;
@property (nullable,nonatomic,strong) NSFetchRequest *fetchRequest API_AVAILABLE(macosx(10.15),ios(13.0),tvos(13.0),watchos(6.0));
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentHistoryTransaction.h | /*
NSPersistentHistoryTransaction.h
Core Data
Copyright (c) 2016-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSDate.h>
NS_ASSUME_NONNULL_BEGIN
@class NSNotification;
@class NSPersistentHistoryToken;
@class NSPersistentHistoryChange;
@class NSEntityDescription;
@class NSFetchRequest;
@class NSManagedObjectContext;
API_AVAILABLE(macosx(10.13),ios(11.0),tvos(11.0),watchos(4.0))
@interface NSPersistentHistoryTransaction : NSObject <NSCopying>
+ (nullable NSEntityDescription *)entityDescriptionWithContext:(NSManagedObjectContext *)context API_AVAILABLE(macosx(10.15),ios(13.0),tvos(13.0),watchos(6.0));
@property (class,nullable,readonly) NSEntityDescription *entityDescription API_AVAILABLE(macosx(10.15),ios(13.0),tvos(13.0),watchos(6.0));
@property (class,nullable,readonly) NSFetchRequest *fetchRequest API_AVAILABLE(macosx(10.15),ios(13.0),tvos(13.0),watchos(6.0));
@property (readonly,copy) NSDate *timestamp;
@property (nullable,readonly,copy) NSArray<NSPersistentHistoryChange *>*changes;
@property (readonly) int64_t transactionNumber;
@property (readonly,copy) NSString *storeID;
@property (readonly,copy) NSString *bundleID;
@property (readonly,copy) NSString *processID;
@property (nullable,readonly,copy) NSString *contextName;
@property (nullable,readonly,copy) NSString *author;
@property (readonly,strong) NSPersistentHistoryToken *token;
// Get a notification that can be consumed by a NSManagedObjectContext
- (NSNotification *) objectIDNotification;
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSRelationshipDescription.h | /*
NSRelationshipDescription.h
Core Data
Copyright (c) 2004-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <CoreData/NSPropertyDescription.h>
NS_ASSUME_NONNULL_BEGIN
@class NSEntityDescription;
typedef NS_ENUM(NSUInteger, NSDeleteRule) {
NSNoActionDeleteRule,
NSNullifyDeleteRule,
NSCascadeDeleteRule,
NSDenyDeleteRule
} ;
// Relationships represent references to other objects. They usually come in pairs, where the reference back is called the "inverse".
API_AVAILABLE(macosx(10.4),ios(3.0))
@interface NSRelationshipDescription : NSPropertyDescription {
}
@property (nullable, nonatomic, assign) NSEntityDescription *destinationEntity;
@property (nullable, nonatomic, assign) NSRelationshipDescription *inverseRelationship;
// Min and max count indicate the number of objects referenced (1/1 for a to-one relationship, 0 for the max count means undefined) - note that the counts are only enforced if the relationship value is not nil/"empty" (so as long as the relationship value is optional, there might be zero objects in the relationship, which might be less than the min count)
@property () NSUInteger maxCount;
@property () NSUInteger minCount;
@property () NSDeleteRule deleteRule;
@property (getter=isToMany, readonly) BOOL toMany; // convenience method to test whether the relationship is to-one or to-many
// Returns the version hash for the relationship. This value includes the versionHash information from the NSPropertyDescription superclass, the name of the destination entity and the inverse relationship, and the min and max count.
@property (readonly, copy) NSData *versionHash API_AVAILABLE(macosx(10.5),ios(3.0));
@property (getter=isOrdered) BOOL ordered API_AVAILABLE(macosx(10.7),ios(5.0));
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSFetchIndexDescription.h | /*
NSFetchIndexDescription.h
Core Data
Copyright (c) 2017-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSPredicate.h>
#import <Foundation/NSString.h>
@class NSEntityDescription;
@class NSFetchIndexElementDescription;
NS_ASSUME_NONNULL_BEGIN
API_AVAILABLE(macosx(10.13),ios(11.0),tvos(11.0),watchos(4.0))
@interface NSFetchIndexDescription : NSObject <NSCoding,NSCopying> {
}
- (instancetype)initWithName:(NSString*)name elements:(nullable NSArray <NSFetchIndexElementDescription *>*)elements;
@property (copy) NSString *name;
/* Will throw if the new value is invalid (ie includes both rtree and non-rtree elements). */
@property (copy) NSArray <NSFetchIndexElementDescription *>*elements;
@property (readonly, nonatomic, nullable, assign) NSEntityDescription *entity;
/* If the index should be a partial index, specifies the predicate selecting rows for indexing */
@property (nullable, copy) NSPredicate *partialIndexPredicate;
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentCloudKitContainerOptions.h | /*
NSPersistentCloudKitContainerOptions.h
Core Data
Copyright (c) 2018-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#ifndef __swift__
#import <CloudKit/CKDatabase.h>
#endif
NS_ASSUME_NONNULL_BEGIN
/**
NSPersistentCloudKitContainerOptions provides customization of how NSPersistentCloudKitContainer aligns a given instance of NSPersistentStoreDescription with a CloudKit database.
*/
API_AVAILABLE(macosx(10.15),ios(13.0),tvos(13.0),watchos(6.0))
@interface NSPersistentCloudKitContainerOptions : NSObject
/**
The container identifier of the CKContainer to use with a given instance of NSPersistentStoreDescription
*/
@property(readonly, copy) NSString *containerIdentifier;
/*
databaseScope allows clients to specify the database scope they wish the NSPersistentCloudKitContainer to use
for a given store.
Default Value: CKDatabaseScopePrivate
Currently only CKDatabaseScopePrivate and CKDatabaseScopePublic are supported.
*/
#ifndef __swift__
@property(nonatomic) CKDatabaseScope databaseScope API_AVAILABLE(macosx(11.0),ios(14.0),tvos(14.0),watchos(7.0));
#else
@property(nonatomic) NSInteger databaseScope API_AVAILABLE(macosx(11.0),ios(14.0),tvos(14.0),watchos(7.0)) NS_REFINED_FOR_SWIFT;
#endif
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithContainerIdentifier:(NSString *)containerIdentifier NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSBatchInsertRequest.h | /*
NSBatchInsertRequest.h
Core Data
Copyright (c) 2004-2021, Apple Inc.
All rights reserved.
*/
#import <CoreData/NSPersistentStoreRequest.h>
#import <CoreData/NSPersistentStoreResult.h>
@class NSManagedObject;
@class NSEntityDescription;
NS_ASSUME_NONNULL_BEGIN
API_AVAILABLE(macosx(10.15),ios(13.0),tvos(13.0),watchos(6.0))
@interface NSBatchInsertRequest : NSPersistentStoreRequest {
}
@property (copy, readonly) NSString *entityName;
@property (strong, nullable, readonly) NSEntityDescription *entity;
@property (copy, nullable) NSArray <NSDictionary<NSString *, id> *> *objectsToInsert;
@property (copy, nullable) BOOL (^dictionaryHandler)(NSMutableDictionary<NSString *, id> *obj) API_AVAILABLE(macosx(11.0),ios(14.0),tvos(14.0),watchos(7.0));
@property (copy, nullable) BOOL (^managedObjectHandler)(NSManagedObject *obj) API_AVAILABLE(macosx(11.0),ios(14.0),tvos(14.0),watchos(7.0));
// The type of result that should be returned from this request. Defaults to NSBatchInsertRequestResultTypeStatusOnly
@property NSBatchInsertRequestResultType resultType;
+ (instancetype)batchInsertRequestWithEntityName:(NSString *)entityName objects:(NSArray <NSDictionary<NSString *, id> *>*)dictionaries;
+ (instancetype)batchInsertRequestWithEntityName:(NSString *)entityName dictionaryHandler:(BOOL (^)(NSMutableDictionary<NSString *, id> *obj))handler API_AVAILABLE(macosx(11.0),ios(14.0),tvos(14.0),watchos(7.0));
+ (instancetype)batchInsertRequestWithEntityName:(NSString *)entityName managedObjectHandler:(BOOL (^)(NSManagedObject *obj))handler API_AVAILABLE(macosx(11.0),ios(14.0),tvos(14.0),watchos(7.0));
- (instancetype)init API_DEPRECATED_WITH_REPLACEMENT("initWithEntityName", macosx(10.15,11.0),ios(13.0,14.0),tvos(13.0,14.0),watchos(6.0,7.0));
- (instancetype)initWithEntityName:(NSString *)entityName objects:(NSArray <NSDictionary<NSString *, id> *>*)dictionaries NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithEntity:(NSEntityDescription *)entity objects:(NSArray <NSDictionary<NSString *, id> *>*)dictionaries NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithEntity:(NSEntityDescription *)entity dictionaryHandler:(BOOL (^)(NSMutableDictionary<NSString *, id> *obj))handler API_AVAILABLE(macosx(11.0),ios(14.0),tvos(14.0),watchos(7.0));
- (instancetype)initWithEntity:(NSEntityDescription *)entity managedObjectHandler:(BOOL (^)(NSManagedObject *obj))handler API_AVAILABLE(macosx(11.0),ios(14.0),tvos(14.0),watchos(7.0));
- (instancetype)initWithEntityName:(NSString *)entityName dictionaryHandler:(BOOL (^)(NSMutableDictionary<NSString *, id> *obj))handler API_AVAILABLE(macosx(11.0),ios(14.0),tvos(14.0),watchos(7.0));
- (instancetype)initWithEntityName:(NSString *)entityName managedObjectHandler:(BOOL (^)(NSManagedObject *obj))handler API_AVAILABLE(macosx(11.0),ios(14.0),tvos(14.0),watchos(7.0));
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSMappingModel.h | /*
NSMappingModel.h
Core Data
Copyright (c) 2004-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
NS_ASSUME_NONNULL_BEGIN
@class NSBundle;
@class NSError;
@class NSManagedObjectModel;
@class NSEntityMapping;
API_AVAILABLE(macosx(10.5),ios(3.0))
@interface NSMappingModel: NSObject {
}
/* Returns the mapping model to translate data from the source to the destination model. This method is a companion to the mergedModelFromBundles: methods; in this case, the framework uses the version information from the models to locate the appropriate mapping model in the available bundles. If the mapping model for the models cannot be found, this method returns nil.
*/
+ (nullable NSMappingModel *)mappingModelFromBundles:(nullable NSArray<NSBundle *> *)bundles forSourceModel:(nullable NSManagedObjectModel *)sourceModel destinationModel:(nullable NSManagedObjectModel *)destinationModel;
/* Returns a newly created mapping model to translate data from the source to the destination model, if possible. The differences between the source and destination model are compared and if all changes are simple enough to be able to reasonably infer a data migration mapping model, such a model is created and returned. If the mapping model can not be created, nil is returned and an error code is returned to indicate why inferring a mapping model automatically failed.
*/
+ (nullable NSMappingModel *)inferredMappingModelForSourceModel:(NSManagedObjectModel *)sourceModel destinationModel:(NSManagedObjectModel *)destinationModel error:(NSError **)error API_AVAILABLE(macosx(10.6),ios(3.0));
/* Loads the mapping model from the specified URL.
*/
- (nullable instancetype)initWithContentsOfURL:(nullable NSURL *)url;
/* Returns/sets the collection of entity mappings for the model. The order of the mappings dictates the order in which they will be processed during migration.
*/
@property (null_resettable, strong) NSArray<NSEntityMapping *> *entityMappings;
/* Returns a dictionary of the entity mappings for the model, keyed by their respective name. (This API is provided for quick access to a mapping by name, rather than iterating the ordered entityMapping array.)
*/
@property (readonly, copy) NSDictionary<NSString *, NSEntityMapping *> *entityMappingsByName;
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSSaveChangesRequest.h | /*
NSSaveChangesRequest.h
Core Data
Copyright (c) 2004-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSSet.h>
#import <CoreData/NSPersistentStoreRequest.h>
NS_ASSUME_NONNULL_BEGIN
@class NSPersistentStoreRequest;
@class NSManagedObject;
API_AVAILABLE(macosx(10.7),ios(5.0))
@interface NSSaveChangesRequest : NSPersistentStoreRequest {
}
// Default initializer.
- (instancetype)initWithInsertedObjects:(nullable NSSet<NSManagedObject *> *)insertedObjects updatedObjects:(nullable NSSet<NSManagedObject *> *)updatedObjects deletedObjects:(nullable NSSet<NSManagedObject *> *)deletedObjects lockedObjects:(nullable NSSet<NSManagedObject *> *)lockedObjects;
// Objects that were inserted into the calling context.
@property (nullable, readonly, strong) NSSet<__kindof NSManagedObject *> *insertedObjects;
// Objects that were modified in the calling context.
@property (nullable, readonly, strong) NSSet<__kindof NSManagedObject *> *updatedObjects;
// Objects that were deleted from the calling context.
@property (nullable, readonly, strong) NSSet<__kindof NSManagedObject *> *deletedObjects;
// Objects that were flagged for optimistic locking on the calling context via detectConflictsForObject:.
@property (nullable, readonly, strong) NSSet<__kindof NSManagedObject *> *lockedObjects;
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentHistoryToken.h | /*
NSPersistentHistoryToken.h
Core Data
Copyright (c) 2017-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
NS_ASSUME_NONNULL_BEGIN
API_AVAILABLE(macosx(10.13),ios(11.0),tvos(11.0),watchos(4.0))
@interface NSPersistentHistoryToken : NSObject <NSCopying, NSSecureCoding>
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentCloudKitContainerEvent.h | /*
NSPersistentCloudKitContainerEvent.h
Core Data
Copyright (c) 2020-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSUUID.h>
#import <Foundation/NSDate.h>
#import <Foundation/NSString.h>
#import <Foundation/NSNotification.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, NSPersistentCloudKitContainerEventType) {
NSPersistentCloudKitContainerEventTypeSetup,
NSPersistentCloudKitContainerEventTypeImport,
NSPersistentCloudKitContainerEventTypeExport
} API_AVAILABLE(macosx(11.0),ios(14.0),tvos(14.0),watchos(7.0)) NS_SWIFT_NAME(NSPersistentCloudKitContainer.EventType);
COREDATA_EXTERN NSNotificationName const NSPersistentCloudKitContainerEventChangedNotification API_AVAILABLE(macosx(11.0),ios(14.0),tvos(14.0),watchos(7.0)) NS_SWIFT_NAME(NSPersistentCloudKitContainer.eventChangedNotification);
COREDATA_EXTERN NSString * const NSPersistentCloudKitContainerEventUserInfoKey API_AVAILABLE(macosx(11.0),ios(14.0),tvos(14.0),watchos(7.0)) NS_SWIFT_NAME(NSPersistentCloudKitContainer.eventNotificationUserInfoKey);
API_AVAILABLE(macosx(11.0),ios(14.0),tvos(14.0),watchos(7.0))
NS_SWIFT_NAME(NSPersistentCloudKitContainer.Event)
@interface NSPersistentCloudKitContainerEvent : NSObject<NSCopying>
@property(nonatomic, strong, readonly) NSUUID *identifier;
@property(nonatomic, strong, readonly) NSString *storeIdentifier;
@property(nonatomic, readonly) NSPersistentCloudKitContainerEventType type;
@property(nonatomic, strong, readonly) NSDate *startDate;
@property(nonatomic, strong, nullable, readonly) NSDate *endDate;
@property(nonatomic, assign, readonly) BOOL succeeded;
@property(nonatomic, strong, nullable, readonly) NSError *error;
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSEntityDescription.h | /*
NSEntityDescription.h
Core Data
Copyright (c) 2004-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSRange.h>
NS_ASSUME_NONNULL_BEGIN
@class NSManagedObjectModel;
@class NSManagedObjectContext;
@class NSManagedObject;
@class NSData;
@class NSPropertyDescription;
@class NSRelationshipDescription;
@class NSAttributeDescription;
@class NSFetchIndexDescription;
@class NSExpression;
// Entities describe the "types" of objects available.
API_AVAILABLE(macosx(10.4),ios(3.0))
@interface NSEntityDescription : NSObject <NSCoding, NSCopying, NSFastEnumeration> {
}
+ (nullable NSEntityDescription *)entityForName:(NSString *)entityName inManagedObjectContext:(NSManagedObjectContext *)context;
+ (__kindof NSManagedObject *)insertNewObjectForEntityForName:(NSString *)entityName inManagedObjectContext:(NSManagedObjectContext *)context;
@property (readonly, assign) NSManagedObjectModel *managedObjectModel;
@property (null_resettable, copy) NSString *managedObjectClassName;
@property (nullable, copy) NSString *name;
@property (getter=isAbstract) BOOL abstract;
@property (readonly, copy) NSDictionary<NSString *, NSEntityDescription *> *subentitiesByName;
@property (strong) NSArray<NSEntityDescription *> *subentities;
@property (nullable, readonly, assign) NSEntityDescription *superentity;
@property (readonly, copy) NSDictionary<NSString *, __kindof NSPropertyDescription *> *propertiesByName;
@property (strong) NSArray<__kindof NSPropertyDescription *> *properties;
@property (nullable, nonatomic, strong) NSDictionary *userInfo;
// convenience methods to get the most common (and most relevant) types of properties for an entity
@property (readonly, copy) NSDictionary<NSString *, NSAttributeDescription *> *attributesByName;
@property (readonly, copy) NSDictionary<NSString *, NSRelationshipDescription *> *relationshipsByName;
- (NSArray<NSRelationshipDescription *> *)relationshipsWithDestinationEntity:(NSEntityDescription *)entity;
/* Returns a boolean indicating if the receiver is a subentity of the specified entity. (This method is the Core Data entity inheritance equivalent of -isKindOfClass:)
*/
- (BOOL)isKindOfEntity:(NSEntityDescription *)entity API_AVAILABLE(macosx(10.5),ios(3.0));
/* Returns the version hash for the entity. The version hash is used to uniquely identify an entity based on the collection and configuration of properties for the entity. The version hash uses only values which affect the persistence of data and the user-defined versionHashModifier value. (The values which affect persistence are the name of the entity, the version hash of the superentity (if present), if the entity is abstract, and all of the version hashes for the properties.) This value is stored as part of the version information in the metadata for stores which use this entity, as well as a definition of an entity involved in an NSEntityMapping.
*/
@property (readonly, copy) NSData *versionHash API_AVAILABLE(macosx(10.5),ios(3.0));
/* Returns/sets the version hash modifier for the entity. This value is included in the version hash for the entity, allowing developers to mark/denote an entity as being a different "version" than another, even if all of the values which affect persistence are equal. (Such a difference is important in cases where the structure of an entity is unchanged, but the format or content of data has changed.)
*/
@property (nullable, copy) NSString *versionHashModifier API_AVAILABLE(macosx(10.5),ios(3.0));
@property (nullable, copy) NSString *renamingIdentifier API_AVAILABLE(macosx(10.6),ios(3.0));
/* Returns/sets the set of indexes for the entity. Returns/takes an array of NSFetchIndexDescription instances. This value does not form part of the entity's version hash, and may be ignored by stores which do not natively support indexing.
IMPORTANT: Indexes should be the last things set in a model. Changing an entity hierarchy in any way that could affect the validity of indexes (adding or removing super/subentities, adding or removing properties anywhere in the hierarchy) will cause all exisiting indexes for entities in that hierarchy to be dropped.
*/
@property (copy) NSArray <NSFetchIndexDescription *>*indexes API_AVAILABLE(macosx(10.13),ios(11.0),tvos(11.0),watchos(4.0));
/* Returns/sets uniqueness constraints for the entity. A uniqueness constraint is a set of one or more attributes whose value must be unique over the set of instances of that entity.
Sets an array of arrays, each of which contains one or more NSAttributeDescription or NSString instances (strings must be the names of attributes on the entity) on which the constraint is registered.
Returns an array of arrays, each of which contains instances of NSString which identify the attributes on the entity that comprise the constraint.
This value forms part of the entity's version hash. Stores which do not support uniqueness constraints should refuse to initialize when given a model containing such constraints.
Discussion: uniqueness constraint violations can be computationally expensive to handle. It is highly suggested that there be only one uniqueness constraint per entity hierarchy,
although subentites may extend a sueprentity's constraint.
*/
@property (strong)NSArray<NSArray<id> *> *uniquenessConstraints API_AVAILABLE(macosx(10.11),ios(9.0));
/* Getter returns an array of arrays of NSPropertyDescription objects describing the components of the indexes.
Setter takes an array of arrays of NSPropertyDescription objects and/or strings that are the names of properties of the entity on which the index is created. The special strings @"self" and @"entity" can be used to indicate that an index should contain a reference to the object's primary or entity key.
This value does not form part of the entity's version hash, and may be ignored by stores which do not natively support compound indexes.
*/
@property (strong) NSArray<NSArray<id> *> *compoundIndexes API_DEPRECATED( "Use NSEntityDescription.indexes instead", macosx(10.5,10.13),ios(3.0,11.0),tvos(9.0, 11.0),watchos(2.0, 4.0));
/* Expression used to compute the CoreSpotlight display name for instance of this entity. */
@property (nonatomic, retain) NSExpression *coreSpotlightDisplayNameExpression API_AVAILABLE(macosx(10.13),ios(11.0),tvos(11.0),watchos(4.0));
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentCloudKitContainerEventRequest.h | /*
NSPersistentCloudKitContainerEventRequest.h
Core Data
Copyright (c) 2020-2021, Apple Inc.
All rights reserved.
*/
#import <CoreData/NSPersistentStoreRequest.h>
#import <CoreData/NSPersistentStoreResult.h>
NS_ASSUME_NONNULL_BEGIN
@class NSPersistentCloudKitContainerEvent;
API_AVAILABLE(macosx(11.0),ios(14.0),tvos(14.0),watchos(7.0))
@interface NSPersistentCloudKitContainerEventRequest : NSPersistentStoreRequest
@property NSPersistentCloudKitContainerEventResultType resultType;
+ (nonnull instancetype)fetchEventsAfterDate:(NSDate *)date;
+ (nonnull instancetype)fetchEventsAfterEvent:(nullable NSPersistentCloudKitContainerEvent *)event;
/*
Supports fetching instances of NSPersistentCloudKitContainerEvent matching a fetch request.
*/
+ (nonnull instancetype)fetchEventsMatchingFetchRequest:(NSFetchRequest *)fetchRequest;
/*
Returns an instance of NSFetchRequest configured with the correct entity for fetching instances
of NSPersistentCloudKitContainerEvent.
*/
+ (NSFetchRequest *)fetchRequestForEvents;
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSExpressionDescription.h | /*
NSExpressionDescription.h
Core Data
Copyright (c) 2004-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <CoreData/NSPropertyDescription.h>
#import <CoreData/NSAttributeDescription.h>
NS_ASSUME_NONNULL_BEGIN
@class NSExpression;
/* Special property description type intended for use with the NSFetchRequest -propertiesToFetch method.
An NSExpressionDescription describes a column to be returned from a fetch that may not appear
directly as an attribute or relationship on an entity. Examples would be: upper(attribute) or
max(attribute). NSExpressionDescriptions cannot be set as properties on NSEntityDescription. */
API_AVAILABLE(macosx(10.6),ios(3.0))
@interface NSExpressionDescription : NSPropertyDescription {
}
@property (nullable, strong) NSExpression *expression;
@property () NSAttributeType expressionResultType;
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentStoreResult.h | /*
NSPersistentStoreResult.h
Core Data
Copyright (c) 2014-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <CoreData/NSFetchRequest.h>
NS_ASSUME_NONNULL_BEGIN
@class NSError;
@class NSProgress;
@class NSManagedObjectContext;
@class NSFetchRequest;
@class NSPersistentStoreAsynchronousResult;
@class NSAsynchronousFetchResult;
@class NSAsynchronousFetchRequest;
typedef NS_ENUM(NSUInteger, NSBatchInsertRequestResultType) {
NSBatchInsertRequestResultTypeStatusOnly = 0x0, // Return a status boolean
NSBatchInsertRequestResultTypeObjectIDs = 0x1, // Return the object IDs of the rows that were inserted/updated
NSBatchInsertRequestResultTypeCount = 0x2 // Return the number of rows that were inserted/updated
} API_AVAILABLE(macosx(10.15),ios(13.0),tvos(13.0),watchos(6.0));
typedef NS_ENUM(NSUInteger, NSBatchUpdateRequestResultType) {
NSStatusOnlyResultType = 0x0, // Return a status boolean
NSUpdatedObjectIDsResultType = 0x1, // Return the object IDs of the rows that were updated
NSUpdatedObjectsCountResultType = 0x2 // Return the number of rows that were updated
} API_AVAILABLE(macosx(10.10), ios(8.0));
typedef NS_ENUM(NSUInteger, NSBatchDeleteRequestResultType) {
NSBatchDeleteResultTypeStatusOnly = 0x0, // Return a status boolean
NSBatchDeleteResultTypeObjectIDs = 0x1, // Return the object IDs of the rows that were deleted
NSBatchDeleteResultTypeCount = 0x2, // Return the number of rows that were deleted
} API_AVAILABLE(macosx(10.11), ios(9.0));
typedef NS_ENUM(NSInteger, NSPersistentHistoryResultType) {
NSPersistentHistoryResultTypeStatusOnly = 0x0, // Return a status boolean
NSPersistentHistoryResultTypeObjectIDs = 0x1, // Return the object IDs of the changes objects
NSPersistentHistoryResultTypeCount = 0x2, // Return the number of transactions
NSPersistentHistoryResultTypeTransactionsOnly = 0x3, // Return NSPersistentHistoryTransaction objects
NSPersistentHistoryResultTypeChangesOnly = 0x4, // Return NSPersistentHistoryChange objects
NSPersistentHistoryResultTypeTransactionsAndChanges = 0x5, // Return NSPersistentHistoryTransaction objects with related NSPersistentHistoryChange objects
} API_AVAILABLE(macosx(10.13),ios(11.0),tvos(11.0),watchos(4.0));
// Used to wrap the result of whatever is returned by the persistent store coordinator when
// -[NSManagedObjectContext executeRequest:error:] is called
API_AVAILABLE(macosx(10.10),ios(8.0))
@interface NSPersistentStoreResult : NSObject
@end
API_AVAILABLE(macosx(10.10),ios(8.0))
@interface NSPersistentStoreAsynchronousResult : NSPersistentStoreResult {
}
@property (strong, readonly) NSManagedObjectContext* managedObjectContext;
@property (nullable, strong, readonly) NSError* operationError;
@property (nullable, strong, readonly) NSProgress* progress;
- (void)cancel;
@end
API_AVAILABLE(macosx(10.10),ios(8.0))
@interface NSAsynchronousFetchResult<ResultType:id<NSFetchRequestResult>> : NSPersistentStoreAsynchronousResult {
}
@property (strong, readonly) NSAsynchronousFetchRequest<ResultType> * fetchRequest;
@property (nullable, strong, readonly) NSArray<ResultType> * finalResult;
@end
// The result returned when executing an NSBatchInsertRequest
API_AVAILABLE(macosx(10.15),ios(13.0),tvos(13.0),watchos(6.0))
@interface NSBatchInsertResult : NSPersistentStoreResult {
}
// Return the result. See NSBatchInsertRequestResultType for options
@property (nullable, strong, readonly) id result;
@property (readonly) NSBatchInsertRequestResultType resultType;
@end
// The result returned when executing an NSBatchUpdateRequest
API_AVAILABLE(macosx(10.10),ios(8.0))
@interface NSBatchUpdateResult : NSPersistentStoreResult {
}
// Return the result. See NSBatchUpdateRequestResultType for options
@property (nullable, strong, readonly) id result;
@property (readonly) NSBatchUpdateRequestResultType resultType;
@end
// The result returned when executing an NSBatchDeleteRequest
API_AVAILABLE(macosx(10.11),ios(9.0))
@interface NSBatchDeleteResult : NSPersistentStoreResult {
}
// Return the result. See NSBatchDeleteRequestResultType for options
@property (nullable, strong, readonly) id result;
@property (readonly) NSBatchDeleteRequestResultType resultType;
@end
// The result returned when executing an NSPersistentHistoryChangeRequest
API_AVAILABLE(macosx(10.13),ios(11.0),tvos(11.0),watchos(4.0))
@interface NSPersistentHistoryResult : NSPersistentStoreResult {
}
// Return the result. See NSPersistentHistoryResultType for options
@property (nullable, strong, readonly) id result;
@property (readonly) NSPersistentHistoryResultType resultType;
@end
typedef NS_ENUM(NSInteger, NSPersistentCloudKitContainerEventResultType) {
NSPersistentCloudKitContainerEventResultTypeEvents = 0, //the result is an NSArray<NSPersistentCloudKitContainerEvent *>
NSPersistentCloudKitContainerEventResultTypeCountEvents //the result is an NSArray<NSNumber *> indicating the count of events matching the request
} API_AVAILABLE(macosx(11.0),ios(14.0),tvos(14.0),watchos(7.0)) NS_SWIFT_NAME(NSPersistentCloudKitContainerEventResult.ResultType);
// The result returned when executing an NSPersistentCloudKitContainerEventRequest
API_AVAILABLE(macosx(11.0),ios(14.0),tvos(14.0),watchos(7.0))
@interface NSPersistentCloudKitContainerEventResult : NSPersistentStoreResult
// Return the result. See NSPersistentCloudKitContainerEventResultType for options
@property (nullable, strong, readonly) id result;
@property (readonly) NSPersistentCloudKitContainerEventResultType resultType;
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSMigrationManager.h | /*
NSMigrationManager.h
Core Data
Copyright (c) 2004-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSError.h>
NS_ASSUME_NONNULL_BEGIN
@class NSEntityDescription;
@class NSEntityMapping;
@class NSManagedObjectContext;
@class NSManagedObject;
@class NSManagedObjectModel;
@class NSMappingModel;
@class NSMigrationContext;
API_AVAILABLE(macosx(10.5),ios(3.0))
@interface NSMigrationManager : NSObject {
}
/* Creates a migration manager instance with the corresponding source and destination models. (All validation of the arguments is performed during migrateStoreFromURL:toURL:) As with the NSPersistentStoreCoordinator, once models are added to the migration manager they are immutable and cannot be altered.*/
- (instancetype)initWithSourceModel:(NSManagedObjectModel *)sourceModel destinationModel:(NSManagedObjectModel *)destinationModel;
/* Migrates of the store at the specified source URL to the store at the destination URL, performing all of the mappings in the mapping model. A store must exist at the source URL; if a store does not exist at the destination URL, one will be created (otherwise the migration will append to the existing store.) Invoking this method will perform compatibility checks on the source and destination models (and the mapping model.) If an error occurs during the validation or migration, this method will return NO.*/
- (BOOL)migrateStoreFromURL:(NSURL *)sourceURL type:(NSString *)sStoreType options:(nullable NSDictionary *)sOptions withMappingModel:(nullable NSMappingModel *)mappings toDestinationURL:(NSURL *)dURL destinationType:(NSString *)dStoreType destinationOptions:(nullable NSDictionary *)dOptions error:(NSError **)error;
/* Tries to use a store specific migration manager to perform the store migration, note that a store specific migration manager class is not guaranteed to perform any of the migration manager delegate callbacks or update values for the observable properties.
Defaults to YES */
@property () BOOL usesStoreSpecificMigrationManager API_AVAILABLE(macosx(10.7),ios(5.0));
/* Resets the association tables for the migration. (Note this does NOT reset the source or destination contexts).*/
- (void)reset;
/* Accessors for the mapping model, source model, and destination model*/
@property (readonly, strong) NSMappingModel *mappingModel;
@property (readonly, strong) NSManagedObjectModel *sourceModel;
@property (readonly, strong) NSManagedObjectModel *destinationModel;
/* Accessors for the managed object contexts used for reading the source and destination stores. These contexts are created lazily, as part of the initialization of two Core Data stacks (one for reading, the other for writing data.) */
@property (readonly, strong) NSManagedObjectContext *sourceContext;
@property (readonly, strong) NSManagedObjectContext *destinationContext;
/* Returns the NSEntityDescription for the source and destination entities, respectively, of the entity mapping. (Entity mappings do not store the actual description objects, but rather the name and version information of the entity.)*/
- (nullable NSEntityDescription *)sourceEntityForEntityMapping:(NSEntityMapping *)mEntity;
- (nullable NSEntityDescription *)destinationEntityForEntityMapping:(NSEntityMapping *)mEntity;
/* Associates the source instance with the specified destination instance for the given entity mapping. Since the migration is performed as a three-step process (first create the data, then relate the data, then validate the data) it is necessary to be able to associate data between the source and destination stores, in order to allow for relationship creation/fixup after the creation pass. This method is called in the default
implementation of NSEntityMigrationPolicy's createDestinationInstancesForSourceInstance:entityMapping:manager:error: method.*/
- (void)associateSourceInstance:(NSManagedObject *)sourceInstance withDestinationInstance:(NSManagedObject *)destinationInstance forEntityMapping:(NSEntityMapping *)entityMapping;
/* Returns the managed object instances created in the destination store for the given entity mapping for the specified source instances.*/
- (NSArray<__kindof NSManagedObject *> *)destinationInstancesForEntityMappingNamed:(NSString *)mappingName sourceInstances:(nullable NSArray<__kindof NSManagedObject *> *)sourceInstances;
/* Returns the managed object instances in the source store used to create the specified destination instances for the given entity mapping.*/
- (NSArray<__kindof NSManagedObject *> *)sourceInstancesForEntityMappingNamed:(NSString *)mappingName destinationInstances:(nullable NSArray<__kindof NSManagedObject *> *)destinationInstances;
/* Observable property that can be used to determine progress of the migration process. Returns the current entity mapping being processed. Each entity is processed a total of three times (instance creation, relationship creation, validation)*/
@property (readonly, strong) NSEntityMapping *currentEntityMapping;
/* Observable property that can be used to determine progress of the migration process. Returns the percentage complete of the migration process. The progress value is a number from 0 to 1 indicating percent complete.*/
@property (readonly) float migrationProgress;
/* Returns/sets the user info for the migration manager*/
@property (nullable, nonatomic, strong) NSDictionary *userInfo;
/* Cancels the migration with the specified error. Calling this method causes migrateStoreFromURL:type:options:withMappingModel:toDestinationURL:destinationType:destinationOptions:error: to abort the migration and return the specified error. */
- (void)cancelMigrationWithError:(NSError *)error;
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/CoreData.h | /*
CoreData.h
Core Data
Copyright (c) 2004-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/Foundation.h>
#import <CoreData/CoreDataDefines.h>
#import <CoreData/CoreDataErrors.h>
#import <CoreData/NSAttributeDescription.h>
#import <CoreData/NSDerivedAttributeDescription.h>
#import <CoreData/NSEntityDescription.h>
#import <CoreData/NSFetchedPropertyDescription.h>
#import <CoreData/NSPropertyDescription.h>
#import <CoreData/NSExpressionDescription.h>
#import <CoreData/NSRelationshipDescription.h>
#import <CoreData/NSFetchIndexDescription.h>
#import <CoreData/NSFetchIndexElementDescription.h>
#import <CoreData/NSFetchRequest.h>
#import <CoreData/NSFetchRequestExpression.h>
#import <CoreData/NSManagedObjectModel.h>
#import <CoreData/NSManagedObject.h>
#import <CoreData/NSManagedObjectID.h>
#import <CoreData/NSManagedObjectContext.h>
#import <CoreData/NSPersistentStoreCoordinator.h>
#import <CoreData/NSPersistentStore.h>
#import <CoreData/NSAtomicStore.h>
#import <CoreData/NSAtomicStoreCacheNode.h>
#import <CoreData/NSEntityMigrationPolicy.h>
#import <CoreData/NSMappingModel.h>
#import <CoreData/NSEntityMapping.h>
#import <CoreData/NSPropertyMapping.h>
#import <CoreData/NSMigrationManager.h>
#import <CoreData/NSIncrementalStore.h>
#import <CoreData/NSIncrementalStoreNode.h>
#import <CoreData/NSPersistentStoreRequest.h>
#import <CoreData/NSPersistentStoreResult.h>
#import <CoreData/NSSaveChangesRequest.h>
#import <CoreData/NSBatchUpdateRequest.h>
#import <CoreData/NSBatchDeleteRequest.h>
#import <CoreData/NSBatchInsertRequest.h>
#import <CoreData/NSMergePolicy.h>
#import <CoreData/NSFetchedResultsController.h>
#import <CoreData/NSQueryGenerationToken.h>
#import <CoreData/NSPersistentStoreDescription.h>
#import <CoreData/NSPersistentContainer.h>
#import <CoreData/NSPersistentHistoryChange.h>
#import <CoreData/NSPersistentHistoryChangeRequest.h>
#import <CoreData/NSPersistentHistoryToken.h>
#import <CoreData/NSPersistentHistoryTransaction.h>
#import <CoreData/NSPersistentCloudKitContainer.h>
#import <CoreData/NSPersistentCloudKitContainerOptions.h>
#import <CoreData/NSPersistentCloudKitContainerEvent.h>
#import <CoreData/NSPersistentCloudKitContainerEventRequest.h>
#import <CoreData/NSCoreDataCoreSpotlightDelegate.h>
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentStoreCoordinator.h | /*
NSPersistentStoreCoordinator.h
Core Data
Copyright (c) 2004-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSSet.h>
#import <Foundation/NSError.h>
#import <Foundation/NSLock.h>
#import <CoreData/CoreDataDefines.h>
NS_ASSUME_NONNULL_BEGIN
@class NSURL;
@class NSValue;
@class NSManagedObjectID;
@class NSManagedObjectModel;
@class NSManagedObjectContext;
@class NSPersistentStore;
@class NSPersistentStoreRequest;
@class NSPersistentStoreDescription;
@class NSPersistentHistoryToken;
// Persistent store types supported by Core Data:
COREDATA_EXTERN NSString * const NSSQLiteStoreType API_AVAILABLE(macosx(10.4),ios(3.0));
COREDATA_EXTERN NSString * const NSXMLStoreType API_AVAILABLE(macosx(10.4)) API_UNAVAILABLE(ios);
COREDATA_EXTERN NSString * const NSBinaryStoreType API_AVAILABLE(macosx(10.4),ios(3.0));
COREDATA_EXTERN NSString * const NSInMemoryStoreType API_AVAILABLE(macosx(10.4),ios(3.0));
// Persistent store metadata dictionary keys:
// key in the metadata dictionary to identify the store type
COREDATA_EXTERN NSString * const NSStoreTypeKey API_AVAILABLE(macosx(10.4),ios(3.0));
// key in the metadata dictionary to identify the store UUID - the store UUID is useful to identify stores through URI representations, but it is NOT guaranteed to be unique (while the UUID generated for new stores is unique, users can freely copy files and thus the UUID stored inside, so developers that track/reference stores explicitly do need to be aware of duplicate UUIDs and potentially override the UUID when a new store is added to the list of known stores in their application)
COREDATA_EXTERN NSString * const NSStoreUUIDKey API_AVAILABLE(macosx(10.4),ios(3.0));
/* A notification posted before the list of open persistent stores changes, similar to NSPersistentStoreCoordinatorStoresDidChangeNotification. If the application is running, Core Data will post this before responding to iCloud account changes or "Delete All" from Documents & Data.
*/
COREDATA_EXTERN NSString * const NSPersistentStoreCoordinatorStoresWillChangeNotification API_AVAILABLE(macosx(10.9),ios(7.0));
// user info dictionary contains information about the stores that were added or removed
COREDATA_EXTERN NSString * const NSPersistentStoreCoordinatorStoresDidChangeNotification API_AVAILABLE(macosx(10.4),ios(3.0));
// sent during the invocation of NSPersistentStore's willRemoveFromPersistentStoreCoordinator during store deallocation or removal
COREDATA_EXTERN NSString * const NSPersistentStoreCoordinatorWillRemoveStoreNotification API_AVAILABLE(macosx(10.5),ios(3.0));
// User info keys for NSPersistentStoreCoordinatorStoresDidChangeNotification:
// The object values for NSAddedPersistentStoresKey and NSRemovedPersistentStoresKey will be arrays containing added/removed stores
COREDATA_EXTERN NSString * const NSAddedPersistentStoresKey API_AVAILABLE(macosx(10.4),ios(3.0));
COREDATA_EXTERN NSString * const NSRemovedPersistentStoresKey API_AVAILABLE(macosx(10.4),ios(3.0));
// The object value for NSUUIDChangedPersistentStoresKey will be an array where the object at index 0 will be the old store instance, and the object at index 1 the new
COREDATA_EXTERN NSString * const NSUUIDChangedPersistentStoresKey API_AVAILABLE(macosx(10.4),ios(3.0));
// Persistent store option keys:
// flag indicating whether a store is treated as read-only or not - default is NO
COREDATA_EXTERN NSString * const NSReadOnlyPersistentStoreOption API_AVAILABLE(macosx(10.4),ios(3.0));
// flag indicating whether an XML file should be validated with the DTD while opening - default is NO
COREDATA_EXTERN NSString * const NSValidateXMLStoreOption API_AVAILABLE(macosx(10.4)) API_UNAVAILABLE(ios);
// Migration keys:
/* Options key specifying the connection timeout for Core Data stores. This value (an NSNumber) represents the duration, in seconds, Core Data will wait while attempting to create a connection to a persistent store. If a connection is unable to be made within that timeframe, the operation is aborted and an error is returned.
*/
COREDATA_EXTERN NSString * const NSPersistentStoreTimeoutOption API_AVAILABLE(macosx(10.5),ios(3.0));
/* Options key for a dictionary of sqlite pragma settings with pragma values indexed by pragma names as keys. All pragma values must be specified as strings. The fullfsync and synchronous pragmas control the tradeoff between write performance (write to disk speed & cache utilization) and durability (data loss/corruption sensitivity to power interruption). For more information on pragma settings visit <http://sqlite.org/pragma.html>
*/
COREDATA_EXTERN NSString * const NSSQLitePragmasOption API_AVAILABLE(macosx(10.5),ios(3.0));
/* Option key to run an analysis of the store data to optimize indices based on statistical information when the store is added to the coordinator. This invokes SQLite's ANALYZE command. Ignored by other stores.
*/
COREDATA_EXTERN NSString * const NSSQLiteAnalyzeOption API_AVAILABLE(macosx(10.5),ios(3.0));
/* Option key to rebuild the store file, forcing a database wide defragmentation when the store is added to the coordinator. This invokes SQLite's VACUUM command. Ignored by other stores.
*/
COREDATA_EXTERN NSString * const NSSQLiteManualVacuumOption API_AVAILABLE(macosx(10.6),ios(3.0));
/* Options key to ignore the built-in versioning provided by Core Data. If the value for this key (an NSNumber) evaluates to YES (using boolValue), Core Data will not compare the version hashes between the managed object model in the coordinator and the metadata for the loaded store. (It will, however, continue to update the version hash information in the metadata.) This key is specified by default for all applications linked on or before Mac OS X 10.4.
*/
COREDATA_EXTERN NSString * const NSIgnorePersistentStoreVersioningOption API_AVAILABLE(macosx(10.5),ios(3.0));
/* Options key to automatically attempt to migrate versioned stores. If the value for this key (an NSNumber) evaluates to YES (using boolValue) Core Data will, if the version hash information for added store is determined to be incompatible with the model for the coordinator, attempt to locate the source and mapping models in the application bundles, and perform a migration.
*/
COREDATA_EXTERN NSString * const NSMigratePersistentStoresAutomaticallyOption API_AVAILABLE(macosx(10.5),ios(3.0));
/* When combined with NSMigratePersistentStoresAutomaticallyOption, coordinator will attempt to infer a mapping model if none can be found */
COREDATA_EXTERN NSString * const NSInferMappingModelAutomaticallyOption API_AVAILABLE(macosx(10.6),ios(3.0));
/* Key to represent the version hash information (dictionary) for the model used to create a persistent store. This key is used in the metadata for a persistent store.
*/
COREDATA_EXTERN NSString * const NSStoreModelVersionHashesKey API_AVAILABLE(macosx(10.5),ios(3.0));
/* Key to represent the version identifier for the model used to create the store. This key is used in the metadata for a persistent store.
*/
COREDATA_EXTERN NSString * const NSStoreModelVersionIdentifiersKey API_AVAILABLE(macosx(10.5),ios(3.0));
/* Key to represent the earliest version of MacOS X the persistent store should support. Backward compatibility may preclude some features. The numeric values are defined in AvailabilityMacros.h
*/
COREDATA_EXTERN NSString * const NSPersistentStoreOSCompatibility API_AVAILABLE(macosx(10.5),ios(3.0));
/* User info key specifying the maximum connection pool size that should be used on a store that supports concurrent request handling, the value should be an NSNumber. The connection pool size determines the number of requests a store can handle concurrently, and should be a function of how many contexts are attempting to access store data at any time. Generally, application developers should not set this, and should use the default value. The default connection pool size is implementation dependent and may vary by store type and/or platform.
*/
COREDATA_EXTERN NSString * const NSPersistentStoreConnectionPoolMaxSizeKey API_AVAILABLE(macosx(10.12),ios(10.0),tvos(10.0),watchos(3.0));
/* Spotlight indexing and external record support keys */
COREDATA_EXTERN NSString * const NSCoreDataCoreSpotlightExporter API_AVAILABLE(macosx(10.13),ios(11.0)) API_UNAVAILABLE(tvos,watchos);
/* Values to be passed with NSExternalRecordsFileFormatOption indicating the format used when writing external records.
The files are serialized dictionaries.
*/
COREDATA_EXTERN NSString * const NSXMLExternalRecordType API_DEPRECATED("Spotlight integration is deprecated. Use CoreSpotlight integration instead.", macosx(10.6,10.13)) API_UNAVAILABLE(ios);
COREDATA_EXTERN NSString * const NSBinaryExternalRecordType API_DEPRECATED("Spotlight integration is deprecated. Use CoreSpotlight integration instead.", macosx(10.6,10.13)) API_UNAVAILABLE(ios);
/* option indicating the file format used when writing external records.The default is NSXMLExternalRecordType if this options isn't specified. */
COREDATA_EXTERN NSString * const NSExternalRecordsFileFormatOption API_DEPRECATED("Spotlight integration is deprecated. Use CoreSpotlight integration instead.", macosx(10.6,10.13)) API_UNAVAILABLE(ios);
/* option indicating the directory URL where external records are stored. External records are files that can be used by
Spotlight to index the contents of the store. They can also contain a serialized dictionary representation of the instances.
The location specified with this option must be somewhere under the path ~/Library/Caches/Metadata/CoreData or ~/Library/CoreData
This option must be set together with NSExternalRecordExtensionOption
*/
COREDATA_EXTERN NSString * const NSExternalRecordsDirectoryOption API_DEPRECATED("Spotlight integration is deprecated. Use CoreSpotlight integration instead.", macosx(10.6,10.13)) API_UNAVAILABLE(ios);
/* option indicating the extension used in the external record files. This option must be set together with NSExternalRecordsDirectoryOption */
COREDATA_EXTERN NSString * const NSExternalRecordExtensionOption API_DEPRECATED("Spotlight integration is deprecated. Use CoreSpotlight integration instead.", macosx(10.6,10.13)) API_UNAVAILABLE(ios);
/* Dictionary key for the entity name extracted from an external record file URL */
COREDATA_EXTERN NSString * const NSEntityNameInPathKey API_DEPRECATED("Spotlight integration is deprecated. Use CoreSpotlight integration instead.", macosx(10.6,10.13)) API_UNAVAILABLE(ios);
/* Dictionary key for the store UUID extracted from an external record file URL */
COREDATA_EXTERN NSString * const NSStoreUUIDInPathKey API_DEPRECATED("Spotlight integration is deprecated. Use CoreSpotlight integration instead.", macosx(10.6,10.13)) API_UNAVAILABLE(ios);
/* Dictionary key for the store URL extracted from an external record file URL */
COREDATA_EXTERN NSString * const NSStorePathKey API_DEPRECATED("Spotlight integration is deprecated. Use CoreSpotlight integration instead.", macosx(10.6,10.13)) API_UNAVAILABLE(ios);
/* Dictionary key for the managed object model URL extracted from an external record file URL */
COREDATA_EXTERN NSString * const NSModelPathKey API_DEPRECATED("Spotlight integration is deprecated. Use CoreSpotlight integration instead.", macosx(10.6,10.13)) API_UNAVAILABLE(ios);
/* Dictionary key for the object URI extracted from an external record file URL */
COREDATA_EXTERN NSString * const NSObjectURIKey API_DEPRECATED("Spotlight integration is deprecated. Use CoreSpotlight integration instead.", macosx(10.6,10.13)) API_UNAVAILABLE(ios);
/* store option for the destroy... and replace... to indicate that the store file should be destroyed even if the operation might be unsafe (overriding locks
*/
COREDATA_EXTERN NSString * const NSPersistentStoreForceDestroyOption API_AVAILABLE(macosx(10.8),ios(6.0));
/* Key to represent the protection class for the persistent store. Backward compatibility may preclude some features. The acceptable values are those defined in Foundation for the NSFileProtectionKey. The default value of NSPersistentStoreFileProtectionKey is NSFileProtectionCompleteUntilFirstUserAuthentication for all applications built on or after iOS5. The default value for all older applications is NSFileProtectionNone. */
COREDATA_EXTERN NSString * const NSPersistentStoreFileProtectionKey API_AVAILABLE(ios(5.0)) API_UNAVAILABLE(macosx);
/* Dictionary key for enabling persistent history - default is NO */
COREDATA_EXTERN NSString * const NSPersistentHistoryTrackingKey API_AVAILABLE(macosx(10.13),ios(11.0),tvos(11.0),watchos(4.0));
/*
Allows developers to provide an additional set of classes (which must implement NSSecureCoding) that should be used while
decoding a binary store.
Using this option is preferable to using NSBinaryStoreInsecureDecodingCompatibilityOption.
*/
COREDATA_EXTERN NSString * const NSBinaryStoreSecureDecodingClasses API_AVAILABLE(macosx(10.13),ios(11.0),tvos(11.0),watchos(4.0));
/*
Indicate that the binary store should be decoded insecurely. This may be necessary if a store has metadata or transformable
properties containing non-standard classes. If possible, developers should use the NSBinaryStoreSecureDecodingClasses option
to specify the contained classes, allowing the binary store to to be securely decoded.
Applications linked before the availability date will default to using this option.
*/
COREDATA_EXTERN NSString * const NSBinaryStoreInsecureDecodingCompatibilityOption API_AVAILABLE(macosx(10.13),ios(11.0),tvos(11.0),watchos(4.0));
/* When NSPersistentStoreRemoteChangeNotificationPostOptionKey is set to YES, a NSPersistentStoreRemoteChangeNotification is posted for every
write to the store, this includes writes that are done by other processes
*/
COREDATA_EXTERN NSString * const NSPersistentStoreRemoteChangeNotificationPostOptionKey API_AVAILABLE(macosx(10.15),ios(13.0),tvos(13.0),watchos(6.0));
/* NSPersistentStoreRemoteChangeNotification is posted for all cross process writes to the store
The payload is the store UUID (NSStoreUUIDKey), store URL (NSPersistentStoreURLKey), and NSPersistentHistoryToken for the transaction (if NSPersistentHistoryTrackingKey was also set)
*/
COREDATA_EXTERN NSString * const NSPersistentStoreRemoteChangeNotification API_AVAILABLE(macosx(10.14),ios(12.0),tvos(12.0),watchos(5.0));
/* Keys found in the UserInfo for a NSPersistentStoreRemoteChangeNotification */
COREDATA_EXTERN NSString * const NSPersistentStoreURLKey API_AVAILABLE(macosx(10.14),ios(12.0),tvos(12.0),watchos(5.0));
COREDATA_EXTERN NSString * const NSPersistentHistoryTokenKey API_AVAILABLE(macosx(10.14),ios(12.0),tvos(12.0),watchos(5.0));
API_AVAILABLE(macosx(10.4),ios(3.0))
@interface NSPersistentStoreCoordinator : NSObject <NSLocking> {
}
- (instancetype)initWithManagedObjectModel:(NSManagedObjectModel *)model NS_DESIGNATED_INITIALIZER;
@property (readonly, strong) NSManagedObjectModel *managedObjectModel;
@property (readonly, strong) NSArray<__kindof NSPersistentStore *> *persistentStores;
/* custom name for a coordinator. Coordinators will set the label on their queue */
@property (nullable, copy) NSString *name API_AVAILABLE(macosx(10.10),ios(8.0));
- (nullable __kindof NSPersistentStore *)persistentStoreForURL:(NSURL *)URL;
- (NSURL *)URLForPersistentStore:(NSPersistentStore *)store;
/* Sets the URL for the specified store in the coordinator. For atomic stores, this will alter the location to which the next save operation will persist the file; for non-atomic stores, invoking this method will release the existing connection and create a new one at the specified URL. (For non-atomic stores, a store must pre-exist at the destination URL; a new store will not be created.)
*/
- (BOOL)setURL:(NSURL*)url forPersistentStore:(NSPersistentStore *)store API_AVAILABLE(macosx(10.5),ios(3.0));
/* Adds the store at the specified URL (of the specified type) to the coordinator with the model configuration and options. The configuration can be nil -- then it's the complete model; storeURL is usually the file location of the database
*/
- (nullable __kindof NSPersistentStore *)addPersistentStoreWithType:(NSString *)storeType configuration:(nullable NSString *)configuration URL:(nullable NSURL *)storeURL options:(nullable NSDictionary *)options error:(NSError **)error;
- (void)addPersistentStoreWithDescription:(NSPersistentStoreDescription *)storeDescription completionHandler:(void (^)(NSPersistentStoreDescription *, NSError * _Nullable))block API_AVAILABLE(macosx(10.12),ios(10.0),tvos(10.0),watchos(3.0)) NS_SWIFT_DISABLE_ASYNC;
- (BOOL)removePersistentStore:(NSPersistentStore *)store error:(NSError **)error;
/* Sets the metadata stored in the persistent store during the next save operation executed on it; the store type and UUID (NSStoreTypeKey and NSStoreUUIDKey) are always added automatically (but NSStoreUUIDKey is only added if it is not set manually as part of the dictionary argument)
*/
- (void)setMetadata:(nullable NSDictionary<NSString *, id> *)metadata forPersistentStore:(NSPersistentStore *)store;
/* Returns the metadata currently stored or to-be-stored in the persistent store
*/
- (NSDictionary<NSString *, id> *)metadataForPersistentStore:(NSPersistentStore *)store;
/* Given a URI representation of an object ID, returns an object ID if a matching store is available or nil if a matching store cannot be found (the URI representation contains a UUID of the store the ID is coming from, and the coordinator can match it against the stores added to it)
*/
- (nullable NSManagedObjectID *)managedObjectIDForURIRepresentation:(NSURL *)url;
/* Sends a request to all of the stores associated with this coordinator.
Returns an array if successful, nil if not.
The contents of the array will vary depending on the request type: NSFetchRequest results will be an array of managed objects, managed object IDs, or NSDictionaries;
NSSaveChangesRequests will an empty array. User defined requests will return arrays of arrays, where the nested array is the result returned form a single store.
*/
- (nullable id)executeRequest:(NSPersistentStoreRequest *)request withContext:(NSManagedObjectContext *)context error:(NSError**)error API_AVAILABLE(macosx(10.7),ios(5.0));
/* Returns a dictionary of the registered store types: the keys are the store type strings and the values are the NSPersistentStore subclasses wrapped in NSValues.
*/
@property(class, readonly, strong) NSDictionary<NSString *, NSValue *> *registeredStoreTypes API_AVAILABLE(macosx(10.5),ios(3.0));
/* Registers the specified NSPersistentStore subclass for the specified store type string. This method must be invoked before a custom subclass of NSPersistentStore can be loaded into a persistent store coordinator. Passing nil for the store class argument will unregister the specified store type.
*/
+ (void)registerStoreClass:(nullable Class)storeClass forStoreType:(NSString *)storeType API_AVAILABLE(macosx(10.5),ios(3.0));
/* Allows to access the metadata stored in a persistent store without warming up a CoreData stack; the guaranteed keys in this dictionary are NSStoreTypeKey and NSStoreUUIDKey. If storeType is nil, Core Data will guess which store class should be used to get/set the store file's metadata.
*/
+ (nullable NSDictionary<NSString *, id> *)metadataForPersistentStoreOfType:(NSString*)storeType URL:(NSURL *)url options:(nullable NSDictionary *)options error:(NSError **)error API_AVAILABLE(macosx(10.9),ios(7.0));
+ (BOOL)setMetadata:(nullable NSDictionary<NSString *, id> *)metadata forPersistentStoreOfType:(NSString*)storeType URL:(NSURL*)url options:(nullable NSDictionary*)options error:(NSError**)error API_AVAILABLE(macosx(10.9),ios(7.0));
/* Takes a URL to an external record file file and returns a dictionary with the derived elements
The keys in the dictionary are
NSEntityNameInPathKey - the name of the entity for the managed object instance
NSStoreUUIDInPathKey - UUID of the store containing the instance
NSStorePathKey - path to the store file (this is resolved to the store-file path contained in the support directory)
NSModelPathKey - path to the model file (this is resolved to the model.mom path contained in the support directory)
NSObjectURIKey - URI of the object instance.
*/
+ (NSDictionary *)elementsDerivedFromExternalRecordURL:(NSURL *)fileURL API_DEPRECATED("Spotlight integration is deprecated. Use CoreSpotlight integration instead.", macosx(10.6,10.13)) API_UNAVAILABLE(ios);
/* Creates and populates a store with the external records found at externalRecordsURL. The store is written to destinationURL using
options and with type storeType. If storeIdentifier is nil, the records for a single store at externalRecordsURL at imported.
externalRecordsURL must not exist as the store will be created from scratch (no appending to an existing store is allowed).
*/
- (nullable NSPersistentStore *)importStoreWithIdentifier:(nullable NSString *)storeIdentifier fromExternalRecordsDirectory:(NSURL *)externalRecordsURL toURL:(NSURL *)destinationURL options:(nullable NSDictionary *)options withType:(NSString *)storeType error:(NSError **)error API_DEPRECATED("Spotlight integration is deprecated. Use CoreSpotlight integration instead.", macosx(10.6,10.13)) API_UNAVAILABLE(ios);
/* Used for save as - performance may vary depending on the type of old and new store; the old store is usually removed from the coordinator by the migration operation, and therefore is no longer a useful reference after invoking this method
*/
- (nullable NSPersistentStore *)migratePersistentStore:(NSPersistentStore *)store toURL:(NSURL *)URL options:(nullable NSDictionary *)options withType:(NSString *)storeType error:(NSError **)error;
/* delete or truncate the target persistent store in accordance with the store class's requirements. It is important to pass similar options as addPersistentStoreWithType: ... SQLite stores will honor file locks, journal files, journaling modes, and other intricacies. It is not possible to unlink a database file safely out from underneath another thread or process, so this API performs a truncation. Other stores will default to using NSFileManager.
*/
- (BOOL)destroyPersistentStoreAtURL:(NSURL *)url withType:(NSString *)storeType options:(nullable NSDictionary *)options error:(NSError**)error API_AVAILABLE(macosx(10.11),ios(9.0));
/* copy or overwrite the target persistent store in accordance with the store class's requirements. It is important to pass similar options as addPersistentStoreWithType: ... SQLite stores will honor file locks, journal files, journaling modes, and other intricacies. Other stores will default to using NSFileManager.
*/
- (BOOL)replacePersistentStoreAtURL:(NSURL *)destinationURL destinationOptions:(nullable NSDictionary *)destinationOptions withPersistentStoreFromURL:(NSURL *)sourceURL sourceOptions:(nullable NSDictionary *)sourceOptions storeType:(NSString *)storeType error:(NSError**)error API_AVAILABLE(macosx(10.11),ios(9.0));
/* asynchronously performs the block on the coordinator's queue. Encapsulates an autorelease pool. */
- (void)performBlock:(void (^)(void))block API_AVAILABLE(macosx(10.10),ios(8.0));
/* synchronously performs the block on the coordinator's queue. May safely be called reentrantly. Encapsulates an autorelease pool. */
- (void)performBlockAndWait:(void (NS_NOESCAPE ^)(void))block API_AVAILABLE(macosx(10.10),ios(8.0));
/* Constructs a combined NSPersistentHistoryToken given an array of persistent stores. If stores is nil or an empty array, the NSPersistentHistoryToken will be constructed with all of the persistent stores in the coordinator. */
- (nullable NSPersistentHistoryToken *)currentPersistentHistoryTokenFromStores:(nullable NSArray*)stores API_AVAILABLE(macosx(10.14),ios(12.0),tvos(12.0),watchos(5.0));
/*
* DEPRECATED
*/
+ (nullable NSDictionary *)metadataForPersistentStoreWithURL:(NSURL *)url error:(NSError **)error API_DEPRECATED("Use -metadataForPersistentStoreOfType:URL:options:error: and pass in an options dictionary matching addPersistentStoreWithType", macosx(10.4,10.5));
- (void)lock API_DEPRECATED( "Use -performBlockAndWait: instead", macosx(10.4,10.10), ios(3.0,8.0));
- (void)unlock API_DEPRECATED( "Use -performBlockAndWait: instead", macosx(10.4,10.10), ios(3.0,8.0));
- (BOOL)tryLock API_DEPRECATED( "Use -performBlock: instead", macosx(10.4,10.10), ios(3.0,8.0));
+ (nullable NSDictionary<NSString *, id> *)metadataForPersistentStoreOfType:(nullable NSString *)storeType URL:(NSURL *)url error:(NSError **)error API_DEPRECATED("Use -metadataForPersistentStoreOfType:URL:options:error: and pass in an options dictionary matching addPersistentStoreWithType", macosx(10.5,10.11), ios(3.0,9.0));
+ (BOOL)setMetadata:(nullable NSDictionary<NSString *, id> *)metadata forPersistentStoreOfType:(nullable NSString *)storeType URL:(NSURL*)url error:(NSError **)error API_DEPRECATED("Use -setMetadata:forPersistentStoreOfType:URL:options:error: and pass in an options dictionary matching addPersistentStoreWithType", macosx(10.5,10.11), ios(3.0,9.0));
/*
Delete all ubiquitous content for all peers for the persistent store at the given URL and also delete the local store file. storeOptions should contain the options normally passed to addPersistentStoreWithType:URL:options:error. Errors may be returned as a result of file I/O, iCloud network or iCloud account issues.
*/
+ (BOOL)removeUbiquitousContentAndPersistentStoreAtURL:(NSURL *)storeURL options:(nullable NSDictionary *)options error:(NSError**)error API_DEPRECATED("Please see the release notes and Core Data documentation.", macosx(10.7,10.12), ios(5.0,10.0));
@end
/*
NSPersistentStoreUbiquitousTransitionTypeAccountAdded
This value indicates that a new iCloud account is available, and the persistent store in use will / did transition to the new account.
It is only possible to discern this state when the application is running, and therefore this transition type will only be posted if the account changes while the application is running or in the background.
NSPersistentStoreUbiquitousTransitionTypeAccountRemoved
This value indicates that no iCloud account is available, and the persistent store in use will / did transition to the “local” store.
It is only possible to discern this state when the application is running, and therefore this transition type will only be posted if the account is removed while the application is running or in the background.
NSPersistentStoreUbiquitousTransitionTypeContentRemoved
This value indicates that the user has wiped the contents of the iCloud account, usually using Delete All from Documents & Data in Settings. The Core Data integration will transition to an empty store file as a result of this event.
NSPersistentStoreUbiquitousTransitionTypeInitialImportCompleted
This value indicates that the Core Data integration has finished building a store file that is consistent with the contents of the iCloud account, and is readyto replace the fallback store with that file.
*/
typedef NS_ENUM(NSUInteger, NSPersistentStoreUbiquitousTransitionType) {
NSPersistentStoreUbiquitousTransitionTypeAccountAdded = 1,
NSPersistentStoreUbiquitousTransitionTypeAccountRemoved,
NSPersistentStoreUbiquitousTransitionTypeContentRemoved,
NSPersistentStoreUbiquitousTransitionTypeInitialImportCompleted
} API_DEPRECATED("Please see the release notes and Core Data documentation.", macosx(10.9,10.12), ios(7.0,10.0));
/* option indicating that a persistent store has a given name in ubiquity, this option is required for ubiquity to function */
COREDATA_EXTERN NSString * const NSPersistentStoreUbiquitousContentNameKey API_DEPRECATED("Please see the release notes and Core Data documentation.", macosx(10.7,10.12), ios(5.0,10.0));
/* option indicating the log path to use for ubiquity logs, this option is optional for ubiquity, a default path will be generated for the store if none is provided */
COREDATA_EXTERN NSString * const NSPersistentStoreUbiquitousContentURLKey API_DEPRECATED("Please see the release notes and Core Data documentation.", macosx(10.7,10.12), ios(5.0,10.0));
/* Notification sent after records are imported from the ubiquity store. The notification is sent with the object set to the NSPersistentStoreCoordinator instance which registered the store. */
COREDATA_EXTERN NSString * const NSPersistentStoreDidImportUbiquitousContentChangesNotification API_DEPRECATED("Please see the release notes and Core Data documentation.", macosx(10.7,10.12), ios(5.0,10.0));
/*
In the NSPersistentStoreCoordinatorStoresWillChangeNotification / NSPersistentStoreCoordinatorStoresDidChangeNotification userInfo dictionaries, this identifies the type of event. This could be one of the NSPersistentStoreUbiquitousTransitionType enum values as an NSNumber
*/
COREDATA_EXTERN NSString * const NSPersistentStoreUbiquitousTransitionTypeKey API_DEPRECATED("Please see the release notes and Core Data documentation.", macosx(10.9,10.12), ios(7.0,10.0));
/*
Optionally specified string which will be mixed in to Core Data’s identifier for each iCloud peer. The value must be an alphanumeric string without any special characters, whitespace or punctuation. The primary use for this option is to allow multiple applications on the same peer (device) to share a Core Data store integrated with iCloud. Each application will require its own store file.
*/
COREDATA_EXTERN NSString * const NSPersistentStoreUbiquitousPeerTokenOption API_DEPRECATED("Please see the release notes and Core Data documentation.", macosx(10.9,10.12), ios(7.0,10.0));
/* NSNumber boolean indicating that the receiver should remove all associated ubiquity metadata from a persistent store. This is mostly used during migration or copying to disassociate a persistent store file from an iCloud account
*/
COREDATA_EXTERN NSString * const NSPersistentStoreRemoveUbiquitousMetadataOption API_DEPRECATED("Please see the release notes and Core Data documentation.", macosx(10.9,10.12), ios(7.0,10.0));
/* NSString specifying the iCloud container identifier Core Data should pass to -URLForUbiquitousContainerIdentifier:
*/
COREDATA_EXTERN NSString * const NSPersistentStoreUbiquitousContainerIdentifierKey API_DEPRECATED("Please see the release notes and Core Data documentation.", macosx(10.9,10.12), ios(7.0,10.0));
/* NSNumber boolean indicating that the receiver should erase the local store file and rebuild it from the iCloud data in Mobile Documents.
*/
COREDATA_EXTERN NSString * const NSPersistentStoreRebuildFromUbiquitousContentOption API_DEPRECATED("Please see the release notes and Core Data documentation.", macosx(10.9,10.12), ios(7.0,10.0));
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSQueryGenerationToken.h | /*
NSQueryGenerationToken.h
Core Data
Copyright (c) 2016-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
NS_ASSUME_NONNULL_BEGIN
API_AVAILABLE(macosx(10.12),ios(10.0),tvos(10.0),watchos(3.0))
// Class used to track database generations for generational querying.
// See NSManagedObjectContext for details on how it is used.
@interface NSQueryGenerationToken : NSObject <NSCopying, NSSecureCoding>
@property (class, readonly, strong) NSQueryGenerationToken *currentQueryGenerationToken; // Used to inform a context that it should use the current generation
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/CoreDataErrors.h | /*
CoreDataErrors.h
Core Data
Copyright (c) 2004-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
/* NSError codes for Core Data added errors in NSCocoaErrorDomain. Foundation error codes can be found in <Foundation/FoundationErrors.h>. AppKit error codes can be found in <AppKit/AppKitErrors.h>.
*/
#import <CoreData/CoreDataDefines.h>
NS_ASSUME_NONNULL_BEGIN
// User info keys for errors created by Core Data:
COREDATA_EXTERN NSString * const NSDetailedErrorsKey API_AVAILABLE(macosx(10.4),ios(3.0)); // if multiple validation errors occur in one operation, they are collected in an array and added with this key to the "top-level error" of the operation
COREDATA_EXTERN NSString * const NSValidationObjectErrorKey API_AVAILABLE(macosx(10.4),ios(3.0)); // object that failed to validate for a validation error
COREDATA_EXTERN NSString * const NSValidationKeyErrorKey API_AVAILABLE(macosx(10.4),ios(3.0)); // key that failed to validate for a validation error
COREDATA_EXTERN NSString * const NSValidationPredicateErrorKey API_AVAILABLE(macosx(10.4),ios(3.0)); // for predicate-based validation, the predicate for the condition that failed to validate
COREDATA_EXTERN NSString * const NSValidationValueErrorKey API_AVAILABLE(macosx(10.4),ios(3.0)); // if non-nil, the value for the key that failed to validate for a validation error
COREDATA_EXTERN NSString * const NSAffectedStoresErrorKey API_AVAILABLE(macosx(10.4),ios(3.0)); // stores prompting an error
COREDATA_EXTERN NSString * const NSAffectedObjectsErrorKey API_AVAILABLE(macosx(10.4),ios(3.0)); // objects prompting an error
COREDATA_EXTERN NSString * const NSPersistentStoreSaveConflictsErrorKey API_AVAILABLE(macosx(10.7),ios(5.0)); // key in NSError's userInfo specifying the NSArray of NSMergeConflict
COREDATA_EXTERN NSString * const NSSQLiteErrorDomain API_AVAILABLE(macosx(10.5),ios(3.0)); // Predefined domain for SQLite errors, value of "code" will correspond to preexisting values in SQLite.
enum : NSInteger {
NSManagedObjectValidationError = 1550, // generic validation error
NSManagedObjectConstraintValidationError = 1551, // one or more uniqueness constraints were violated
NSValidationMultipleErrorsError = 1560, // generic message for error containing multiple validation errors
NSValidationMissingMandatoryPropertyError = 1570, // non-optional property with a nil value
NSValidationRelationshipLacksMinimumCountError = 1580, // to-many relationship with too few destination objects
NSValidationRelationshipExceedsMaximumCountError = 1590, // bounded, to-many relationship with too many destination objects
NSValidationRelationshipDeniedDeleteError = 1600, // some relationship with NSDeleteRuleDeny is non-empty
NSValidationNumberTooLargeError = 1610, // some numerical value is too large
NSValidationNumberTooSmallError = 1620, // some numerical value is too small
NSValidationDateTooLateError = 1630, // some date value is too late
NSValidationDateTooSoonError = 1640, // some date value is too soon
NSValidationInvalidDateError = 1650, // some date value fails to match date pattern
NSValidationStringTooLongError = 1660, // some string value is too long
NSValidationStringTooShortError = 1670, // some string value is too short
NSValidationStringPatternMatchingError = 1680, // some string value fails to match some pattern
NSValidationInvalidURIError = 1690, // some URI value cannot be represented as a string
NSManagedObjectContextLockingError = 132000, // can't acquire a lock in a managed object context
NSPersistentStoreCoordinatorLockingError = 132010, // can't acquire a lock in a persistent store coordinator
NSManagedObjectReferentialIntegrityError = 133000, // attempt to fire a fault pointing to an object that does not exist (we can see the store, we can't see the object)
NSManagedObjectExternalRelationshipError = 133010, // an object being saved has a relationship containing an object from another store
NSManagedObjectMergeError = 133020, // merge policy failed - unable to complete merging
NSManagedObjectConstraintMergeError = 133021, // merge policy failed - unable to complete merging due to multiple conflicting constraint violations
NSPersistentStoreInvalidTypeError = 134000, // unknown persistent store type/format/version
NSPersistentStoreTypeMismatchError = 134010, // returned by persistent store coordinator if a store is accessed that does not match the specified type
NSPersistentStoreIncompatibleSchemaError = 134020, // store returned an error for save operation (database level errors ie missing table, no permissions)
NSPersistentStoreSaveError = 134030, // unclassified save error - something we depend on returned an error
NSPersistentStoreIncompleteSaveError = 134040, // one or more of the stores returned an error during save (stores/objects that failed will be in userInfo)
NSPersistentStoreSaveConflictsError = 134050, // an unresolved merge conflict was encountered during a save. userInfo has NSPersistentStoreSaveConflictsErrorKey
NSCoreDataError = 134060, // general Core Data error
NSPersistentStoreOperationError = 134070, // the persistent store operation failed
NSPersistentStoreOpenError = 134080, // an error occurred while attempting to open the persistent store
NSPersistentStoreTimeoutError = 134090, // failed to connect to the persistent store within the specified timeout (see NSPersistentStoreTimeoutOption)
NSPersistentStoreUnsupportedRequestTypeError = 134091, // an NSPersistentStore subclass was passed an NSPersistentStoreRequest that it did not understand
NSPersistentStoreIncompatibleVersionHashError = 134100, // entity version hashes incompatible with data model
NSMigrationError = 134110, // general migration error
NSMigrationConstraintViolationError = 134111, // migration failed due to a violated uniqueness constraint
NSMigrationCancelledError = 134120, // migration failed due to manual cancellation
NSMigrationMissingSourceModelError = 134130, // migration failed due to missing source data model
NSMigrationMissingMappingModelError = 134140, // migration failed due to missing mapping model
NSMigrationManagerSourceStoreError = 134150, // migration failed due to a problem with the source data store
NSMigrationManagerDestinationStoreError = 134160, // migration failed due to a problem with the destination data store
NSEntityMigrationPolicyError = 134170, // migration failed during processing of the entity migration policy
NSSQLiteError = 134180, // general SQLite error
NSInferredMappingModelError = 134190, // inferred mapping model creation error
NSExternalRecordImportError = 134200, // general error encountered while importing external records
NSPersistentHistoryTokenExpiredError = 134301 // The history token passed to NSPersistentChangeRequest was invalid
};
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentHistoryChange.h | /*
NSPersistentHistoryChange.h
Core Data
Copyright (c) 2016-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSDictionary.h>
#import <Foundation/NSData.h>
#import <Foundation/NSSet.h>
NS_ASSUME_NONNULL_BEGIN
@class NSPersistentHistoryTransaction;
@class NSManagedObjectID;
@class NSPropertyDescription;
@class NSEntityDescription;
@class NSFetchRequest;
@class NSManagedObjectContext;
typedef NS_ENUM (NSInteger, NSPersistentHistoryChangeType) {
NSPersistentHistoryChangeTypeInsert,
NSPersistentHistoryChangeTypeUpdate,
NSPersistentHistoryChangeTypeDelete,
} API_AVAILABLE(macosx(10.13),ios(11.0),tvos(11.0),watchos(4.0));
API_AVAILABLE(macosx(10.13),ios(11.0),tvos(11.0),watchos(4.0))
@interface NSPersistentHistoryChange : NSObject <NSCopying>
+ (nullable NSEntityDescription *)entityDescriptionWithContext:(NSManagedObjectContext *)context API_AVAILABLE(macosx(10.15),ios(13.0),tvos(13.0),watchos(6.0));
@property (class,nullable,readonly) NSEntityDescription *entityDescription API_AVAILABLE(macosx(10.15),ios(13.0),tvos(13.0),watchos(6.0));
@property (class,nullable,readonly) NSFetchRequest *fetchRequest API_AVAILABLE(macosx(10.15),ios(13.0),tvos(13.0),watchos(6.0));
@property (readonly) int64_t changeID;
@property (readonly,copy) NSManagedObjectID *changedObjectID;
@property (readonly) NSPersistentHistoryChangeType changeType;
@property (nullable,readonly,copy) NSDictionary *tombstone;
@property (nullable,readonly,strong) NSPersistentHistoryTransaction *transaction;
@property (nullable,readonly,copy) NSSet<NSPropertyDescription *> *updatedProperties;
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentCloudKitContainer.h | /*
NSPersistentCloudKitContainer.h
Core Data
Copyright (c) 2018-2021, Apple Inc.
All rights reserved.
*/
#import <CoreData/NSPersistentContainer.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_OPTIONS(NSUInteger, NSPersistentCloudKitContainerSchemaInitializationOptions) {
NSPersistentCloudKitContainerSchemaInitializationOptionsNone = 0,
/*
Validate the model, and generate the records, but don't actually upload them to
CloudKit. This option is useful for unit testing to ensure your managed object model
is valid for use with CloudKit.
*/
NSPersistentCloudKitContainerSchemaInitializationOptionsDryRun = 1 << 1,
/*
Causes the generated records to be logged to console.
*/
NSPersistentCloudKitContainerSchemaInitializationOptionsPrintSchema = 1 << 2
};
/*
NSPersistentCloudKitContainer managed one or more persistent stores that are backed by a CloudKit private database.
By default, NSPersistentContainer contains a single store description which, if not customized otherwise, is assigned
to the first CloudKit container identifier in an application's entitlements.
Instances of NSPersistentCloudKitContainerOptions can be used to customize this behavior or create additional instances of
NSPersistentStoreDescription backed by different containers.
As NSPersistentCloudKitContainer is a subclass of NSPersistentContainer, it can manage both CloudKit backed and non-cloud stores.
*/
@class CKRecord;
@class CKRecordID;
API_AVAILABLE(macosx(10.15),ios(13.0),tvos(13.0),watchos(6.0))
@interface NSPersistentCloudKitContainer : NSPersistentContainer
/*
This method creates a set of representative CKRecord instances for all stores in the container
that use Core Data with CloudKit and uploads them to CloudKit. These records are "fully saturated"
in that they have a representative value set for every field Core Data might serialize for the given
managed object model.
After records are successfully uploaded the schema will be visible in the CloudKit dashboard and
the representative records will be deleted.
This method returns YES if these operations succeed, or NO and the underlying error if they fail.
Note: This method also validates the managed object model in use for a store, so a validation error
may be returned if the model is not valid for use with CloudKit.
*/
- (BOOL)initializeCloudKitSchemaWithOptions:(NSPersistentCloudKitContainerSchemaInitializationOptions)options
error:(NSError **)error;
/**
These methods provide access to the underlying CKRecord, or CKRecordID, backing a given NSManagedObjectID.
*/
- (nullable CKRecord *)recordForManagedObjectID:(NSManagedObjectID *)managedObjectID;
- (NSDictionary<NSManagedObjectID *, CKRecord *> *)recordsForManagedObjectIDs:(NSArray<NSManagedObjectID *> *)managedObjectIDs;
- (nullable CKRecordID *)recordIDForManagedObjectID:(NSManagedObjectID *)managedObjectID;
- (NSDictionary<NSManagedObjectID *, CKRecordID *> *)recordIDsForManagedObjectIDs:(NSArray<NSManagedObjectID *> *)managedObjectIDs;
/*
canUpdateRecordForManagedObjectWithID / canDeleteRecordForManagedObjectWithID indicate whether or not a given object assigned the provided NSManagedObjectID is mutable with respect to the instance of CKRecord that backs it with CloudKit.
In order for canUpdateRecordForManagedObjectWithID / canDeleteRecordForManagedObjectWithID to return YES, -[NSPersistentCloudKitContainer canModifyManagedObjectsInStore] must also be YES.
Returns YES if any of the following conditions are true:
- The provided objectID is a temporary objectID
- The provided objectID is assigned to a store not backed by a CKDatabase
- The provided objectID is assigned to a store backed by the Private CKDatabase
- The provided objectID is assigned to a store backed by the Public CKDatabase AND one of the following conditions is met:
- The object has yet to be uploaded to CloudKit (it will be assigned to the current user)
- The object has already been uploaded to CloudKit and is owned (indicated by CKRecord.creatorUserRecordID) by the current user
*/
- (BOOL)canUpdateRecordForManagedObjectWithID:(NSManagedObjectID *)objectID NS_SWIFT_NAME(canUpdateRecord(forManagedObjectWith:)) API_AVAILABLE(macosx(11.0),ios(14.0),tvos(14.0),watchos(7.0));
- (BOOL)canDeleteRecordForManagedObjectWithID:(NSManagedObjectID *)objectID NS_SWIFT_NAME(canDeleteRecord(forManagedObjectWith:)) API_AVAILABLE(macosx(11.0),ios(14.0),tvos(14.0),watchos(7.0));
/*
canModifyManagedObjectsInStore indicates whether or not a given store is mutable when used with CloudKit.
This method return YES if the current user has write permissions to the CKDatabase that backs the store.
For example:
- When using the Public database, devices without an iCloud account can read data but not write any.
- When using the Private database, this method always returns YES, even if no iCloud account is present on the device.
*/
- (BOOL)canModifyManagedObjectsInStore:(NSPersistentStore *)store API_AVAILABLE(macosx(11.0),ios(14.0),tvos(14.0),watchos(7.0));
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSCoreDataCoreSpotlightDelegate.h | /*
NSCoreDataCoreSpotlightDelegate.h
Core Data
Copyright (c) 2017-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
@class NSManagedObjectContext;
@class NSPersistentStoreDescription;
@class NSManagedObjectModel;
@class NSManagedObject;
@class CSSearchableIndex;
@class CSSearchableItemAttributeSet;
NS_ASSUME_NONNULL_BEGIN
/*
* When a change occurs to an entity or entities that are indexed in Spotlight
* using NSCoreDataCoreSpotlightDelegate, that index is updated asynchronously.
* NSCoreDataCoreSpotlightDelegate will post NSCoreDataCoreSpotlightDelegateIndexDidUpdateNotification
* when the index is updated.
*
* This notification will have a .userInfo that contains two key-value pairs:
* NSStoreUUIDKey: A NSString UUID of the store that contains the
* NSCoreDataCoreSpotlightDelegate that updated its index.
* NSPersistentHistoryTokenKey: The NSPersistentHistoryToken of the store that
* contains the NSCoreDataCoreSpotlightDelegate that updated its index.
*/
COREDATA_EXTERN NSNotificationName const NSCoreDataCoreSpotlightDelegateIndexDidUpdateNotification API_AVAILABLE(macosx(11.0),ios(14.0),tvos(NA),watchos(NA));
/* NSCoreDataSpotlightDelegate implements the CSSearchableIndexDelegate API, but can't
publicly declare it due to linkage requirements.
*/
API_AVAILABLE(macosx(10.13),ios(11.0)) API_UNAVAILABLE(tvos,watchos)
@interface NSCoreDataCoreSpotlightDelegate : NSObject {
}
/*
* Returns if indexing is enabled or not.
*/
@property (getter=isIndexingEnabled, readonly) BOOL indexingEnabled API_AVAILABLE(macosx(12.0),ios(15.0),tvos(NA),watchos(NA));
/* CoreSpotlight domain identifer; default is the store's identifier */
- (NSString *)domainIdentifier;
/* CoreSpotlight index name; default nil */
- (nullable NSString *)indexName;
- (instancetype)init NS_UNAVAILABLE;
/*
* Designated initializer for NSCoreDataCoreSpotlightDelegate. If this method is used to create the object,
* -[NSCoreDataCoreSpotlightDelegate startSpotlightIndexing] must be called for the delegate to begin indexing.
*
* NSCoreDataSpotlightDelegate requires that
* - the store type is NSSQLiteStoreType.
* - the store has persistent history tracking enabled.
*/
- (instancetype)initForStoreWithDescription:(NSPersistentStoreDescription *)description
coordinator:(NSPersistentStoreCoordinator *)psc NS_DESIGNATED_INITIALIZER API_AVAILABLE(macosx(10.15),ios(13.0),tvos(NA),watchos(NA));
- (instancetype)initForStoreWithDescription:(NSPersistentStoreDescription *)description
model:(NSManagedObjectModel *)model API_DEPRECATED_WITH_REPLACEMENT("initForStoreWithDescription:coordinator:", macosx(10.13,12.0),ios(11.0,15.0));
/*
* Starts Spotlight indexing.
*/
- (void)startSpotlightIndexing API_AVAILABLE(macosx(10.15),ios(13.0),tvos(NA),watchos(NA));
/*
* Stops Spotlight indexing.
*/
- (void)stopSpotlightIndexing API_AVAILABLE(macosx(10.15),ios(13.0),tvos(NA),watchos(NA));
/*
* Deletes all searchable items for the configured Spotlight index. Calling this method may return
* errors from lower layer dependencies, such as Core Data and Core Spotlight.
*/
- (void)deleteSpotlightIndexWithCompletionHandler:(void (^)(NSError * _Nullable error))completionHandler API_AVAILABLE(macosx(11.0),ios(14.0),tvos(NA),watchos(NA));
/* Create the searchable attributes for the managed object. Override to return nil if you do not want the object included in the index.
*/
- (nullable CSSearchableItemAttributeSet *)attributeSetForObject:(NSManagedObject*)object;
/* CSSearchableIndexDelegate conformance */
- (void)searchableIndex:(CSSearchableIndex *)searchableIndex reindexAllSearchableItemsWithAcknowledgementHandler:(void (^)(void))acknowledgementHandler;
- (void)searchableIndex:(CSSearchableIndex *)searchableIndex reindexSearchableItemsWithIdentifiers:(NSArray <NSString *> *)identifiers
acknowledgementHandler:(void (^)(void))acknowledgementHandler;
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSFetchRequest.h | /*
NSFetchRequest.h
Core Data
Copyright (c) 2004-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <CoreData/NSPersistentStoreRequest.h>
#import <CoreData/NSManagedObject.h>
#import <CoreData/NSManagedObjectID.h>
NS_ASSUME_NONNULL_BEGIN
@class NSEntityDescription;
@class NSManagedObjectModel;
@class NSPredicate;
@class NSPersistentStore;
@class NSSortDescriptor;
/* Definition of the possible result types a fetch request can return. */
typedef NS_OPTIONS(NSUInteger, NSFetchRequestResultType) {
NSManagedObjectResultType = 0x00,
NSManagedObjectIDResultType = 0x01,
NSDictionaryResultType API_AVAILABLE(macosx(10.6), ios(3.0)) = 0x02,
NSCountResultType API_AVAILABLE(macosx(10.6), ios(3.0)) = 0x04
};
/* Protocol conformance for possible result types a fetch request can return. */
@protocol NSFetchRequestResult <NSObject>
@end
@interface NSNumber (NSFetchedResultSupport) <NSFetchRequestResult>
@end
@interface NSDictionary (NSFetchedResultSupport) <NSFetchRequestResult>
@end
@interface NSManagedObject (NSFetchedResultSupport) <NSFetchRequestResult>
@end
@interface NSManagedObjectID (NSFetchedResultSupport) <NSFetchRequestResult>
@end
API_AVAILABLE(macosx(10.4),ios(3.0))
@interface NSFetchRequest<__covariant ResultType:id<NSFetchRequestResult>> : NSPersistentStoreRequest <NSCoding, NSCopying> {
}
+ (instancetype)fetchRequestWithEntityName:(NSString*)entityName API_AVAILABLE(macosx(10.7),ios(4.0));
- (instancetype)init NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithEntityName:(NSString*)entityName API_AVAILABLE(macosx(10.7),ios(4.0));
// Executes the fetch request using the current managed object context. This method must be called from within a block submitted to a managed object context.
- (nullable NSArray<ResultType> *)execute:(NSError **)error API_AVAILABLE(macosx(10.12),ios(10.0),tvos(10.0),watchos(3.0));
@property (nullable, nonatomic, strong) NSEntityDescription *entity;
@property (nullable, nonatomic, readonly, strong) NSString *entityName API_AVAILABLE(macosx(10.7),ios(4.0));
@property (nullable, nonatomic, strong) NSPredicate *predicate;
@property (nullable, nonatomic, strong) NSArray<NSSortDescriptor *> *sortDescriptors;
@property (nonatomic) NSUInteger fetchLimit;
@property (nullable, nonatomic, strong) NSArray<NSPersistentStore *> *affectedStores;
/* Returns/sets the result type of the fetch request (the instance type of objects returned from executing the request.) Setting the value to NSManagedObjectIDResultType will demote any sort orderings to "best effort" hints if property values are not included in the request. Defaults to NSManagedObjectResultType.
*/
@property (nonatomic) NSFetchRequestResultType resultType API_AVAILABLE(macosx(10.5),ios(3.0));
/* Returns/sets if the fetch request includes subentities. If set to NO, the request will fetch objects of exactly the entity type of the request; if set to YES, the request will include all subentities of the entity for the request. Defaults to YES.
*/
@property (nonatomic) BOOL includesSubentities API_AVAILABLE(macosx(10.5),ios(3.0));
/* Returns/sets if, when the fetch is executed, property data is obtained from the persistent store. If the value is set to NO, the request will not obtain property information, but only information to identify each object (used to create NSManagedObjectIDs.) If managed objects for these IDs are later faulted (as a result attempting to access property values), they will incur subsequent access to the persistent store to obtain their property values. Defaults to YES.
*/
@property (nonatomic) BOOL includesPropertyValues API_AVAILABLE(macosx(10.5),ios(3.0));
/* Returns/sets if the objects resulting from a fetch request are faults. If the value is set to NO, the returned objects are pre-populated with their property values (making them fully-faulted objects, which will immediately return NO if sent the -isFault message.) If the value is set to YES, the returned objects are not pre-populated (and will receive a -didFireFault message when the properties are accessed the first time.) This setting is not utilized if the result type of the request is NSManagedObjectIDResultType, as object IDs do not have property values. Defaults to YES.
*/
@property (nonatomic) BOOL returnsObjectsAsFaults API_AVAILABLE(macosx(10.5),ios(3.0));
/* Returns/sets an array of relationship keypaths to prefetch along with the entity for the request. The array contains keypath strings in NSKeyValueCoding notation, as you would normally use with valueForKeyPath. (Prefetching allows Core Data to obtain developer-specified related objects in a single fetch (per entity), rather than incurring subsequent access to the store for each individual record as their faults are tripped.) Defaults to an empty array (no prefetching.)
*/
@property (nullable, nonatomic, copy) NSArray<NSString *> *relationshipKeyPathsForPrefetching API_AVAILABLE(macosx(10.5),ios(3.0));
/* Results accommodate the currently unsaved changes in the NSManagedObjectContext. When disabled, the fetch request skips checking unsaved changes and only returns objects that matched the predicate in the persistent store. Defaults to YES.
*/
@property (nonatomic) BOOL includesPendingChanges API_AVAILABLE(macosx(10.6),ios(3.0));
/* Returns/sets if the fetch request returns only distinct values for the fields specified by propertiesToFetch. This value is only used for NSDictionaryResultType. Defaults to NO. */
@property (nonatomic) BOOL returnsDistinctResults API_AVAILABLE(macosx(10.6),ios(3.0));
/* Specifies a collection of either NSPropertyDescriptions or NSString property names that should be fetched. The collection may represent attributes, to-one relationships, or NSExpressionDescription. If NSDictionaryResultType is set, the results of the fetch will be dictionaries containing key/value pairs where the key is the name of the specified property description. If NSManagedObjectResultType is set, then NSExpressionDescription cannot be used, and the results are managed object faults partially pre-populated with the named properties */
@property (nullable, nonatomic, copy) NSArray *propertiesToFetch API_AVAILABLE(macosx(10.6),ios(3.0));
/* Allows you to specify an offset at which rows will begin being returned. Effectively, the request will skip over 'offset' number of matching entries. For example, given a fetch which would normally return a, b, c, and d, specifying an offset of 1 will return b, c, and d and an offset of 4 will return an empty array. Offsets are ignored in nested requests such as subqueries. Default value is 0. */
@property (nonatomic) NSUInteger fetchOffset API_AVAILABLE(macosx(10.6),ios(3.0));
/* This breaks the result set into batches. The entire request will be evaluated, and the identities of all matching objects will be recorded, but no more than batchSize objects' data will be fetched from the persistent store at a time. The array returned from executing the request will be a subclass that transparently faults batches on demand. For purposes of thread safety, the returned array proxy is owned by the NSManagedObjectContext the request is executed against, and should be treated as if it were a managed object registered with that context. A batch size of 0 is treated as infinite, which disables the batch faulting behavior. The default is 0. */
@property (nonatomic) NSUInteger fetchBatchSize API_AVAILABLE(macosx(10.6),ios(3.0));
@property (nonatomic) BOOL shouldRefreshRefetchedObjects API_AVAILABLE(macosx(10.7),ios(5.0));
/* Specifies the way in which data should be grouped before a select statement is run in an SQL database.
Values passed to propertiesToGroupBy must be NSPropertyDescriptions, NSExpressionDescriptions, or keypath strings; keypaths can not contain
any to-many steps.
If GROUP BY is used, then you must set the resultsType to NSDictionaryResultsType, and the SELECT values must be literals, aggregates,
or columns specified in the GROUP BY. Aggregates will operate on the groups specified in the GROUP BY rather than the whole table. */
@property (nullable, nonatomic, copy) NSArray *propertiesToGroupBy API_AVAILABLE(macosx(10.7),ios(5.0));
/* Specifies a predicate that will be used to filter rows being returned by a query containing a GROUP BY. If a having predicate is
supplied, it will be run after the GROUP BY. Specifying a HAVING predicate requires that a GROUP BY also be specified. */
@property (nullable, nonatomic, strong) NSPredicate *havingPredicate API_AVAILABLE(macosx(10.7),ios(5.0));
@end
@class NSAsynchronousFetchResult<ResultType:id<NSFetchRequestResult>>;
typedef void (^NSPersistentStoreAsynchronousFetchResultCompletionBlock)(NSAsynchronousFetchResult *result);
API_AVAILABLE(macosx(10.10),ios(8.0))
@interface NSAsynchronousFetchRequest<ResultType:id<NSFetchRequestResult>> : NSPersistentStoreRequest {
}
@property (strong, readonly) NSFetchRequest<ResultType> * fetchRequest;
@property (nullable, strong, readonly) NSPersistentStoreAsynchronousFetchResultCompletionBlock completionBlock;
@property (nonatomic) NSInteger estimatedResultCount;
- (instancetype)initWithFetchRequest:(NSFetchRequest<ResultType> *)request completionBlock:(nullable void(^)(NSAsynchronousFetchResult<ResultType> *))blk;
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSAttributeDescription.h | /*
NSAttributeDescription.h
Core Data
Copyright (c) 2004-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <CoreData/NSPropertyDescription.h>
NS_ASSUME_NONNULL_BEGIN
@class NSEntityDescription;
// types explicitly distinguish between bit sizes to ensure data store independence of the underlying operating system
typedef NS_ENUM(NSUInteger, NSAttributeType) {
NSUndefinedAttributeType = 0,
NSInteger16AttributeType = 100,
NSInteger32AttributeType = 200,
NSInteger64AttributeType = 300,
NSDecimalAttributeType = 400,
NSDoubleAttributeType = 500,
NSFloatAttributeType = 600,
NSStringAttributeType = 700,
NSBooleanAttributeType = 800,
NSDateAttributeType = 900,
NSBinaryDataAttributeType = 1000,
NSUUIDAttributeType API_AVAILABLE(macosx(10.13), ios(11.0), tvos(11.0), watchos(4.0)) = 1100,
NSURIAttributeType API_AVAILABLE(macosx(10.13), ios(11.0), tvos(11.0), watchos(4.0)) = 1200,
NSTransformableAttributeType API_AVAILABLE(macosx(10.5), ios(3.0)) = 1800, // If your attribute is of NSTransformableAttributeType, the attributeValueClassName must be set or attribute value class must implement NSCopying.
NSObjectIDAttributeType API_AVAILABLE(macosx(10.6), ios(3.0)) = 2000
};
// Attributes represent individual values like strings, numbers, dates, etc.
API_AVAILABLE(macosx(10.4),ios(3.0))
@interface NSAttributeDescription : NSPropertyDescription {
}
// NSUndefinedAttributeType is valid for transient properties - Core Data will still track the property as an id value and register undo/redo actions, etc. NSUndefinedAttributeType is illegal for non-transient properties.
@property () NSAttributeType attributeType;
@property (nullable, copy) NSString *attributeValueClassName;
@property (nullable, retain) id defaultValue; // value is retained and not copied
/* Returns the version hash for the attribute. This value includes the versionHash information from the NSPropertyDescription superclass, and the attribute type.*/
@property (readonly, copy) NSData *versionHash API_AVAILABLE(macosx(10.5),ios(3.0));
/* The name of the transformer used to convert a NSTransformedAttributeType. The transformer must output NSData from transformValue and allow reverse transformation. If this value is not set, or set to nil, Core Data will default to using a transformer which uses NSCoding to archive/unarchive the attribute value.*/
@property (nullable, copy) NSString *valueTransformerName API_AVAILABLE(macosx(10.5),ios(3.0));
@property () BOOL allowsExternalBinaryDataStorage API_AVAILABLE(macosx(10.7),ios(5.0));
/* Indicates if the value of the attribute should be captured on delete when Persistent History is enabled */
@property () BOOL preservesValueInHistoryOnDeletion API_AVAILABLE(macosx(10.15),ios(13.0),tvos(13.0),watchos(6.0));
/*
* This property can be set to enable encryption-at-rest on data stored in CloudKit servers.
*
* There are several restrictions on how clients can use this property:
* 1. Attributes to be encrypted must be new additions to the CloudKit schema. Attributes that already exist in the production schema cannot be changed to support encryption.
* 2. Attributes cannot (ever) change their encryption state in the CloudKit schema. Once something is encrypted (or not) it will forever be so.
*
* Note: This property does not affect the data in the persistent store. Local file encryption should continue to be managed by using NSFileProtection and other standard platform security mechanisms.
*/
@property () BOOL allowsCloudEncryption API_AVAILABLE(macosx(12.0),ios(15.0),tvos(15.0),watchos(8.0));
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObjectContext.h | /*
NSManagedObjectContext.h
Core Data
Copyright (c) 2004-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSSet.h>
#import <Foundation/NSDate.h>
#import <Foundation/NSLock.h>
#import <CoreData/CoreDataDefines.h>
NS_ASSUME_NONNULL_BEGIN
@class NSError;
@class NSFetchRequest;
@class NSPersistentStoreRequest;
@class NSPersistentStoreResult;
@class NSManagedObject;
@class NSManagedObjectID;
@class NSPersistentStore;
@class NSPersistentStoreCoordinator;
@class NSPropertyDescription;
@class NSQueryGenerationToken;
@class NSUndoManager;
@class NSNotification;
// Notifications immediately before and immediately after the context saves. The user info dictionary contains information about the objects that changed and what changed
COREDATA_EXTERN NSString * const NSManagedObjectContextWillSaveNotification API_AVAILABLE(macosx(10.5),ios(3.0));
COREDATA_EXTERN NSString * const NSManagedObjectContextDidSaveNotification API_AVAILABLE(macosx(10.4),ios(3.0));
// Notification when objects in a context changed: the user info dictionary contains information about the objects that changed and what changed
COREDATA_EXTERN NSString * const NSManagedObjectContextObjectsDidChangeNotification API_AVAILABLE(macosx(10.4),ios(3.0));
// Notification when objects in a context changed: the user info dictionary contains information about the objectIDs that changed
COREDATA_EXTERN NSString * const NSManagedObjectContextDidSaveObjectIDsNotification API_AVAILABLE(macosx(10.12.4),ios(10.3),tvos(10.2),watchos(3.2));
COREDATA_EXTERN NSString * const NSManagedObjectContextDidMergeChangesObjectIDsNotification API_AVAILABLE(macosx(10.12.4),ios(10.3),tvos(10.2),watchos(3.2));
// User info keys for NSManagedObjectContextObjectsDidChangeNotification: the values for these keys are sets of managed objects
COREDATA_EXTERN NSString * const NSInsertedObjectsKey API_AVAILABLE(macosx(10.4),ios(3.0));
COREDATA_EXTERN NSString * const NSUpdatedObjectsKey API_AVAILABLE(macosx(10.4),ios(3.0));
COREDATA_EXTERN NSString * const NSDeletedObjectsKey API_AVAILABLE(macosx(10.4),ios(3.0));
COREDATA_EXTERN NSString * const NSRefreshedObjectsKey API_AVAILABLE(macosx(10.5),ios(3.0));
COREDATA_EXTERN NSString * const NSInvalidatedObjectsKey API_AVAILABLE(macosx(10.5),ios(3.0));
COREDATA_EXTERN NSString * const NSManagedObjectContextQueryGenerationKey API_AVAILABLE(macosx(10.12),ios(10.0),tvos(10.0),watchos(3.0));
// User info keys for NSManagedObjectContextObjectsDidChangeNotification: the values for these keys are arrays of objectIDs
COREDATA_EXTERN NSString * const NSInvalidatedAllObjectsKey API_AVAILABLE(macosx(10.5),ios(3.0)); // All objects in the context have been invalidated
// User info keys for NSManagedObjectContextDidSaveObjectIDsNotification: the values for these keys are sets of objectIDs
COREDATA_EXTERN NSString * const NSInsertedObjectIDsKey API_AVAILABLE(macosx(10.12.4),ios(10.3),tvos(10.2),watchos(3.2));
COREDATA_EXTERN NSString * const NSUpdatedObjectIDsKey API_AVAILABLE(macosx(10.12.4),ios(10.3),tvos(10.2),watchos(3.2));
COREDATA_EXTERN NSString * const NSDeletedObjectIDsKey API_AVAILABLE(macosx(10.12.4),ios(10.3),tvos(10.2),watchos(3.2));
COREDATA_EXTERN NSString * const NSRefreshedObjectIDsKey API_AVAILABLE(macosx(10.12.4),ios(10.3),tvos(10.2),watchos(3.2));
COREDATA_EXTERN NSString * const NSInvalidatedObjectIDsKey API_AVAILABLE(macosx(10.12.4),ios(10.3),tvos(10.2),watchos(3.2));
// Default policy for all managed object contexts - save returns with an error that contains the object IDs of the objects that had conflicts(NSInsertedObjectsKey, NSUpdatedObjectsKey).
COREDATA_EXTERN id NSErrorMergePolicy API_AVAILABLE(macosx(10.4),ios(3.0));
// This singleton policy merges conflicts between the persistent store's version of the object and the current in memory version. The merge occurs by individual property. For properties which have been changed in both the external source and in memory, the external changes trump the in memory ones.
COREDATA_EXTERN id NSMergeByPropertyStoreTrumpMergePolicy API_AVAILABLE(macosx(10.4),ios(3.0));
// This singleton policy merges conflicts between the persistent store's version of the object and the current in memory version. The merge occurs by individual property. For properties which have been changed in both the external source and in memory, the in memory changes trump the external ones.
COREDATA_EXTERN id NSMergeByPropertyObjectTrumpMergePolicy API_AVAILABLE(macosx(10.4),ios(3.0));
// This singleton policy overwrites all state for the changed objects in conflict The current object's state is pushed upon the persistent store.
COREDATA_EXTERN id NSOverwriteMergePolicy API_AVAILABLE(macosx(10.4),ios(3.0));
// This singleton policy discards all state for the changed objects in conflict. The persistent store's version of the object is used.
COREDATA_EXTERN id NSRollbackMergePolicy API_AVAILABLE(macosx(10.4),ios(3.0));
typedef NS_ENUM(NSUInteger, NSManagedObjectContextConcurrencyType) {
NSConfinementConcurrencyType API_DEPRECATED( "Use another NSManagedObjectContextConcurrencyType", macosx(10.4,10.11), ios(3.0,9.0)) = 0x00,
NSPrivateQueueConcurrencyType = 0x01,
NSMainQueueConcurrencyType = 0x02
} API_AVAILABLE(macosx(10.7), ios(5.0));
API_AVAILABLE(macosx(10.4),ios(3.0))
@interface NSManagedObjectContext : NSObject <NSCoding, NSLocking> {
}
+ (instancetype)new API_DEPRECATED( "Use -initWithConcurrencyType: instead", macosx(10.4,10.11), ios(3.0,9.0));
- (instancetype)init API_DEPRECATED( "Use -initWithConcurrencyType: instead", macosx(10.4,10.11), ios(3.0,9.0));
- (instancetype)initWithConcurrencyType:(NSManagedObjectContextConcurrencyType)ct NS_DESIGNATED_INITIALIZER API_AVAILABLE(macosx(10.7),ios(5.0));
/* asynchronously performs the block on the context's queue. Encapsulates an autorelease pool and a call to processPendingChanges */
- (void)performBlock:(void (^)(void))block API_AVAILABLE(macosx(10.7),ios(5.0));
/* synchronously performs the block on the context's queue. May safely be called reentrantly. */
- (void)performBlockAndWait:(void (NS_NOESCAPE ^)(void))block API_AVAILABLE(macosx(10.7),ios(5.0));
/* coordinator which provides model and handles persistency (multiple contexts can share a coordinator) */
@property (nullable, strong) NSPersistentStoreCoordinator *persistentStoreCoordinator;
@property (nullable, strong) NSManagedObjectContext *parentContext API_AVAILABLE(macosx(10.7),ios(5.0));
/* custom label for a context. NSPrivateQueueConcurrencyType contexts will set the label on their queue */
@property (nullable, copy) NSString *name API_AVAILABLE(macosx(10.10),ios(8.0));
@property (nullable, nonatomic, strong) NSUndoManager *undoManager;
@property (nonatomic, readonly) BOOL hasChanges;
@property (nonatomic, readonly, strong) NSMutableDictionary *userInfo API_AVAILABLE(macosx(10.7),ios(5.0));
@property (readonly) NSManagedObjectContextConcurrencyType concurrencyType API_AVAILABLE(macosx(10.7),ios(5.0));
/* returns the object for the specified ID if it is registered in the context already or nil. It never performs I/O. */
- (nullable __kindof NSManagedObject *)objectRegisteredForID:(NSManagedObjectID *)objectID;
/* returns the object for the specified ID if it is already registered, otherwise it creates a fault corresponding to that objectID. It never returns nil, and never performs I/O. The object specified by objectID is assumed to exist, and if that assumption is wrong the fault may throw an exception when used. */
- (__kindof NSManagedObject *)objectWithID:(NSManagedObjectID *)objectID;
/* returns the object for the specified ID if it is already registered in the context, or faults the object into the context. It might perform I/O if the data is uncached. If the object cannot be fetched, or does not exist, or cannot be faulted, it returns nil. Unlike -objectWithID: it never returns a fault. */
- (nullable __kindof NSManagedObject*)existingObjectWithID:(NSManagedObjectID*)objectID error:(NSError**)error API_AVAILABLE(macosx(10.6),ios(3.0));
// method to fetch objects from the persistent stores into the context (fetch request defines the entity and predicate as well as a sort order for the objects); context will match the results from persistent stores with current changes in the context (so inserted objects are returned even if they are not persisted yet); to fetch a single object with an ID if it is not guaranteed to exist and thus -objectWithObjectID: cannot be used, one would create a predicate like [NSComparisonPredicate predicateWithLeftExpression:[NSExpression expressionForKeyPath:@"objectID"] rightExpression:[NSExpression expressionForConstantValue:<object id>] modifier:NSDirectPredicateModifier type:NSEqualToPredicateOperatorType options:0]
- (nullable NSArray *)executeFetchRequest:(NSFetchRequest *)request error:(NSError **)error NS_REFINED_FOR_SWIFT;
// returns the number of objects a fetch request would have returned if it had been passed to -executeFetchRequest:error:. If an error occurred during the processing of the request, this method will return NSNotFound.
- (NSUInteger) countForFetchRequest: (NSFetchRequest *)request error: (NSError **)error API_AVAILABLE(macosx(10.5),ios(3.0)) __attribute__((swift_error(nonnull_error)));
// Method to pass a request to the store without affecting the contents of the managed object context.
// Will return an NSPersistentStoreResult which may contain additional information about the result of the action
// (ie a batch update result may contain the object IDs of the objects that were modified during the update).
// A request may succeed in some stores and fail in others. In this case, the error will contain information
// about each individual store failure.
// Will always reject NSSaveChangesRequests.
- (nullable __kindof NSPersistentStoreResult *)executeRequest:(NSPersistentStoreRequest*)request error:(NSError **)error API_AVAILABLE(macosx(10.10),ios(8.0));
- (void)insertObject:(NSManagedObject *)object;
- (void)deleteObject:(NSManagedObject *)object;
// if flag is YES, merges an object with the state of the object available in the persistent store coordinator; if flag is NO, simply refaults an object without merging (which also causes other related managed objects to be released, so you can use this method to trim the portion of your object graph you want to hold in memory)
- (void)refreshObject:(NSManagedObject *)object mergeChanges:(BOOL)flag;
// marks an object for conflict detection, which means that the save fails if the object has been altered in the persistent store by another application. This allows optimistic locking for unchanged objects. Conflict detection is always performed on changed or deleted objects.
- (void)detectConflictsForObject:(NSManagedObject *)object;
// key-value observation
- (void)observeValueForKeyPath:(nullable NSString *)keyPath ofObject:(nullable id)object change:(nullable NSDictionary<NSString *, id> *)change context:(nullable void *)context;
// usually contexts process changes to the object graph coalesced at the end of the event - this method triggers it explicitly
- (void)processPendingChanges;
// specifies the store a newly inserted object will be saved in. Unnecessary unless there are multiple writable persistent stores added to the NSPersistentStoreCoordinator which support this object's entity.
- (void)assignObject:(id)object toPersistentStore:(NSPersistentStore *)store;
@property (nonatomic, readonly, strong) NSSet<__kindof NSManagedObject *> *insertedObjects;
@property (nonatomic, readonly, strong) NSSet<__kindof NSManagedObject *> *updatedObjects;
@property (nonatomic, readonly, strong) NSSet<__kindof NSManagedObject *> *deletedObjects;
@property (nonatomic, readonly, strong) NSSet<__kindof NSManagedObject *> *registeredObjects;
- (void)undo;
- (void)redo;
- (void)reset;
- (void)rollback;
- (BOOL)save:(NSError **)error;
/* calls -refreshObject:mergeChanges: on all currently registered objects with this context. It handles dirtied objects and clearing the context reference queue */
- (void)refreshAllObjects API_AVAILABLE(macosx(10.11),ios(8.3));
- (void)lock API_DEPRECATED( "Use a queue style context and -performBlockAndWait: instead", macosx(10.4,10.10), ios(3.0,8.0));
- (void)unlock API_DEPRECATED( "Use a queue style context and -performBlockAndWait: instead", macosx(10.4,10.10), ios(3.0,8.0));
- (BOOL)tryLock API_DEPRECATED( "Use a queue style context and -performBlock: instead", macosx(10.4,10.10), ios(3.0,8.0));
// whether or not the context propagates deletes to related objects at the end of the event, or only at save time
@property (nonatomic) BOOL propagatesDeletesAtEndOfEvent; // The default is YES.
// whether or not the context holds a retain on all registered objects, or only upon objects necessary for a pending save (inserted, updated, deleted, or locked)
@property (nonatomic) BOOL retainsRegisteredObjects; // The default is NO.
/* set the rule to handle inaccessible faults. If YES, then the managed object is marked deleted and all its properties, including scalars, nonnullable, and mandatory properties, will be nil or zero’d out. If NO, the context will throw an exception. Managed objects that are inaccessible because their context is nil due to memory management issues will throw an exception regardless. */
@property BOOL shouldDeleteInaccessibleFaults API_AVAILABLE(macosx(10.11),ios(9.0));
/* this method will not be called from APIs which return an NSError like -existingObjectWithID:error: nor for managed objects with a nil context (e.g. the fault is inaccessible because the object or its context have been released) this method will not be called if Core Data determines there is an unambiguously correct action to recover. This might happen if a fault was tripped during delete propagation. In that case, the fault will simply be deleted. triggeringProperty may be nil when either all properties are involved, or Core Data is unable to determine the reason for firing the fault. the default implementation logs and then returns the value of -shouldDeleteInaccessibleFaults. */
- (BOOL)shouldHandleInaccessibleFault:(NSManagedObject*)fault forObjectID:(NSManagedObjectID*)oid triggeredByProperty:(nullable NSPropertyDescription*)property API_AVAILABLE(macosx(10.11),ios(9.0));
// Staleness interval is the relative time until cached data should be considered stale. The value is applied on a per object basis. For example, a value of 300.0 informs the context to utilize cached information for no more than 5 minutes after that object was originally fetched. This does not affect objects currently in use. Principly, this controls whether fulfilling a fault uses data previously fetched by the application, or issues a new fetch. It is a hint which may not be supported by all persistent store types.
@property () NSTimeInterval stalenessInterval; // a negative value is considered infinite. The default is infinite staleness.
// acceptable merge policies are listed above as id constants
@property (strong) id mergePolicy; // default: NSErrorMergePolicy
/* Converts the object IDs of the specified objects to permanent IDs. This implementation will convert the object ID of each managed object in the specified array to a permanent ID. Any object in the target array with a permanent ID will be ignored; additionally, any managed object in the array not already assigned to a store will be assigned, based on the same rules Core Data uses for assignment during a save operation (first writable store supporting the entity, and appropriate for the instance and its related items.) Although the object will have a permanent ID, it will still respond positively to -isInserted until it is saved. If an error is encountered obtaining an identifier, the return value will be NO.
*/
- (BOOL)obtainPermanentIDsForObjects:(NSArray<NSManagedObject *> *)objects error:(NSError **)error API_AVAILABLE(macosx(10.5),ios(3.0));
/* Merges the changes specified in notification object received from another context's NSManagedObjectContextDidSaveNotification into the receiver. This method will refresh any objects which have been updated in the other context, fault in any newly inserted objects, and invoke deleteObject: on those which have been deleted. The developer is only responsible for the thread safety of the receiver.
*/
- (void)mergeChangesFromContextDidSaveNotification:(NSNotification *)notification API_AVAILABLE(macosx(10.5),ios(3.0));
/* Similar to mergeChangesFromContextDidSaveNotification, this method handles changes from potentially other processes or serialized state. It more efficiently
* merges changes into multiple contexts, as well as nested context. The keys in the dictionary should be one those from an
* NSManagedObjectContextObjectsDidChangeNotification: NSInsertedObjectsKey, NSUpdatedObjectsKey, etc.
* the values should be an NSArray of either NSManagedObjectID or NSURL objects conforming to valid results from -URIRepresentation
*/
+ (void)mergeChangesFromRemoteContextSave:(NSDictionary*)changeNotificationData intoContexts:(NSArray<NSManagedObjectContext*> *)contexts API_AVAILABLE(macosx(10.11),ios(9.0));
/* Return the query generation currently in use by this context. Will be one of the following:
* - nil, default value => this context is not using generational querying
* - an opaque token => specifies the generation of data this context is vending
*
* All child contexts will return nil.
*/
@property (nullable, nonatomic, strong, readonly) NSQueryGenerationToken *queryGenerationToken API_AVAILABLE(macosx(10.12),ios(10.0),tvos(10.0),watchos(3.0));
/* Set the query generation this context should use. Must be one of the following values:
* - nil => this context will not use generational querying
* - the value returned by +[NSQueryGenerationToken currentQueryGenerationToken] => this context will pin itself to the generation of the database when it first loads data
* - the result of calling -[NSManagedObjectContext queryGenerationToken] on another managed object context => this context will be set to whatever query generation the original context is currently using;
*
* Query generations are for fetched data only; they are not used during saving. If a pinned context saves,
* its query generation will be updated after the save. Executing a NSBatchUpdateRequest or NSBatchDeleteRequest
* will not cause the query generation to advance, since these do not otherwise consider or affect the
* managed object context's content.
*
* All nested contexts will defer to their parent context’s data. It is a programmer error to try to set
* the queryGenerationToken on a child context.
*
* Query generations are tracked across the union of stores. Additions to the persistent store coordinator's
* persistent stores will be ignored until the context's query generation is updated to include them.
*
* May partially fail if one or more stores being tracked by the token are removed from the persistent
* store coordinator.
*/
- (BOOL)setQueryGenerationFromToken:(nullable NSQueryGenerationToken *)generation error:(NSError **)error API_AVAILABLE(macosx(10.12),ios(10.0),tvos(10.0),watchos(3.0));
/* Whether the context automatically merges changes saved to its coordinator or parent context. Setting this property to YES when the context is pinned to a non-current query generation is not supported.
*/
@property (nonatomic) BOOL automaticallyMergesChangesFromParent API_AVAILABLE(macosx(10.12),ios(10.0),tvos(10.0),watchos(3.0));
/* Set the author for the context, this will be used as an identifier in the Persistent History Transactions (NSPersistentHistoryTransaction)
*/
@property (nullable, copy) NSString *transactionAuthor API_AVAILABLE(macosx(10.13),ios(11.0),tvos(11.0),watchos(4.0));
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/CoreData_CloudKit.h | /*
CoreData_CloudKit.h
Core Data
Copyright (c) 2021-2021, Apple Inc.
All rights reserved.
*/
#import <CoreData/NSPersistentCloudKitContainer_Sharing.h>
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSFetchedPropertyDescription.h | /*
NSFetchedPropertyDescription.h
Core Data
Copyright (c) 2004-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <CoreData/NSPropertyDescription.h>
NS_ASSUME_NONNULL_BEGIN
@class NSFetchRequest;
// Fetched properties allow to specify related objects through a "weakly" resolved property, so there is no actual join necessary.
API_AVAILABLE(macosx(10.4),ios(3.0))
@interface NSFetchedPropertyDescription : NSPropertyDescription {
}
// As part of the predicate for a fetched property, you can use the two variables $FETCH_SOURCE (which is the managed object fetching the property) and $FETCHED_PROPERTY (which is the NSFetchedPropertyDescription instance).
@property (nullable, strong) NSFetchRequest *fetchRequest;
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSEntityMigrationPolicy.h | /*
NSEntityMigrationPolicy.h
Core Data
Copyright (c) 2004-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSError.h>
#import <CoreData/CoreDataDefines.h>
NS_ASSUME_NONNULL_BEGIN
/* To access the entity migration policy keys in property mapping value expressions implemented in source code use the constants as declared. To access them in custom value expression strings in the mapping model editor in Xcode follow the syntax rules outlined in the predicate format string syntax guide and refer to them as:
NSMigrationManagerKey $manager
NSMigrationSourceObjectKey $source
NSMigrationDestinationObjectKey $destination
NSMigrationEntityMappingKey $entityMapping
NSMigrationPropertyMappingKey $propertyMapping
NSMigrationEntityPolicyKey $entityPolicy
*/
COREDATA_EXTERN NSString * const NSMigrationManagerKey API_AVAILABLE(macosx(10.5),ios(3.0));
COREDATA_EXTERN NSString * const NSMigrationSourceObjectKey API_AVAILABLE(macosx(10.5),ios(3.0));
COREDATA_EXTERN NSString * const NSMigrationDestinationObjectKey API_AVAILABLE(macosx(10.5),ios(3.0));
COREDATA_EXTERN NSString * const NSMigrationEntityMappingKey API_AVAILABLE(macosx(10.5),ios(3.0));
COREDATA_EXTERN NSString * const NSMigrationPropertyMappingKey API_AVAILABLE(macosx(10.5),ios(3.0));
COREDATA_EXTERN NSString * const NSMigrationEntityPolicyKey API_AVAILABLE(macosx(10.5),ios(3.0));
@class NSManagedObject;
@class NSEntityMapping;
@class NSMigrationManager;
@class NSError;
API_AVAILABLE(macosx(10.5),ios(3.0))
@interface NSEntityMigrationPolicy : NSObject
/* Invoked by the migration manager at the start of a given entity mapping. This is also the precursor to the creation step.
*/
- (BOOL)beginEntityMapping:(NSEntityMapping *)mapping manager:(NSMigrationManager *)manager error:(NSError **)error;
/* Invoked by the migration manager on each source instance (as specified by the sourceExpression in the mapping) to create the corresponding destination instance. The method also associates the source and destination instances by calling NSMigrationManager's
associateSourceInstance:withDestinationInstance:forEntityMapping: method. Subclass implementations of this method must be careful to
associate the source and destination instances as required if super is not called. A return value of NO indicates an error.
*/
- (BOOL)createDestinationInstancesForSourceInstance:(NSManagedObject *)sInstance entityMapping:(NSEntityMapping *)mapping manager:(NSMigrationManager *)manager error:(NSError **)error;
/* Indicates the end of the creation step for the specified entity mapping, and the precursor to the next migration step. Developers can override this method to set up or clean up information for further migration steps.
*/
- (BOOL)endInstanceCreationForEntityMapping:(NSEntityMapping *)mapping manager:(NSMigrationManager *)manager error:(NSError **)error;
/* Constructs the relationships between the newly-created destination instances. The association lookup methods on the NSMigrationManager can be used to determine the appropriate relationship targets. A return value of NO indicates an error.
*/
- (BOOL)createRelationshipsForDestinationInstance:(NSManagedObject *)dInstance entityMapping:(NSEntityMapping *)mapping manager:(NSMigrationManager *)manager error:(NSError **)error;
/* Indicates the end of the relationship creation step for the specified entity mapping. This method is invoked after the createRelationshipsForDestinationInstance:entityMapping:manager:error: method, and can be used to clean up state from the creation of relationships, or prepare state for the performance of custom validation.
*/
- (BOOL)endRelationshipCreationForEntityMapping:(NSEntityMapping *)mapping manager:(NSMigrationManager *)manager error:(NSError **)error;
/* Invoked during the validation step of the entity migration policy, providing the option of performing custom validation on migrated objects. (Implementors must manually obtain the collection of objects they are interested in validating.)
*/
- (BOOL)performCustomValidationForEntityMapping:(NSEntityMapping *)mapping manager:(NSMigrationManager *)manager error:(NSError **)error;
/* Invoked by the migration manager at the end of a given entity mapping. This is also the end to the validation step, which is the last step for migration.
*/
- (BOOL)endEntityMapping:(NSEntityMapping *)mapping manager:(NSMigrationManager *)manager error:(NSError **)error;
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSFetchedResultsController.h | /*
NSFetchedResultsController.h
Core Data
Copyright (c) 2009-2021, Apple Inc.
All rights reserved.
*/
/*
Class Overview
==============
This class is intended to efficiently manage the results returned from a Core Data fetch request.
You configure an instance of this class using a fetch request that specifies the entity, optionally a filter predicate, and an array containing at least one sort ordering. When you execute the fetch, the instance efficiently collects information about the results without the need to bring all the result objects into memory at the same time. As you access the results, objects are automatically faulted into memory in batches to match likely access patterns, and objects from previous accessed disposed of. This behavior further serves to keep memory requirements low, so even if you traverse a collection containing tens of thousands of objects, you should never have more than tens of them in memory at the same time.
This class is tailored to work in conjunction with views that present collections of objects. These views typically expect their data source to present results as a list of sections made up of rows. NSFetchedResultsController can efficiently analyze the result of the fetch request and pre-compute all the information about sections in the result set. Moreover, the controller can cache the results of this computation so that if the same data is subsequently re-displayed, the work does not have to be repeated. In addition:
* The controller monitors changes to objects in its associated managed object context, and updates the results accordingly. It reports changes in the results set to its delegate.
* The controller automatically purges unneeded objects if it receives an application low memory notification.
* The controller maintains a persistent cache of the section information across application launches if the cacheName is not nil. If caching is enabled, you must not mutate the fetch request, its predicate, or its sort descriptor without first calling +deleteCacheWithName:
Typical use
===========
Developers create an instance of NSFetchedResultsController and configure it with a fetchRequest. It is expected that the sort descriptor used in the request groups the results into sections. This allows for section information to be pre-computed.
After creating an instance, the performFetch: method should be called to actually perform the fetching.
Once started, convenience methods on the instance can be used for configuring the initial state of the view.
The instance of NSFetchedResultsController also registers to receive change notifications on the managed object context that holds the fetched objects. Any change in the context that affects the result set or section information is properly processed. A delegate can be set on the class so that it's also notified when the result objects have changed. This would typically be used to update the display of the view.
WARNING: The controller only performs change tracking if a delegate is set and responds to any of the change tracking notification methods. See the NSFetchedResultsControllerDelegate protocol for which delegate methods are change tracking.
Handling of Invalidated Objects
===============================
When a managed object context notifies the NSFetchedResultsController of individual objects being invalidated (NSInvalidatedObjectsKey), the controller treats these as deleted objects and sends the proper delegate calls.
It's possible for all the objects in a managed object context to be invalidated simultaneously. This can happen as a result of calling -reset on NSManagedObjectContext, or if a store is removed from the the NSPersistentStoreCoordinator. When this happens, NSFetchedResultsController currently does not invalidate all objects, nor does it send individual notifications for object deletions. Instead, developers must call performFetch: again to reset the state of the controller if all the objects in a context have been invalidated. They should also reset the state of their view.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSSet.h>
#import <Foundation/NSError.h>
#import <Foundation/NSIndexPath.h>
#import <Foundation/NSOrderedCollectionDifference.h>
#import <CoreData/NSManagedObjectContext.h>
#import <CoreData/NSManagedObject.h>
#import <CoreData/NSFetchRequest.h>
NS_ASSUME_NONNULL_BEGIN
@protocol NSFetchedResultsControllerDelegate;
@protocol NSFetchedResultsSectionInfo;
@class NSDiffableDataSourceSnapshot<SectionIdentifierType, ItemIdentifierType>;
API_AVAILABLE(macosx(10.12),ios(3.0))
@interface NSFetchedResultsController<ResultType:id<NSFetchRequestResult>> : NSObject
/* ========================================================*/
/* ========================= INITIALIZERS ====================*/
/* ========================================================*/
/* Initializes an instance of NSFetchedResultsController
fetchRequest - the fetch request used to get the objects. It's expected that the sort descriptor used in the request groups the objects into sections.
context - the context that will hold the fetched objects
sectionNameKeyPath - keypath on resulting objects that returns the section name. This will be used to pre-compute the section information.
cacheName - Section info is cached persistently to a private file under this name. Cached sections are checked to see if the time stamp matches the store, but not if you have illegally mutated the readonly fetch request, predicate, or sort descriptor.
*/
- (instancetype)initWithFetchRequest:(NSFetchRequest<ResultType> *)fetchRequest managedObjectContext: (NSManagedObjectContext *)context sectionNameKeyPath:(nullable NSString *)sectionNameKeyPath cacheName:(nullable NSString *)name;
/* Executes the fetch request on the store to get objects.
Returns YES if successful or NO (and an error) if a problem occurred.
An error is returned if the fetch request specified doesn't include a sort descriptor that uses sectionNameKeyPath.
After executing this method, the fetched objects can be accessed with the property 'fetchedObjects'
*/
- (BOOL)performFetch:(NSError **)error;
/* ========================================================*/
/* ====================== CONFIGURATION ===================*/
/* ========================================================*/
/* NSFetchRequest instance used to do the fetching. You must not change it, its predicate, or its sort descriptor after initialization without disabling caching or calling +deleteCacheWithName. The sort descriptor used in the request groups objects into sections.
*/
@property(nonatomic,readonly) NSFetchRequest<ResultType> *fetchRequest;
/* Managed Object Context used to fetch objects. The controller registers to listen to change notifications on this context and properly update its result set and section information.
*/
@property (nonatomic,readonly) NSManagedObjectContext *managedObjectContext;
/* The keyPath on the fetched objects used to determine the section they belong to.
*/
@property (nonatomic,nullable, readonly) NSString *sectionNameKeyPath;
/* Name of the persistent cached section information. Use nil to disable persistent caching, or +deleteCacheWithName to clear a cache.
*/
@property (nonatomic,nullable, readonly) NSString *cacheName;
/* Delegate that is notified when the result set changes.
*/
@property(nullable, nonatomic, assign) id< NSFetchedResultsControllerDelegate > delegate;
/* Deletes the cached section information with the given name.
If name is nil, then all caches are deleted.
*/
+ (void)deleteCacheWithName:(nullable NSString *)name;
/* ========================================================*/
/* ============= ACCESSING OBJECT RESULTS =================*/
/* ========================================================*/
/* Returns the results of the fetch.
Returns nil if the performFetch: hasn't been called.
*/
@property (nullable, nonatomic, readonly) NSArray<ResultType> *fetchedObjects;
/* Returns the fetched object at a given indexPath.
*/
- (ResultType)objectAtIndexPath:(NSIndexPath *)indexPath;
/* Returns the indexPath of a given object.
*/
-(nullable NSIndexPath *)indexPathForObject:(ResultType)object;
/* ========================================================*/
/* =========== CONFIGURING SECTION INFORMATION ============*/
/* ========================================================*/
/* These are meant to be optionally overridden by developers.
*/
/* Returns the corresponding section index entry for a given section name.
Default implementation returns the capitalized first letter of the section name.
Developers that need different behavior can implement the delegate method -(NSString*)controller:(NSFetchedResultsController *)controller sectionIndexTitleForSectionName
Only needed if a section index is used.
*/
- (nullable NSString *)sectionIndexTitleForSectionName:(NSString *)sectionName;
/* Returns the array of section index titles.
Default implementation returns the array created by calling sectionIndexTitleForSectionName: on all the known sections.
Developers should override this method if they wish to return a different array for the section index.
Only needed if a section index is used.
*/
@property (nonatomic, readonly) NSArray<NSString *> *sectionIndexTitles;
/* ========================================================*/
/* =========== QUERYING SECTION INFORMATION ===============*/
/* ========================================================*/
/* Returns an array of objects that implement the NSFetchedResultsSectionInfo protocol.
This provide a convenience interface for determining the number of sections, the names and titles of the sections, and access to the model objects that belong to each section.
*/
@property (nullable, nonatomic, readonly) NSArray<id<NSFetchedResultsSectionInfo>> *sections;
/* Returns the section number for a given section title and index in the section index.
*/
- (NSInteger)sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)sectionIndex;
@end
// ================== PROTOCOLS ==================
@protocol NSFetchedResultsSectionInfo
/* Name of the section
*/
@property (nonatomic, readonly) NSString *name;
/* Title of the section (used when displaying the index)
*/
@property(nullable, nonatomic, readonly) NSString *indexTitle;
/* Number of objects in section
*/
@property (nonatomic, readonly) NSUInteger numberOfObjects;
/* Returns the array of objects in the section.
*/
@property (nullable, nonatomic, readonly) NSArray *objects;
@end // NSFetchedResultsSectionInfo
typedef NS_ENUM(NSUInteger, NSFetchedResultsChangeType) {
NSFetchedResultsChangeInsert = 1,
NSFetchedResultsChangeDelete = 2,
NSFetchedResultsChangeMove = 3,
NSFetchedResultsChangeUpdate = 4
} API_AVAILABLE(macosx(10.12), ios(3.0));
@protocol NSFetchedResultsControllerDelegate <NSObject>
@optional
#pragma mark -
#pragma mark ***** Snapshot Based Content Change Reporting *****
/* Called when the contents of the fetched results controller change.
* If this method is implemented, no other delegate methods will be invoked.
*/
- (void)controller:(NSFetchedResultsController *)controller didChangeContentWithSnapshot:(NSDiffableDataSourceSnapshot<NSString *, NSManagedObjectID *> *)snapshot API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0));
#pragma mark -
#pragma mark ***** Difference Based Content Change Reporting *****
/* Called when the contents of the fetched results controller change.
* If this method is implemented and the controller is configured with
* sectionNameKeyPath = nil, no other delegate methods will be invoked.
*
* This method is only invoked if the controller's `sectionNameKeyPath`
* property is nil and `controller:didChangeContentWithSnapshot:` is not
* implemented.
*/
- (void)controller:(NSFetchedResultsController *)controller didChangeContentWithDifference:(NSOrderedCollectionDifference<NSManagedObjectID *> *)diff API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0));
#pragma mark -
#pragma mark ***** Legacy Content Change Reporting *****
/* Notifies the delegate that a fetched object has been changed due to an add, remove, move, or update. Enables NSFetchedResultsController change tracking.
controller - controller instance that noticed the change on its fetched objects
anObject - changed object
indexPath - indexPath of changed object (nil for inserts)
type - indicates if the change was an insert, delete, move, or update
newIndexPath - the destination path of changed object (nil for deletes)
Changes are reported with the following heuristics:
Inserts and Deletes are reported when an object is created, destroyed, or changed in such a way that changes whether it matches the fetch request's predicate. Only the Inserted/Deleted object is reported; like inserting/deleting from an array, it's assumed that all objects that come after the affected object shift appropriately.
Move is reported when an object changes in a manner that affects its position in the results. An update of the object is assumed in this case, no separate update message is sent to the delegate.
Update is reported when an object's state changes, and the changes do not affect the object's position in the results.
*/
@optional
- (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(nullable NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(nullable NSIndexPath *)newIndexPath;
/* Notifies the delegate of added or removed sections. Enables NSFetchedResultsController change tracking.
controller - controller instance that noticed the change on its sections
sectionInfo - changed section
index - index of changed section
type - indicates if the change was an insert or delete
Changes on section info are reported before changes on fetchedObjects.
*/
@optional
- (void)controller:(NSFetchedResultsController *)controller didChangeSection:(id <NSFetchedResultsSectionInfo>)sectionInfo atIndex:(NSUInteger)sectionIndex forChangeType:(NSFetchedResultsChangeType)type;
/* Notifies the delegate that section and object changes are about to be processed and notifications will be sent. Enables NSFetchedResultsController change tracking.
Clients may prepare for a batch of updates by using this method to begin an update block for their view.
*/
@optional
- (void)controllerWillChangeContent:(NSFetchedResultsController *)controller;
/* Notifies the delegate that all section and object changes have been sent. Enables NSFetchedResultsController change tracking.
Clients may prepare for a batch of updates by using this method to begin an update block for their view.
Providing an empty implementation will enable change tracking if you do not care about the individual callbacks.
*/
@optional
- (void)controllerDidChangeContent:(NSFetchedResultsController *)controller;
/* Asks the delegate to return the corresponding section index entry for a given section name. Does not enable NSFetchedResultsController change tracking.
If this method isn't implemented by the delegate, the default implementation returns the capitalized first letter of the section name (seee NSFetchedResultsController sectionIndexTitleForSectionName:)
Only needed if a section index is used.
*/
@optional
- (nullable NSString *)controller:(NSFetchedResultsController *)controller sectionIndexTitleForSectionName:(NSString *)sectionName API_AVAILABLE(macosx(10.12),ios(4.0));
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSMergePolicy.h | /*
NSMergePolicy.h
Core Data
Copyright (c) 2004-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSError.h>
#import <CoreData/CoreDataDefines.h>
NS_ASSUME_NONNULL_BEGIN
@class NSMergePolicy;
@class NSManagedObject;
// Default policy for all managed object contexts - save returns with an error that contains the object IDs of the objects that had conflicts(NSInsertedObjectsKey, NSUpdatedObjectsKey).
COREDATA_EXTERN id NSErrorMergePolicy API_AVAILABLE(macosx(10.4),ios(3.0));
// This singleton policy merges conflicts between the persistent store's version of the object and the current in memory version. The merge occurs by individual property. For properties which have been changed in both the external source and in memory, the external changes trump the in memory ones.
COREDATA_EXTERN id NSMergeByPropertyStoreTrumpMergePolicy API_AVAILABLE(macosx(10.4),ios(3.0));
// This singleton policy merges conflicts between the persistent store's version of the object and the current in memory version. The merge occurs by individual property. For properties which have been changed in both the external source and in memory, the in memory changes trump the external ones.
COREDATA_EXTERN id NSMergeByPropertyObjectTrumpMergePolicy API_AVAILABLE(macosx(10.4),ios(3.0));
// This singleton policy overwrites all state for the changed objects in conflict The current object's state is pushed upon the persistent store.
COREDATA_EXTERN id NSOverwriteMergePolicy API_AVAILABLE(macosx(10.4),ios(3.0));
// This singleton policy discards all state for the changed objects in conflict. The persistent store's version of the object is used.
COREDATA_EXTERN id NSRollbackMergePolicy API_AVAILABLE(macosx(10.4),ios(3.0));
typedef NS_ENUM(NSUInteger, NSMergePolicyType) {
NSErrorMergePolicyType = 0x00,
NSMergeByPropertyStoreTrumpMergePolicyType = 0x01,
NSMergeByPropertyObjectTrumpMergePolicyType = 0x02,
NSOverwriteMergePolicyType = 0x03,
NSRollbackMergePolicyType = 0x04
};
API_AVAILABLE(macosx(10.7),ios(5.0))
@interface NSMergeConflict : NSObject {
}
@property (readonly, retain) NSManagedObject* sourceObject;
@property (nullable, readonly, retain) NSDictionary<NSString *, id> * objectSnapshot;
@property (nullable, readonly, retain) NSDictionary<NSString *, id> * cachedSnapshot;
@property (nullable, readonly, retain) NSDictionary<NSString *, id> * persistedSnapshot;
@property (readonly) NSUInteger newVersionNumber;
@property (readonly) NSUInteger oldVersionNumber;
/*
* There are two situations in which a conflict may occur:
*
* 1. Between the NSManagedObjectContext and its in-memory cached state at the NSPersistentStoreCoordinator layer.
* In this case, the merge conflict has a source object and a cached snapshot but no persisted snapshot (persnap is nil).
*
* 2. Between the cached state at the NSPersistentStoreCoordinator and the external store (file, database, etc.).
* In this case, the merge conflict has a cached snapshot and a persisted snapshot. The source object is also provided as a convenience,
* but it is not directly involved in the conflict.
*
* Snapshot dictionaries include values for all attributes and to-one relationships, but not to-many relationships.
* Relationship values are NSManagedObjectID references. to-many relationships must be pulled from the persistent store as needed.
*
* A newVersion number of 0 means the object was deleted and the corresponding snapshot is nil.
*/
- (instancetype)initWithSource:(NSManagedObject*)srcObject newVersion:(NSUInteger)newvers oldVersion:(NSUInteger)oldvers cachedSnapshot:(nullable NSDictionary<NSString *, id> *)cachesnap persistedSnapshot:(nullable NSDictionary<NSString *, id> *)persnap NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE;
@end
/* Used to report merge conflicts which include uniqueness constraint violations. Optimistic locking failures will be reported
separately from uniquness conflicts and will be resolved first. Each constraint violated will result in a separate NSMergeConflict,
although if an entity hierarchy has a constraint which is extended in subentities, all constraint violations for that constraint
will be collapsed into a single report.
*/
API_AVAILABLE(macosx(10.11),ios(9.0))
@interface NSConstraintConflict : NSObject {
}
@property (readonly, copy) NSArray <NSString *> *constraint; // The constraint which has been violated.
@property (readonly, copy) NSDictionary <NSString *, id> *constraintValues; // The values which the conflictingObjects had when this conflict was created. May no longer match the values of any conflicted object if something else resolved the conflict.
@property (nullable, readonly, retain) NSManagedObject *databaseObject; // Object whose DB row is using constraint values. May be null if this is a context-level violation.
@property (nullable, readonly, retain) NSDictionary<NSString *, id> *databaseSnapshot; // DB row already using constraint values. May be null if this is a context-level violation.
@property (readonly, copy) NSArray <NSManagedObject *> *conflictingObjects; // The objects in violation of the constraint. May contain one (in the case of a db level conflict) or more objects.
@property (readonly, copy) NSArray <NSDictionary *> *conflictingSnapshots; // The original property values of objects in violation of the constraint. Will contain as many objects as there are conflictingObjects. If an object was unchanged, its snapshot will instead be -[NSNull null].
/*
* There are two situations in which a constraint conflict may occur:
*
* 1. Between multiple objects being saved in a single managed object context. In this case, the conflict
* will have a nil database object/snapshot, and multiple conflicting objects/snapshots representing
* the state of the objects when they were first faulted or inserted into the context.
*
* 2. Between a single object being saved in a managed object context and the external store. In this case, the
* constraint conflict will have a database object, the current row snapshot for the database object, plus a
* a single conflicting object and its snapshot from when it was first faulted or inserted.
*
* Snapshot dictionaries include values for all attributes and to-one relationships, but not to-many relationships.
* Relationship values are NSManagedObjectID references. to-many relationships must be pulled from the persistent store as needed.
*/
- (instancetype)initWithConstraint:(NSArray<NSString *> *)contraint databaseObject:(nullable NSManagedObject*)databaseObject databaseSnapshot:(nullable NSDictionary *)databaseSnapshot conflictingObjects:(NSArray<NSManagedObject *> *)conflictingObjects conflictingSnapshots:(NSArray *)conflictingSnapshots NS_DESIGNATED_INITIALIZER;
@end
API_AVAILABLE(macosx(10.7),ios(5.0))
@interface NSMergePolicy : NSObject {
}
@property (class, readonly, strong) NSMergePolicy *errorMergePolicy API_AVAILABLE(macosx(10.12),ios(10.0),tvos(10.0),watchos(3.0));
@property (class, readonly, strong) NSMergePolicy *rollbackMergePolicy API_AVAILABLE(macosx(10.12),ios(10.0),tvos(10.0),watchos(3.0));
@property (class, readonly, strong) NSMergePolicy *overwriteMergePolicy API_AVAILABLE(macosx(10.12),ios(10.0),tvos(10.0),watchos(3.0));
@property (class, readonly, strong) NSMergePolicy *mergeByPropertyObjectTrumpMergePolicy API_AVAILABLE(macosx(10.12),ios(10.0),tvos(10.0),watchos(3.0));
@property (class, readonly, strong) NSMergePolicy *mergeByPropertyStoreTrumpMergePolicy API_AVAILABLE(macosx(10.12),ios(10.0),tvos(10.0),watchos(3.0));
@property (readonly) NSMergePolicyType mergeType;
/*
* In a subclass implementation of initWithMergeType:, you should invoke super with the NSMergePolicyType that is closest to the behavior you want.
* This will make it easier to use the superclass's implementation of -resolveConflicts:error:, and then customize the results. You are strongly encouraged to do so.
* Due to the complexity of merging to-many relationships, this class is designed with the expectation that you call super as the base implemenation.
*/
- (id)initWithMergeType:(NSMergePolicyType)ty NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE;
/*
* In a subclass, you are strongly encouraged to override initWithMergeType: and customize the results from calling super instead of performing your own actions from scratch.
* Correctly merging to-many relationships is very challenging and any mistakes will cause permanent data corruption in the form of dangling foreign keys.
* Calls -resolveOptimisticLockingVersionConflicts:error: and then -resolveConstraintConflicts:error:
*/
- (BOOL)resolveConflicts:(NSArray *)list error:(NSError **)error;
/* Resolve optimistic locking failures for the list of failures. In a subclass, you are strongly encouraged to override initWithMergeType: and customize
* the results from calling super instead of performing your own actions from scratch. Correctly merging to-many relationships is very challenging and
* any mistakes will cause permanent data corruption in the form of dangling foreign keys.
* Will be called before -resolveConstraintConflicts:error:
*/
- (BOOL)resolveOptimisticLockingVersionConflicts:(NSArray<NSMergeConflict *> *)list error:(NSError **)error API_AVAILABLE(macosx(10.11),ios(9.0));
/* Resolve uniqueness constraint violations for the list of failures.
* Will be called after -resolveOptimisticLockingVersionConflicts:error:
*/
- (BOOL)resolveConstraintConflicts:(NSArray<NSConstraintConflict *> *)list error:(NSError **)error API_AVAILABLE(macosx(10.11),ios(9.0));
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSIncrementalStoreNode.h | /*
NSIncrementalStoreNode.h
Core Data
Copyright (c) 2010-2021, Apple Inc.
All rights reserved.
*/
#import <CoreData/NSManagedObjectID.h>
#import <Foundation/NSDictionary.h>
NS_ASSUME_NONNULL_BEGIN
@class NSPropertyDescription;
// Provides the basic unit of external data that the Core Data stack interacts with.
API_AVAILABLE(macosx(10.7),ios(5.0))
@interface NSIncrementalStoreNode : NSObject {
}
// Returns an object initialized with the following values
// objectID -> The NSManagedObjectID corresponding to the object whose values are cached
//
// values -> A dictionary containing the values persisted in an external store with keys corresponding to the names of the NSPropertyDescriptions
// in the NSEntityDescription described by the NSManagedObjectID. Unknown or unmodeled keys will be stripped out.
//
// For attributes: an immutable value (NSNumber, NSString, NSData etc). Missing attribute keys will assume a nil value.
//
// For to-one relationships: the NSManagedObjectID of the related object or NSNull for nil relationship values. A missing key will be resolved lazily through calling
// -newValueForRelationship:forObjectWithID:withContext:error: on the NSPersistentStore. Lazy resolution for to-ones is discouraged.
//
// For to-many relationships: an NSArray or NSSet containing the NSManagedObjectIDs of the related objects. Empty to-many relationships must
// be represented by an empty non-nil collection. A missing key will be resolved lazily through calling. Lazy resolution for to-manys is encouraged.
// -newValueForRelationship:forObjectWithID:withContext:error: on the NSPersistentStore
//
// version -> The revision number of this state; used for conflict detection and merging
- (instancetype)initWithObjectID:(NSManagedObjectID*)objectID withValues:(NSDictionary<NSString *, id> *)values version:(uint64_t)version;
// Update the values and version to reflect new data being saved to or loaded from the external store.
// The values dictionary is in the same format as the initializer
- (void)updateWithValues:(NSDictionary<NSString *, id> *)values version:(uint64_t)version;
// Return the object ID that identifies the data stored by this node
@property (nonatomic, readonly, strong) NSManagedObjectID *objectID;
// Return the version of data in this node.
@property (nonatomic, readonly) uint64_t version;
// May return NSNull for to-one relationships. If a relationship is nil, clients should invoke -newValueForRelationship:forObjectWithID:withContext:error: on the NSPersistentStore
- (nullable id)valueForPropertyDescription:(NSPropertyDescription*)prop;
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSDerivedAttributeDescription.h | /*
NSDerivedAttributeDescription.h
Core Data
Copyright (c) 2018-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <CoreData/NSAttributeDescription.h>
@class NSExpression;
@class NSPredicate;
NS_ASSUME_NONNULL_BEGIN
/* Class that describes an attribute whose value should be derived from one or more
other properties and how that derivation should be done.
This is primarily intended to optimize fetch performance. Some use cases:
* creating a derived 'searchName' attribute that reflects a 'name' attribute with
case and diacritics stripped for more efficient comparisons during fetching
* creating a 'relationshipCount' attribute reflecting the number of objects in
a relationship and so avoid having to do a join during fetching
IMPORTANT: Derived attributes will be recomputed during save, recomputed values will not be reflected in a managed object's property until after a save.
NOTE: Prior to macOS 10.16, iOS 14.0, tvOS 14.0, and watchOS 7.0 a refresh of the object is required after a save to reflect recomputed values
*/
API_AVAILABLE(macosx(10.15),ios(13.0),tvos(13.0),watchos(6.0))
@interface NSDerivedAttributeDescription : NSAttributeDescription
/* Instance of NSExpression that will be used to generate the derived data.
When using derived attributes in an SQL store, this expression should be
* a keypath expression (including @operation components)
* a function expression using one of the predefined functions defined
in NSExpression.h
Any keypaths used in the expression must be accessible from the entity on which
the derived attribute is specified.
If a store is added to a coordinator whose model contains derived attributes of
a type not supported by the store, the add will fail and an NSError will be returned. */
@property (strong, nullable) NSExpression *derivationExpression;
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSPropertyDescription.h | /*
NSPropertyDescription.h
Core Data
Copyright (c) 2004-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
NS_ASSUME_NONNULL_BEGIN
@class NSEntityDescription;
@class NSData;
@class NSPredicate;
// Properties describe values within a managed object. There are different types of properties, each of them represented by a subclass which encapsulates the specific property behavior.
API_AVAILABLE(macosx(10.4),ios(3.0))
@interface NSPropertyDescription : NSObject <NSCoding, NSCopying> {
}
@property (nonatomic, readonly, assign) NSEntityDescription *entity;
@property (nonatomic, copy) NSString *name;
// The optional flag specifies whether a property's value can be nil or not (before an object can be persisted).
@property (getter=isOptional) BOOL optional;
// The transient flag specifies whether a property's value is persisted or ignored when an object is persisted - transient properties are still managed for undo/redo, validation, etc.
@property (getter=isTransient) BOOL transient;
// Instead of individual methods to set/get parameters like length, min and max values, formats, etc., there is a list of predicates evaluated against the managed objects and corresponding error messages (which can be localized).
@property (readonly, strong) NSArray<NSPredicate *> *validationPredicates;
@property (readonly, strong) NSArray *validationWarnings;
- (void)setValidationPredicates:(nullable NSArray<NSPredicate *> *)validationPredicates withValidationWarnings:(nullable NSArray<NSString *> *)validationWarnings;
@property (nullable, nonatomic, strong) NSDictionary *userInfo;
/* Returns a boolean value indicating if the property is important for searching. NSPersistentStores can optionally utilize this information upon store creation for operations like defining indexes.
*/
@property (getter=isIndexed) BOOL indexed API_DEPRECATED( "Use NSEntityDescription.indexes instead", macosx(10.5,10.13),ios(3.0,11.0),tvos(9.0, 11.0),watchos(2.0, 4.0));
/* Returns the version hash for the property. The version hash is used to uniquely identify a property based on its configuration. The version hash uses only values which affect the persistence of data and the user-defined versionHashModifier value. (The values which affect persistence are the name of the property, the flags for isOptional, isTransient, and isReadOnly). This value is stored as part of the version information in the metadata for stores, as well as a definition of a property involved in an NSPropertyMapping.
*/
@property (readonly, copy) NSData *versionHash API_AVAILABLE(macosx(10.5),ios(3.0));
/* Returns/sets the version hash modifier for the property. This value is included in the version hash for the property, allowing developers to mark/denote a property as being a different "version" than another, even if all of the values which affects persistence are equal. (Such a difference is important in cases where the design of a property is unchanged, but the format or content of data has changed.)
*/
@property (nullable, copy) NSString *versionHashModifier API_AVAILABLE(macosx(10.5),ios(3.0));
/* Returns a boolean value indicating if the property should be indexed by Spotlight.
*/
@property (getter=isIndexedBySpotlight) BOOL indexedBySpotlight API_AVAILABLE(macosx(10.6),ios(3.0));
/* Returns a boolean value indicating if the property data should be written out to the external record file.
*/
@property (getter=isStoredInExternalRecord) BOOL storedInExternalRecord API_DEPRECATED("Spotlight integration is deprecated. Use CoreSpotlight integration instead.", macosx(10.6,10.13),ios(3.0,11.0));
@property (nullable, copy) NSString *renamingIdentifier API_AVAILABLE(macosx(10.6),ios(3.0));
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObject.h | /*
NSManagedObject.h
Core Data
Copyright (c) 2004-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSSet.h>
#import <Foundation/NSKeyValueObserving.h>
NS_ASSUME_NONNULL_BEGIN
@class NSEntityDescription;
@class NSError;
@class NSManagedObjectContext;
@class NSManagedObjectID;
@class NSFetchRequest;
typedef NS_OPTIONS(NSUInteger, NSSnapshotEventType) {
NSSnapshotEventUndoInsertion = 1 << 1,
NSSnapshotEventUndoDeletion = 1 << 2,
NSSnapshotEventUndoUpdate = 1 << 3,
NSSnapshotEventRollback = 1 << 4,
NSSnapshotEventRefresh = 1 << 5,
NSSnapshotEventMergePolicy = 1 << 6
};
API_AVAILABLE(macosx(10.4),ios(3.0)) NS_REQUIRES_PROPERTY_DEFINITIONS
@interface NSManagedObject : NSObject {
}
/* Distinguish between changes that should and should not dirty the object for any key unknown to Core Data. 10.5 & earlier default to NO. 10.6 and later default to YES. */
/* Similarly, transient attributes may be individually flagged as not dirtying the object by adding +(BOOL)contextShouldIgnoreChangesFor<key> where <key> is the property name. */
@property(class, readonly) BOOL contextShouldIgnoreUnmodeledPropertyChanges API_AVAILABLE(macosx(10.6),ios(3.0));
/* The Entity represented by this subclass. This method is only legal to call on subclasses of NSManagedObject that represent a single entity in the model.
*/
+ (NSEntityDescription*)entity API_AVAILABLE(macosx(10.12),ios(10.0),tvos(10.0),watchos(3.0));
/* A new fetch request initialized with the Entity represented by this subclass. This property's getter is only legal to call on subclasses of NSManagedObject that represent a single entity in the model.
*/
#ifndef __swift__
+ (NSFetchRequest*)fetchRequest API_AVAILABLE(macosx(10.12),ios(10.0),tvos(10.0),watchos(3.0)) NS_REFINED_FOR_SWIFT;
#endif
/* The designated initializer. */
- (__kindof NSManagedObject*)initWithEntity:(NSEntityDescription *)entity insertIntoManagedObjectContext:(nullable NSManagedObjectContext *)context NS_DESIGNATED_INITIALIZER;
/* Returns a new object, inserted into managedObjectContext. This method is only legal to call on subclasses of NSManagedObject that represent a single entity in the model.
*/
-(instancetype)initWithContext:(NSManagedObjectContext*)moc API_AVAILABLE(macosx(10.12),ios(10.0),tvos(10.0),watchos(3.0));
// identity
@property (nullable, nonatomic, readonly, assign) NSManagedObjectContext *managedObjectContext;
@property (nonatomic, readonly, strong) NSEntityDescription *entity;
@property (nonatomic, readonly, strong) NSManagedObjectID *objectID;
// state - methods
@property (nonatomic, getter=isInserted, readonly) BOOL inserted;
@property (nonatomic, getter=isUpdated, readonly) BOOL updated;
@property (nonatomic, getter=isDeleted, readonly) BOOL deleted;
@property (nonatomic, readonly) BOOL hasChanges API_AVAILABLE(macosx(10.7),ios(5.0));
/* returns YES if any persistent properties do not compare isEqual to their last saved state. Relationship faults will not be unnecessarily fired. This differs from the existing -hasChanges method which is a simple dirty flag and also includes transient properties */
@property (nonatomic, readonly) BOOL hasPersistentChangedValues API_AVAILABLE(macosx(10.9),ios(7.0));
// this information is useful in many situations when computations are optional - this can be used to avoid growing the object graph unnecessarily (which allows to control performance as it can avoid time consuming fetches from databases)
@property (nonatomic, getter=isFault, readonly) BOOL fault;
// returns a Boolean indicating if the relationship for the specified key is a fault. If a value of NO is returned, the resulting relationship is a realized object; otherwise the relationship is a fault. If the specified relationship is a fault, calling this method does not result in the fault firing.
- (BOOL)hasFaultForRelationshipNamed:(NSString *)key API_AVAILABLE(macosx(10.5),ios(3.0));
/* returns an array of objectIDs for the contents of a relationship. to-one relationships will return an NSArray with a single NSManagedObjectID. Optional relationships may return an empty NSArray. The objectIDs will be returned in an NSArray regardless of the type of the relationship. */
- (NSArray<NSManagedObjectID *> *)objectIDsForRelationshipNamed:(NSString *)key API_AVAILABLE(macosx(10.11),ios(8.3));
/* Allow developers to determine if an object is in a transitional phase when receiving a KVO notification. Returns 0 if the object is fully initialized as a managed object and not transitioning to or from another state */
@property (nonatomic, readonly) NSUInteger faultingState API_AVAILABLE(macosx(10.5),ios(3.0));
// lifecycle/change management (includes key-value observing methods)
- (void)willAccessValueForKey:(nullable NSString *)key; // read notification
- (void)didAccessValueForKey:(nullable NSString *)key; // read notification (together with willAccessValueForKey used to maintain inverse relationships, to fire faults, etc.) - each read access has to be wrapped in this method pair (in the same way as each write access has to be wrapped in the KVO method pair)
// KVO change notification
- (void)willChangeValueForKey:(NSString *)key;
- (void)didChangeValueForKey:(NSString *)key;
- (void)willChangeValueForKey:(NSString *)inKey withSetMutation:(NSKeyValueSetMutationKind)inMutationKind usingObjects:(NSSet *)inObjects;
- (void)didChangeValueForKey:(NSString *)inKey withSetMutation:(NSKeyValueSetMutationKind)inMutationKind usingObjects:(NSSet *)inObjects;
// invoked after a fetch or after unfaulting (commonly used for computing derived values from the persisted properties)
- (void)awakeFromFetch;
// invoked after an insert (commonly used for initializing special default/initial settings)
- (void)awakeFromInsert;
/* Callback for undo, redo, and other multi-property state resets */
- (void)awakeFromSnapshotEvents:(NSSnapshotEventType)flags API_AVAILABLE(macosx(10.6),ios(3.0));
/* Callback before delete propagation while the object is still alive. Useful to perform custom propagation before the relationships are torn down or reconfigure KVO observers. */
- (void)prepareForDeletion API_AVAILABLE(macosx(10.6),ios(3.0));
// commonly used to compute persisted values from other transient/scratchpad values, to set timestamps, etc. - this method can have "side effects" on the persisted values
- (void)willSave;
// commonly used to notify other objects after a save
- (void)didSave;
// invoked automatically by the Core Data framework before receiver is converted (back) to a fault. This method is the companion of the -didTurnIntoFault method, and may be used to (re)set state which requires access to property values (for example, observers across keypaths.) The default implementation does nothing.
- (void)willTurnIntoFault API_AVAILABLE(macosx(10.5),ios(3.0));
// commonly used to clear out additional transient values or caches
- (void)didTurnIntoFault;
// value access (includes key-value coding methods)
// KVC - overridden to access generic dictionary storage unless subclasses explicitly provide accessors
- (nullable id)valueForKey:(NSString *)key;
// KVC - overridden to access generic dictionary storage unless subclasses explicitly provide accessors
- (void)setValue:(nullable id)value forKey:(NSString *)key;
// primitive methods give access to the generic dictionary storage from subclasses that implement explicit accessors like -setName/-name to add custom document logic
- (nullable id)primitiveValueForKey:(NSString *)key;
- (void)setPrimitiveValue:(nullable id)value forKey:(NSString *)key;
// returns a dictionary of the last fetched or saved keys and values of this object. Pass nil to get all persistent modeled properties.
- (NSDictionary<NSString *, id> *)committedValuesForKeys:(nullable NSArray<NSString *> *)keys;
// returns a dictionary with the keys and (new) values that have been changed since last fetching or saving the object (this is implemented efficiently without firing relationship faults)
- (NSDictionary<NSString *, id> *)changedValues;
- (NSDictionary<NSString *, id> *)changedValuesForCurrentEvent API_AVAILABLE(macosx(10.7),ios(5.0));
// validation - in addition to KVC validation managed objects have hooks to validate their lifecycle state; validation is a critical piece of functionality and the following methods are likely the most commonly overridden methods in custom subclasses
- (BOOL)validateValue:(id _Nullable * _Nonnull)value forKey:(NSString *)key error:(NSError **)error; // KVC
- (BOOL)validateForDelete:(NSError **)error;
- (BOOL)validateForInsert:(NSError **)error;
- (BOOL)validateForUpdate:(NSError **)error;
- (void)setObservationInfo:(nullable void*)inObservationInfo;
- (nullable void*)observationInfo;
@end
NS_ASSUME_NONNULL_END
|
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.