Use Cases
- SSH Authentication: Store SSH keys for accessing remote servers or Git repositories
- JWT Signing: Sign and verify JSON Web Tokens for API authentication
- Encryption/Decryption: Encrypt data with the public key, decrypt with the private key
- Code Signing: Sign artifacts to verify authenticity and integrity
- Secure Communication: Establish encrypted channels between services
Configuration Options
Both keys must be PEM-encoded. The private key can be encrypted with a passphrase—if so, provide the passphrase so your workload can use the key.
Create a Keypair Secret
- Console UI
- CLI
- Terraform
- Pulumi
1
Navigate to Secrets
In the Console, navigate to Secrets and click New, or use the Create dropdown in the top-right corner and select Secret.
2
Enter basic information
Enter a Name and optional Description.
3
Select secret type
Select Keypair as the secret type.
4
Configure key data
Click Data in the left pane. For Secret Key, drag and drop your private key file or click to import. For Public Key, drag and drop your public key file or click to import. Enter the Passphrase if the private key is encrypted (optional).
5
Create the secret
Click Create.
Generating Key Pairs
RSA Keys
Ed25519 Keys (for SSH)
ECDSA Keys
Best Practices
Use strong key sizes
Use strong key sizes
For RSA, use at least 2048 bits (4096 recommended). For ECDSA, use P-256 or higher curves.
Protect private keys with passphrases
Protect private keys with passphrases
Always encrypt private keys with a strong passphrase when storing them, adding an extra layer of protection.
Rotate keys regularly
Rotate keys regularly
Establish a key rotation schedule. When rotating, update the secret and ensure workloads can handle the transition.
Limit access with policies
Limit access with policies
Use Control Plane policies to restrict which workloads can access the keypair. Only services that need to sign or decrypt should have access.
Next Steps
TLS Secrets
Store SSL/TLS certificates and keys
Using Secrets in Workloads
Learn how to grant access and inject secrets