init(_:kem:)

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

HPKE-NIST-EC-KEMs.swift:50
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.