<!--
{
  "availability" : [
    "iOS: 13.4.0 - 26.0.0",
    "iPadOS: 13.4.0 - 26.0.0",
    "macCatalyst: 13.4.0 - 26.0.0",
    "macOS: 10.12.0 -",
    "visionOS: 1.0.0 - 26.0.0",
    "watchOS: 6.2.0 - 26.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "PassKit",
  "identifier" : "/documentation/PassKit/PKPassLibrary/sign(_:using:completion:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "PassKit (Apple Pay and Wallet)"
    ],
    "preciseIdentifier" : "c:objc(cs)PKPassLibrary(im)signData:withSecureElementPass:completion:"
  },
  "title" : "sign(_:using:completion:)"
}
-->

# sign(_:using:completion:)

Signs an opaque value using a cryptographic signature.

```
func sign(_ signData: Data, using secureElementPass: PKSecureElementPass, completion: @escaping @Sendable (Data?, Data?, (any Error)?) -> Void)
```

```
func sign(_ signData: Data, using secureElementPass: PKSecureElementPass) async throws -> (Data, Data)
```

## Parameters

`signData`

The opaque value to sign.

`secureElementPass`

The Secure Element pass that PassKit uses to generate the signature.

`completion`

A Swift closure or an Objective-C block that PassKit runs when the process finishes.

- `signedData`: The signed value.
- `signature`: The cryptographic signature that PassKit uses to sign the value.
- `error`: If the process fails, an error that describes the failure; otherwise, `nil`.

## Discussion

> Important:
> The method is available only to developers who work with Apple to enable this functionality.

PassKit may execute the completion Swift closure or an Objective-C block on an arbitrary queue.

---

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)