One Logo Pool Ball
CryptoKit · IOS API REFERENCE

SymmetricKeySize

struct · iOS 13.0+ · SDK 27.1

struct SymmetricKeySize

The sizes that a symmetric cryptographic key can take. When creating a new ``SymmetricKey`` instance with a call to its ``SymmetricKey/init(size:)`` initializer, you typically use one of the standard key sizes, like ``bits128``, ``bits192``, or ``bits256``. When you need a key with a non-standard length, use the ``init(bitCount:)`` initializer to create a `SymmetricKeySize` instance with a custom bit count.

Members (5)

get · iOS 13.0+

bits128

TypeScript
static get bits128(): SymmetricKeySize
Swift declaration
static var bits128: SymmetricKeySize { get }

A size of 128 bits.

get · iOS 13.0+

bits192

TypeScript
static get bits192(): SymmetricKeySize
Swift declaration
static var bits192: SymmetricKeySize { get }

A size of 192 bits.

get · iOS 13.0+

bits256

TypeScript
static get bits256(): SymmetricKeySize
Swift declaration
static var bits256: SymmetricKeySize { get }

A size of 256 bits.

init · iOS 13.0+

init

TypeScript
static init(bitCount: number): SymmetricKeySize
Swift declaration
init(bitCount: Int)

Creates a new key size of the given length. In most cases, you can use one of the standard key sizes, like bits256. If instead you need a key with a non-standard size, use the ``init(bitCount:)`` initializer to create a custom key size. - Parameters: - bitCount: The number of bits in the key size.

get · iOS 13.0+

bitCount

TypeScript
get bitCount(): number
Swift declaration
let bitCount: Int

The number of bits in the key.

Skipped declarations

No declarations were skipped in this snapshot.

All CryptoKit types →