<!--
{
  "availability" : [
    "iOS: 2.0.0 - 15.0.0",
    "iPadOS: 2.0.0 - 15.0.0",
    "macCatalyst: 13.1.0 - 15.0.0",
    "tvOS: 4.0.0 - 15.0.0",
    "visionOS: 1.0.0 - 1.0.0",
    "watchOS: 1.0.0 - 8.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/SecKeyRawVerify(_:_:_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@F@SecKeyRawVerify"
  },
  "title" : "SecKeyRawVerify(_:_:_:_:_:_:)"
}
-->

# SecKeyRawVerify(_:_:_:_:_:_:)

Verifies a digital signature.

```
func SecKeyRawVerify(_ key: SecKey, _ padding: SecPadding, _ signedData: UnsafePointer<UInt8>, _ signedDataLen: Int, _ sig: UnsafePointer<UInt8>, _ sigLen: Int) -> OSStatus
```

## Parameters

`key`

Public key with which to verify the data.

`padding`

The type of padding used. Possible values are listed in [`SecPadding`](/documentation/Security/SecPadding). Use [`PKCS1SHA1`](/documentation/Security/SecPadding/PKCS1SHA1) 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`](/documentation/Security/SecPadding/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

A result code. See [Security Framework Result Codes](/documentation/Security/security-framework-result-codes).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)