UNPKG

@lightninglabs/lnc-web

Version:

Lightning Node Connect npm module for web

39 lines 1.45 kB
import { WrappedKey } from './types'; /** * Crypto service for session credential encryption and key wrapping operations. * Provides AES-GCM encryption and key wrapping functionality for session management. */ export default class CryptoService { /** * Generate a random credentials key for encrypting session data */ generateRandomCredentialsKey(): Promise<CryptoKey>; /** * Encrypt credentials using the credentials key */ encryptCredentials(credentialsKey: CryptoKey, plaintext: string): Promise<{ ciphertextB64: string; ivB64: string; }>; /** * Decrypt credentials using the credentials key */ decryptCredentials(credentialsKey: CryptoKey, ciphertextB64: string, ivB64: string): Promise<string>; /** * Wrap credentials key with device key. */ wrapWithDeviceKey(credentialsKey: CryptoKey, deviceKey: CryptoKey): Promise<WrappedKey>; /** * Unwrap credentials key with device key. */ unwrapWithDeviceKey(deviceKey: CryptoKey, keyB64: string, ivB64: string): Promise<CryptoKey>; /** * Wrap credentials key with origin key */ wrapWithOriginKey(credentialsKey: CryptoKey, originKey: CryptoKey): Promise<WrappedKey>; /** * Unwrap credentials key with origin key */ unwrapWithOriginKey(originKey: CryptoKey, keyB64: string, ivB64: string): Promise<CryptoKey>; } //# sourceMappingURL=cryptoService.d.ts.map