vite-auto-deploy
Version:
用于配合 PHP 自动打包并上传打包后的文件到服务器指定目录的插件,此插件需要配合 php [项目地址](https://gitee.com/mxp131011/auto_deploy/)
47 lines (46 loc) • 1.49 kB
TypeScript
export type KeyPairInfo = {
/** 公匙 */
publicKey: string;
/** 私匙 */
privateKey: string;
/** 密匙对的ID */
keyPairId: string;
};
export type KeyPathInfo = {
/** 公匙保存路径 */
publicKeyPath: string;
/** 私匙保存路径 */
privateKeyPath: string;
/** 密匙对的ID保存路径 */
keyPairIdPath: string;
};
/**
* 得到保存或读取密匙的路径
* @param saveSecretKeyDirectory - 获取或生成密钥的路径
*/
export declare function getecretKeyPath(saveSecretKeyDirectory?: string): KeyPathInfo;
/**
* 创建密钥
* @param passphrase - 私钥的密码
* @param pathInfo - 密匙相关的保存路径
*/
export declare function createSecretKey(passphrase: string, pathInfo: KeyPathInfo): KeyPairInfo;
/**
* 得到密匙 (不存在就创建)
* @param passphrase - 私钥的密码
* @param pathInfo - 密匙相关的保存路径
* @param resetKey -是否重置密匙
*/
export declare function getSecretKey(passphrase: string, pathInfo: KeyPathInfo, resetKey: boolean, debug: boolean): KeyPairInfo;
/**
* Ed25519签名
* @param originalText - 原始文本
* @param privateKey - 私钥
* @param passphrase - 私钥的密码
*/
export declare function signEd25519(originalText: string, privateKey: string, passphrase: string): string;
/**
* 计算文件或字符串的 MD5 哈希值
* @param filePath - 文件路径
*/
export declare function calculateSHA256(fileContent: Buffer | string): string;