---
title: init()
framework: cryptokit
role: symbol
role_heading: Initializer
path: cryptokit/mldsa65/privatekey/init()
---

# init()

Creates a random MLDSA65 private key.

## Declaration

```swift
init() throws
```

## Discussion

Discussion This initializer is marked throws to support use in generic contexts, but key generation itself doesn’t produce errors. When you call this initializer directly on a concrete type, rather than through a generic type parameter, you can safely call try! to create the key: let privateKey = try! MLDSA65.PrivateKey()

## See Also

### Creating a private key

- [init(integrityCheckedRepresentation:)](cryptokit/mldsa65/privatekey/init(integritycheckedrepresentation:).md)
- [init(seedRepresentation:publicKey:)](cryptokit/mldsa65/privatekey/init(seedrepresentation:publickey:).md)
