<!--
{
  "documentType" : "article",
  "framework" : "CryptoKit",
  "identifier" : "/documentation/CryptoKit/SecureEnclave/P256/KeyAgreement/PrivateKey/DiffieHellmanKeyAgreement-Implementations",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "DiffieHellmanKeyAgreement Implementations"
}
-->

# DiffieHellmanKeyAgreement Implementations

## Topics

### Instance Methods

[`func sharedSecretFromKeyAgreement(with: P256.KeyAgreement.PublicKey) throws -> SharedSecret`](/documentation/CryptoKit/SecureEnclave/P256/KeyAgreement/PrivateKey/sharedSecretFromKeyAgreement(with:))

Computes a shared secret with the provided public key from another
party.

---

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)