<!--
{
  "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/TKSmartCardPINFormat",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "CryptoTokenKit"
    ],
    "preciseIdentifier" : "c:objc(cs)TKSmartCardPINFormat"
  },
  "title" : "TKSmartCardPINFormat"
}
-->

# TKSmartCardPINFormat

The formatting properties for a PIN, such as character encoding and length constraints.

```
class TKSmartCardPINFormat
```

## Overview

You typically interact with `TKSmartCardPINFormat` objects when calling the [`userInteractionForSecurePINChange(_:apdu:currentPINByteOffset:newPINByteOffset:)`](/documentation/CryptoTokenKit/TKSmartCard/userInteractionForSecurePINChange(_:apdu:currentPINByteOffset:newPINByteOffset:)) and [`userInteractionForSecurePINVerification(_:apdu:pinByteOffset:)`](/documentation/CryptoTokenKit/TKSmartCard/userInteractionForSecurePINVerification(_:apdu:pinByteOffset:)) methods on an instance of [`TKSmartCard`](/documentation/CryptoTokenKit/TKSmartCard).

## Topics

### Configuring PIN Formatting

[`charset`](/documentation/CryptoTokenKit/TKSmartCardPINFormat/charset-swift.property)

The format of PIN characters. `TKSmartCardPINCharsetNumeric` by default.

[`encoding`](/documentation/CryptoTokenKit/TKSmartCardPINFormat/encoding-swift.property)

The encoding of PIN characters. `TKSmartCardPINEncodingASCII` by default.

[`minPINLength`](/documentation/CryptoTokenKit/TKSmartCardPINFormat/minPINLength)

The minimum number of characters to form a valid PIN. `4` by default.

[`maxPINLength`](/documentation/CryptoTokenKit/TKSmartCardPINFormat/maxPINLength)

The maximum number of characters to form a valid PIN. `8` by default.

[`pinBlockByteLength`](/documentation/CryptoTokenKit/TKSmartCardPINFormat/pinBlockByteLength)

The total length of the PIN block in bytes. `8` by default.

[`pinJustification`](/documentation/CryptoTokenKit/TKSmartCardPINFormat/pinJustification)

The justification within the PIN block. `TKSmartCardPINJustificationLeft` by default.

[`pinBitOffset`](/documentation/CryptoTokenKit/TKSmartCardPINFormat/pinBitOffset)

The offset, in bits, within the PIN block to mark a location for filling in the formatted PIN, which is justified with respect to the [`pinJustification`](/documentation/CryptoTokenKit/TKSmartCardPINFormat/pinJustification) property value. `0` by default.

[`pinLengthBitOffset`](/documentation/CryptoTokenKit/TKSmartCardPINFormat/pinLengthBitOffset)

The offset, in bits, within the PIN block to mark a location for filling in the PIN length, which is always left justified. `0` by default.

[`pinLengthBitSize`](/documentation/CryptoTokenKit/TKSmartCardPINFormat/pinLengthBitSize)

The size, in bits, of the PIN length field. If set to `0`, PIN length is not written. `0` by default.

### PIN Characteristics

[`TKSmartCardPINFormat.Charset`](/documentation/CryptoTokenKit/TKSmartCardPINFormat/Charset-swift.enum)

Possible PIN character sets.

[`TKSmartCardPINFormat.Encoding`](/documentation/CryptoTokenKit/TKSmartCardPINFormat/Encoding-swift.enum)

Possible PIN encoding types.

[`TKSmartCardPINFormat.Justification`](/documentation/CryptoTokenKit/TKSmartCardPINFormat/Justification)

Possible PIN justification types



---

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)