---
title: SecureEnclave.P256.KeyAgreement.PrivateKey
framework: cryptokit
role: symbol
role_heading: Structure
path: cryptokit/secureenclave/p256/keyagreement/privatekey
---

# SecureEnclave.P256.KeyAgreement.PrivateKey

A P-256 private key used for key agreement.

## Declaration

```swift
struct PrivateKey
```

## Topics

### Creating a private key

- [init(dataRepresentation:authenticationContext:)](cryptokit/secureenclave/p256/keyagreement/privatekey/init(datarepresentation:authenticationcontext:).md)
- [init(compactRepresentable:accessControl:authenticationContext:)](cryptokit/secureenclave/p256/keyagreement/privatekey/init(compactrepresentable:accesscontrol:authenticationcontext:).md)

### Representing the key

- [dataRepresentation](cryptokit/secureenclave/p256/keyagreement/privatekey/datarepresentation.md)

### Finding the public key

- [publicKey](cryptokit/secureenclave/p256/keyagreement/privatekey/publickey.md)

### Creating a shared secret

- [sharedSecretFromKeyAgreement(with:)](cryptokit/secureenclave/p256/keyagreement/privatekey/sharedsecretfromkeyagreement(with:).md)
- [SharedSecret](cryptokit/sharedsecret.md)

### Initializers

- [init(compactRepresentable:accessControl:)](cryptokit/secureenclave/p256/keyagreement/privatekey/init(compactrepresentable:accesscontrol:).md)
- [init(dataRepresentation:)](cryptokit/secureenclave/p256/keyagreement/privatekey/init(datarepresentation:).md)

### Default Implementations

- [DiffieHellmanKeyAgreement Implementations](cryptokit/secureenclave/p256/keyagreement/privatekey/diffiehellmankeyagreement-implementations.md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [DiffieHellmanKeyAgreement](cryptokit/diffiehellmankeyagreement.md)
- [Escapable](swift/escapable.md)
- [HPKEDiffieHellmanPrivateKey](cryptokit/hpkediffiehellmanprivatekey.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
