Function SecKeyCreateDecryptedData

Source
pub unsafe extern "C-unwind" fn SecKeyCreateDecryptedData(
    key: &SecKey,
    algorithm: &SecKeyAlgorithm,
    ciphertext: &CFData,
    error: *mut *mut CFError,
) -> Option<CFRetained<CFData>>
Available on crate features SecBase and SecKey only.
Expand description

Decrypt a block of ciphertext.

Parameter key: Private key with which to decrypt the data.

Parameter algorithm: One of SecKeyAlgorithm constants suitable to perform decryption with this key.

Parameter 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().

Parameter error: On error, will be populated with an error object describing the failure. See “Security Error Codes” (SecBase.h).

Returns: The plaintext represented as a CFData, or NULL on failure.

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.