One Logo Pool Ball
CryptoKit · IOS API REFERENCE

XWingMLKEM768X25519.PublicKey

struct · iOS 26.0+ · SDK 27.1

struct PublicKey

Members (5)

method · iOS 26.0+

encapsulate

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

Generates and encapsulates a shared secret. Share the encapsulated secret with the person who has the ``KEMPrivateKey``. They use ``KEMPrivateKey/decapsulate(_:)`` to recover the shared secret. - Returns: The shared secret, and its encapsulated version.

get · iOS 26.0+

rawRepresentation

TypeScript
get rawRepresentation(): ArrayBuffer
Swift declaration
var rawRepresentation: Data { get }
init · iOS 26.0+

init

TypeScript
static initRawRepresentation(rawRepresentation: ArrayBuffer): XWingMLKEM768X25519_PublicKey
Swift declaration
init<D>(rawRepresentation: D) throws where D : ContiguousBytes
method · iOS 26.0+

hpkeRepresentation

TypeScript
hpkeRepresentation(kem: HPKE_KEM): ArrayBuffer
Swift declaration
func hpkeRepresentation(kem: HPKE.KEM) throws -> Data

Creates a serialized representation of the public key. - Parameters: - kem: The Key Encapsulation Mechanism to use with the public key. - Throws: ``CryptoKit/HPKE/Errors/inconsistentCiphersuiteAndKey`` if the key encapsulation mechanism requested is incompatible with this public key. - Returns: The serialized representation of the public key.

init · iOS 26.0+

init

TypeScript
static initKem(serialization: ArrayBuffer, kem: HPKE_KEM): XWingMLKEM768X25519_PublicKey
Swift declaration
init<D>(_ serialization: D, kem: HPKE.KEM) throws where D : ContiguousBytes

Creates an X-Wing public key for use with HPKE. - Parameters: - serialization: The serialized bytes of the public key. - kem: The key encapsulation mechanism to use with the public key. - Throws: ``CryptoKit/HPKE/Errors/inconsistentCiphersuiteAndKey`` if the key encapsulation mechanism requested is incompatible with this public key.

Skipped declarations

No declarations were skipped in this snapshot.

All CryptoKit types →