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

# SecKeyGetBlockSize(_:)

Gets the block length associated with a cryptographic key.

```
func SecKeyGetBlockSize(_ key: SecKey) -> Int
```

## Parameters

`key`

The key for which you want the block length.

## Return Value

The block length associated with the key in bytes. If the key is an RSA key, for example, this is the size of the modulus.

## Discussion

---

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)