init(_:kem:)

Creates a NIST P-384 elliptic curve public key for use with Diffie-Hellman key exchange.

HPKE-NIST-EC-KEMs.swift:101
iOS
13+
macOS
10.15+
tvOS
13+
watchOS
6+
init<D>(_ serialization: D, kem: HPKE.KEM) throws where D : ContiguousBytes

Throws

CryptoKit/HPKE/Errors/inconsistentCiphersuiteAndKey if the key encapsulation mechanism requested is incompatible with this public key.

  • serialization: The serialized bytes of the public key.

  • kem: The Key Encapsulation Mechanism to use with the public key.