dotencr
Version:
Encrypt and decrypt individual lines inside a .env file. Supports multiple encryption keys. Keys and dotenv files can be read text file or read from the environment.
46 lines (45 loc) • 1.27 kB
TypeScript
import { JWKS, JWK } from "jose";
import { DotenvParserCryptoKey } from "./dotenv_parser";
/**
* Class used to load and manage the encryption keys
*/
export declare class CryptoKeyManager {
jwks: JWKS.KeyStore;
parser: DotenvParserCryptoKey;
/**
* Do any of the encryption keys have errors
*/
hasErrors(): boolean;
/**
* Return all the encryption key errors
*/
errors(): string[];
/**
* Given the encryption key name, generate the full name including the prefix and
* separators.
* @param keyName Name of the encryption key to find
*/
buildDotenvNameFromKeyName(keyName: string): string;
/**
* Load the encryption keys from the process.env. This is the default.
*/
loadFromEnv(): void;
/**
* Any object can be with key value pairs can be used
* @param env and object with key value pairs
*/
loadFromObject(env: object): void;
/**
* Get a specific key
* @param keyName Name of the encryption key to find
*/
get(keyName?: string): JWK.Key;
/**
* Return all of the encryption keys
*/
all(): JWK.Key[];
/**
* Return all of the encryption key names as an array of strings
*/
allKeys(): string[];
}