1 | import { AsyncOptionalCreatable } from '@salesforce/kit';
|
2 | import { Optional } from '@salesforce/ts-types';
|
3 | import { KeyChain } from './keyChainImpl';
|
4 | interface CryptoOptions {
|
5 | keychain?: KeyChain;
|
6 | platform?: string;
|
7 | retryStatus?: string;
|
8 | noResetOnClose?: boolean;
|
9 | }
|
10 |
|
11 |
|
12 |
|
13 | export declare class Crypto extends AsyncOptionalCreatable<CryptoOptions> {
|
14 | private _key;
|
15 | private options;
|
16 | private messages;
|
17 | private noResetOnClose;
|
18 | |
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 | constructor(options?: CryptoOptions);
|
25 | /**
|
26 | * Encrypts text. Returns the encrypted string or undefined if no string was passed.
|
27 | * @param text The text to encrypt.
|
28 | */
|
29 | encrypt(text?: string): Optional<string>;
|
30 | /**
|
31 | * Decrypts text.
|
32 | * @param text The text to decrypt.
|
33 | */
|
34 | decrypt(text?: string): Optional<string>;
|
35 | /**
|
36 | * Clears the crypto state. This should be called in a finally block.
|
37 | */
|
38 | close(): void;
|
39 | /**
|
40 | * Initialize async components.
|
41 | */
|
42 | protected init(): Promise<void>;
|
43 | private getKeyChain;
|
44 | }
|
45 | export {};
|