Security Transforms

Perform cryptographic functions like encoding, encryption, signing, and signature verification.

Overview

You use security transforms to assemble a chain of security-related operations that you apply to a stream of data in macOS.

Topics

Transforms

SecTransformCreateReadTransformWithReadStream

Creates a read transform from a read stream reference.

SecTransformRef

A Core Foundation type that represents a security transform.

SecTransformGetTypeID

Returns the unique identifier of the opaque type to which a security transform object belongs.

Encoding

SecEncodeTransformCreate

Creates an encode transform object.

SecDecodeTransformCreate

Creates a decode transform object.

Encrypting

SecEncryptTransformCreate

Creates an encryption transform object.

SecDecryptTransformCreate

Creates a decryption transform object.

SecEncryptTransformGetTypeID

Returns the unique identifier of the opaque type to which an encryption transform belongs.

SecDecryptTransformGetTypeID

Returns the unique identifier of the opaque type to which a decryption transform belongs.

Signing

SecSignTransformCreate

Creates a signing transform object.

SecVerifyTransformCreate

Creates a verify transform object.

SecDigestTransformCreate

Creates a digest transform object.

SecDigestTransformGetTypeID

Returns the unique identifier of the opaque type to which a digest transform belongs.

Custom Transforms

SecTransformCreate

Creates a transform computation object.

SecTransformRegister

Registers a custom transform.

SecTransformCreateFP

A pointer to a function that creates a new instance of a custom transform.

SecTransformInstanceBlock

A block that you return from a transform creation function.

SecTransformImplementationRef

An opaque pointer to a block that implements an instance of a transform.

Transform Groups

SecTransformCreateGroupTransform

Creates an object that acts as a container for a set of connected transforms.

SecTransformFindByName

Finds a member of a transform group by its name.

SecGroupTransformRef

A Core Foundation type that represents a container holding a group of transforms.

SecGroupTransformGetTypeID

Returns the Core Foundation type ID for a transform group container.

Transform Characteristics

SecTransformSetAttribute

Sets a static value for an attribute in a transform.

SecTransformGetAttribute

Gets the current value of a transform attribute.

SecTransformCustomSetAttribute

Sets an attribute value on a custom transform.

SecTransformCustomGetAttribute

Gets an attribute value from a custom transform.

SecTranformCustomGetAttribute

Gets an attribute value from a custom transform.

Deprecated
SecTransformPushbackAttribute

Pushes a single value back for a specific attribute.

Transform Attributes

Specify the attributes of a transform.

SecTransformAttributeRef

A direct reference to a security transform attribute.

SecTransformStringOrAttributeRef

A type that may be either a string or an attribute reference.

SecTransformMetaAttributeType

The keys that describe the metadata attributes of transform attributes.

Actions

SecTransformSetDataAction

Changes the way a custom transform processes data.

SecTransformSetAttributeAction

Requests a callback when an attribute is set.

SecTransformSetTransformAction

Changes the way that a transform deals with transform lifecycle behaviors.

SecTransformActionBlock

A block that overrides the default behavior of a custom transform.

SecTransformAttributeActionBlock

A block used to override the default attribute handling for when an attribute is set.

SecTransformDataBlock

A block used to override the default data handling for a transform.

Actions

Use actions to trigger particular behaviors.

Piping

SecTransformConnectTransforms

Chains transforms together.

Execution

SecTransformExecute

Executes a transform or transform group synchronously.

SecTransformExecuteAsync

Executes transform or transform group asynchronously.

SecTransformNoData

Returns an object from inside a ProcessData override that says that although no data is being returned the transform is still active and awaiting data.

SecMessageBlock

A block that delivers messages during asynchronous operations.

Import and Export

SecTransformCopyExternalRepresentation

Creates a dictionary that contains enough information to be able to recreate a transform.

SecTransformCreateFromExternalRepresentation

Creates a transform instance from a dictionary of parameters.

Reporting Errors

kSecTransformErrorDomain

The domain of any error object created by a transform on failure.

Security Transform Error Codes

Recognize the error codes used in error objects created by a transform on failure.

kSecTransformPreviousErrorKey

The key in an error's userInfo dictionary whose value specifies the previous error when multiple errors occur during transform evaluation.

kSecTransformAbortOriginatorKey

The key in an error's userInfo dictionary whose value indicates the transform that caused the chain to abort.

See Also

Cryptography

Complying with Encryption Export Regulations

Declare the use of encryption in your app to streamline the app submission process.

Certificate, Key, and Trust Services

Establish trust using certificates and cryptographic keys.

Cryptographic Message Syntax Services

Cryptographically sign and encrypt S/MIME messages.

Randomization Services

Generate cryptographically secure random numbers.

ASN.1

Encode and decode Distinguished Encoding Rules (DER) and Basic Encoding Rules (BER) data streams.