SecTransformActionBlock

Type Alias SecTransformActionBlock 

Source
pub type SecTransformActionBlock = *mut DynBlock<dyn Fn() -> *const CFType>;
👎Deprecated: SecTransform is no longer supported
Available on crate features SecCustomTransform and block2 only.
Expand description

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

Returns: 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.

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:


```text
                    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);
```

See also Apple’s documentation