1 | import { AsyncOptionalCreatable } from '@salesforce/kit';
|
2 | import { KeyChain } from './keyChainImpl';
|
3 | interface CryptoOptions {
|
4 | keychain?: KeyChain;
|
5 | platform?: string;
|
6 | retryStatus?: string;
|
7 | noResetOnClose?: boolean;
|
8 | }
|
9 |
|
10 |
|
11 |
|
12 | export declare class Crypto extends AsyncOptionalCreatable<CryptoOptions> {
|
13 | private key;
|
14 | private options;
|
15 | private noResetOnClose;
|
16 | |
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | constructor(options?: CryptoOptions);
|
24 | /**
|
25 | * Encrypts text. Returns the encrypted string or undefined if no string was passed.
|
26 | *
|
27 | * @param text The text to encrypt.
|
28 | */
|
29 | encrypt(text: string): string;
|
30 | /**
|
31 | * Decrypts text.
|
32 | *
|
33 | * @param text The text to decrypt.
|
34 | */
|
35 | decrypt(text: string): string;
|
36 | /**
|
37 | * Takes a best guess if the value provided was encrypted by {@link Crypto.encrypt} by
|
38 | * checking the delimiter, tag length, and valid characters.
|
39 | *
|
40 | * @param text The text
|
41 | * @returns true if the text is encrypted, false otherwise.
|
42 | */
|
43 | isEncrypted(text?: string): boolean;
|
44 | |
45 |
|
46 |
|
47 | close(): void;
|
48 | |
49 |
|
50 |
|
51 | protected init(): Promise<void>;
|
52 | private getKeyChain;
|
53 | }
|
54 | export {};
|