One Logo Pool Ball
CryptoKit · IOS API REFERENCE

Curve25519.KeyAgreement.PublicKey

struct · iOS 13.0+ · SDK 27.1

struct PublicKey

A Curve25519 public key used for key agreement.

Members (4)

get · iOS 13.0+

rawRepresentation

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

A representation of the Curve25519 public key as a collection of bytes.

init · iOS 13.0+

init

TypeScript
static initRawRepresentation(rawRepresentation: ArrayBuffer): Curve25519_KeyAgreement_PublicKey
Swift declaration
init<D>(rawRepresentation: D) throws where D : ContiguousBytes

Creates a Curve25519 public key for key agreement from a collection of bytes. - Parameters: - rawRepresentation: A raw representation of the key as a collection of contiguous bytes.

method · iOS 17.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 17.0+

init

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

Creates a Curve25519 elliptic curve public key for use with Diffie-Hellman key exchange. - 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 →