Initializer

init(size:)

Generates a new random key of the given size.

Declaration

init(size: SymmetricKeySize)

Parameters

size

The size of the key to generate. You can use one of the standard sizes, like bits256, or you can create a key of custom length by initializing a SymmetricKeySize instance with a non-standard value.

See Also

Creating a Key

init<D>(data: D)

Creates a key from the given data.

struct SymmetricKeySize

The sizes that a symmetric cryptographic key can take.