<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 4.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CryptoTokenKit",
  "identifier" : "/documentation/CryptoTokenKit/TKSmartCard/userInteractionForSecurePINChange(_:apdu:currentPINByteOffset:newPINByteOffset:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "CryptoTokenKit"
    ],
    "preciseIdentifier" : "c:objc(cs)TKSmartCard(im)userInteractionForSecurePINChangeWithPINFormat:APDU:currentPINByteOffset:newPINByteOffset:"
  },
  "title" : "userInteractionForSecurePINChange(_:apdu:currentPINByteOffset:newPINByteOffset:)"
}
-->

# userInteractionForSecurePINChange(_:apdu:currentPINByteOffset:newPINByteOffset:)

Creates a new user interaction object for secure PIN change using the smart card reader facilities (typically a HW keypad).

```
func userInteractionForSecurePINChange(_ PINFormat: TKSmartCardPINFormat, apdu APDU: Data, currentPINByteOffset: Int, newPINByteOffset: Int) -> TKSmartCardUserInteractionForSecurePINChange?
```

## Parameters

`PINFormat`

The PIN format descriptor.

`APDU`

The Application Protocol Data Unit (APDU) used by the Smart Card to fill in PIN data.

`currentPINByteOffset`

The offset, in bytes, within the Application Protocol Data Unit (APDU) field to mark a location of a PIN block for filling in the entered PIN.

`newPINByteOffset`

The offset, in bytes, within the Application Protocol Data Unit (APDU) field to mark a location of a PIN block for filling in the new PIN.

## Return Value

A new user interaction object for secure PIN verification, or `nil` if this feature is not supported by the Smart Card reader.

## Discussion

You should only call this method after a session to the Smart Card has been established using the [`beginSession(reply:)`](/documentation/CryptoTokenKit/TKSmartCard/beginSession(reply:)) method, and before the session is terminated using the [`endSession()`](/documentation/CryptoTokenKit/TKSmartCard/endSession()) method.

Once the interaction has been successfully completed, the results are available via the [`resultData`](/documentation/CryptoTokenKit/TKSmartCardUserInteractionForPINOperation/resultData) and [`resultSW`](/documentation/CryptoTokenKit/TKSmartCardUserInteractionForPINOperation/resultSW) properties of the returned [`TKSmartCardUserInteractionForSecurePINVerification`](/documentation/CryptoTokenKit/TKSmartCardUserInteractionForSecurePINVerification) object.

---

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)