<!--
{
  "documentType" : "article",
  "framework" : "CryptoKit",
  "identifier" : "/documentation/CryptoKit/P521/KeyAgreement/PublicKey/HPKEPublicKeySerialization-Implementations",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "HPKEPublicKeySerialization Implementations"
}
-->

# HPKEPublicKeySerialization Implementations

## Topics

### Initializers

[`init<D>(D, kem: HPKE.KEM) throws`](/documentation/CryptoKit/P521/KeyAgreement/PublicKey/init(_:kem:))

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

### Instance Methods

[`func hpkeRepresentation(kem: HPKE.KEM) throws -> Data`](/documentation/CryptoKit/P521/KeyAgreement/PublicKey/hpkeRepresentation(kem:))

Creates a serialized representation of the public key.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)