Returns a key object in which the key data is derived from a password.
- macOS 10.7+
The password from which the key should be derived.
A set of parameters for deriving the password.
A pointer to a
CFErrorvariable where an error object is stored upon failure. If not
NULL, the caller is responsible for checking this variable and releasing the resulting object if it exists.
The derived key object, or
NULL on error. Call the
CFRelease function to free the key's memory when you are done with it.
The parameters dictionary must contain at least the following keys:
k—the type of symmetric key to generate.
Sec Key Key Type
Sec Attr Salt
CFDataobject containing the salt value that is mixed into the pseudorandom rounds.
The parameters dictionary may contain the following optional keys:
k- the algorithm to use for the pseudorandom-function.
Sec Attr PRF
If zero, this defaults to
k. For a list of possible values, see kSecAttrPRF Value Constants.
Sec Attr PRFHmac Alg SHA1
k—the number of times to call the pseudorandom function. If zero, the count is computed so that computation will take 1/10 of a second (on average).
Sec Attr Rounds
Sec Attr Key Size In Bits
CFNumbervalue containing the requested key size in bits. The key size must be valid for the key type. Defaults to 128 if not provided.