---
title: "CryptoKeyPair | Grafana k6 documentation"
description: "CryptoKeyPair represents an asymmetric key pair with public and private keys."
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# CryptoKeyPair

The `CryptoKeyPair` object represents an asymmetric key pair with public and private keys.

The [`generateKey`](/docs/k6/latest/javascript-api/crypto/subtlecrypto/generatekey/) method can be used to create `CryptoKeyPair` object for asymmetric algorithms such as `ECDH` or `ECDSA`.

## Properties

Expand table

| Property   | Type                                                            | Description    |
|------------|-----------------------------------------------------------------|----------------|
| publicKey  | [`CryptoKey`](/docs/k6/latest/javascript-api/crypto/cryptokey/) | A public key.  |
| privateKey | [`CryptoKey`](/docs/k6/latest/javascript-api/crypto/cryptokey/) | A private key. |
