pub unsafe extern "C-unwind" fn SecKeyCreateFromData(
parameters: &CFDictionary,
key_data: &CFData,
error: *mut *mut CFError,
) -> Option<CFRetained<SecKey>>
SecBase
and SecKey
only.Expand description
Creates a symmetric key with the given data and sets the algorithm type specified.
Parameter parameters
: A dictionary containing one or more key-value pairs.
See the discussion sections below for a complete overview of options.
Returns: On return, a SecKeyRef reference to the symmetric key.
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)