hpkeRepresentation(kem:)
Creates a serialized representation of the public key.
- iOS
- 13+
- macOS
- 10.15+
- Mac Catalyst
- 13+
- tvOS
- 13+
- visionOS
- 1.0+
- watchOS
- 6+
func hpkeRepresentation(kem: HPKE.KEM) throws -> Data Creates a serialized representation of the public key.
func hpkeRepresentation(kem: HPKE.KEM) throws -> Data s6Crypto4P256O12KeyAgreementO06PublicC0V18hpkeRepresentation3kem20FoundationEssentials4DataVAA4HPKEO3KEMO_tKF What are these?UYQWimport CryptoA cryptography library for Swift.
struct PublicKeyA P-256 public key used for key agreement.
enum P256An elliptic curve that enables NIST P-256 signatures and key agreement.
enum KeyAgreementA mechanism used to create a shared secret between two users by performing NIST P-256 elliptic curve Diffie Hellman (ECDH) key exchange.
enum HPKEA container for hybrid public key encryption (HPKE) operations.
enum KEMThe key encapsulation mechanisms to use in HPKE.
init<D>(_ serialization: D, kem: HPKE.KEM) throws where D : ContiguousBytes Creates a NIST P-256 elliptic curve public key for use with Diffie-Hellman key exchange.
init<Bytes>(compactRepresentation: Bytes) throws where Bytes : ContiguousBytes Creates a P-256 public key for key agreement from a compact representation of the key.
init<Bytes>(compressedRepresentation: Bytes) throws where Bytes : ContiguousBytes Creates a P-256 public key for key agreement from a compressed representation of the key.
init<Bytes>(derRepresentation: Bytes) throws where Bytes : RandomAccessCollection, Bytes.Element == UInt8 Creates a P-256 public key for key agreement from a Distinguished Encoding Rules (DER) encoded representation.
init(pemRepresentation: String) throws Creates a P-256 public key for key agreement from a Privacy-Enhanced Mail (PEM) representation.
init<D>(rawRepresentation: D) throws where D : ContiguousBytes Creates a P-256 public key for key agreement from a collection of bytes.
init<Bytes>(x963Representation: Bytes) throws where Bytes : ContiguousBytes Creates a P-256 public key for key agreement from an ANSI x9.63 representation.
var compactRepresentation: Data? { get }A compact representation of the public key.
var compressedRepresentation: Data { get }A compressed representation of the public key.
var derRepresentation: Data { get }A Distinguished Encoding Rules (DER) encoded representation of the public key.
var pemRepresentation: String { get }A Privacy-Enhanced Mail (PEM) representation of the public key.
var rawRepresentation: Data { get }A full representation of the public key.
var x963Representation: Data { get }An ANSI x9.63 representation of the public key.
typealias EphemeralPrivateKey = P256.KeyAgreement.PrivateKeyThe type of the ephemeral private key associated with this public key.
typealias HPKEEphemeralPrivateKey = P256.KeyAgreement.PrivateKeyThe type of the ephemeral private key associated with this public key.