Function

SecKeyRawVerify

Verifies a digital signature.

Declaration

OSStatus SecKeyRawVerify(SecKeyRef key, SecPadding padding, const uint8_t *signedData, size_t signedDataLen, const uint8_t *sig, size_t sigLen);

Parameters

key

Public key with which to verify the data.

padding

The type of padding used. Possible values are listed in SecPadding. Use kSecPaddingPKCS1SHA1 if you are verifying a PKCS1-style signature with DER encoding of the digest type and the signed data is a SHA1 digest of the actual data. Specify kSecPaddingNone if no padding was used.

signedData

The data for which the signature is being verified. Typically, a digest of the actual data is signed.

signedDataLen

Length in bytes of the data in the signedData buffer.

sig

The digital signature to be verified.

sigLen

Length of the data in the sig buffer.

Return Value

See Also

Legacy iOS Key Operations

SecKeyGeneratePair

Creates an asymmetric key pair.

SecKeyEncrypt

Encrypts a block of plaintext.

SecKeyDecrypt

Decrypts a block of ciphertext.

SecKeyRawSign

Generates a digital signature for a block of data.

SecPadding

The types of padding to use when you create or verify a digital signature.