UNPKG

kaven-utils

Version:

Utils for Node.js.

47 lines (46 loc) 1.67 kB
/******************************************************************** * @author: Kaven * @email: kaven@wuwenkai.com * @website: http://blog.kaven.xyz * @file: [Kaven-Utils] /src/KavenUtility.Crypto.ts * @create: 2020-07-11 09:17:40.793 * @modify: 2024-11-01 16:53:15.964 * @version: 5.4.5 * @times: 19 * @lines: 202 * @copyright: Copyright © 2020-2024 Kaven. All Rights Reserved. * @description: [description] * @license: [license] ********************************************************************/ import { GeneratedCertificateFiles } from "./GeneratedCertificateFiles.js"; import { ICertificateCreationOptions } from "./base/Interfaces.js"; /** * @since 2.0.7 * @version 2020-07-11 */ export declare function GenerateEncryptPassword(keySize?: number, ivSize?: number): string; /** * * @param str some clear text data * @param password Password used to generate key, use `GenerateEncryptPassword` to generate it. * @param algorithm * @since 2.0.7 * @version 2020-07-11 */ export declare function EncryptString(str: string, password: string, algorithm?: string): string; /** * * @param encryptedStr * @param password Password used to generate key * @param algorithm * @since 2.0.7 * @version 2020-07-11 */ export declare function DecryptString(encryptedStr: string, password: string, algorithm?: string): string; /** * Please make sure you have `openssl` already installed on your system/container. * @param options * @since 4.1.0 * @version 2022-04-25 */ export declare function GenerateCertificate(options?: ICertificateCreationOptions): Promise<GeneratedCertificateFiles>;