UNPKG

accounts

Version:

Tempo Accounts SDK

40 lines 1.62 kB
import { type Keystore } from '../Keystore.js'; /** * WebCrypto P-256 keystore. The built-in default (see `Keystore.defaults`). * * By default the key is generated non-extractable: the private key never has * a JS-visible encoding, and the handle holds the live `CryptoKey`, which * persists only through structured-clone storage (`Storage.idb`, * `Storage.memory`) — on string-based storage the key is session-only. * * Pass `extractable: true` for environments without structured-clone storage * where keys must survive restarts (e.g. React Native, Node, CLI): the * private key is exported once as a JWK (at-rest protection is the host * app's storage adapter) and re-imported non-extractable each session. In * browsers with IndexedDB storage, prefer the non-extractable default. * * @example * ```ts * import { Keystore, Provider } from 'accounts' * * const provider = Provider.create({ * accessKey: { keystores: { p256: Keystore.webCryptoP256({ extractable: true }) } }, * }) * ``` */ export declare function webCryptoP256(options?: webCryptoP256.Options): Keystore; export declare namespace webCryptoP256 { /** Options for {@link webCryptoP256}. */ type Options = { /** * Generate the key extractable and persist it as a JWK so it survives * string-based storage adapters. When `false` (default), the key is * non-extractable from creation and persists only through * structured-clone storage. * * @default false */ extractable?: boolean | undefined; }; } //# sourceMappingURL=webCryptoP256.d.ts.map