---
title: generate()
framework: cryptokit
role: symbol
role_heading: Type Method
path: cryptokit/kemonetimeprivatekey/generate()
---

# generate()

Generates a new random private key.

## Declaration

```swift
static func generate() throws -> Self
```

## Return Value

Return Value The generated private key.

## Discussion

Discussion Give the publicKey to another person so that they can encapsulate shared secrets that you recover by calling decapsulate(_:).
