One Logo Pool Ball
CryptoKit · IOS API REFERENCE

MLKEM768.PublicKey

struct · iOS 26.0+ · SDK 27.1

struct PublicKey

A public key you use to encapsulate shared secrets with the Module-Lattice key encapsulation mechanism.

Members (3)

method · iOS 26.0+

encapsulate

TypeScript
encapsulate(): KEM_EncapsulationResult
Swift declaration
func encapsulate() throws -> KEM.EncapsulationResult

Generates and encapsulates a shared secret. - Returns: an encapsulated shared secret, that you decapsulate by calling ``MLKEM768/PrivateKey/decapsulate(_:)`` on the corresponding private key.

get · iOS 26.0+

rawRepresentation

TypeScript
get rawRepresentation(): ArrayBuffer
Swift declaration
var rawRepresentation: Data { get }

A serialized representation of the public key.

init · iOS 26.0+

init

TypeScript
static init(rawRepresentation: ArrayBuffer): MLKEM768_PublicKey
Swift declaration
init<D>(rawRepresentation: D) throws where D : DataProtocol

Initializes a public key from a raw representation. - Parameter rawRepresentation: Data that represents the public key.

Skipped declarations

No declarations were skipped in this snapshot.

All CryptoKit types →