Encryption
Overview
Generating Keys
import { generateKeyPair } from '@shade402/core';
const { publicKey, privateKey } = generateKeyPair();
// Keys are in PEM format
console.log(publicKey);
// -----BEGIN PUBLIC KEY-----
// ...
// -----END PUBLIC KEY-----
console.log(privateKey);
// -----BEGIN PRIVATE KEY-----
// ...
// -----END PRIVATE KEY-----Encrypting Resources
Decrypting Resources
Server-side Setup
Generate and Store Keys
Load Keys in Application
Using Environment Variables
Client-side Usage
Manual Encryption (Explicit Client)
Complete Example
Server
Client
Security Considerations
Key Management
Using Key Management Service
Using Environment Variables
Error Handling
Best Practices
Next Steps
Last updated
