import { AesModel } from './utility.model'; export declare class UofxCrypto { private static _serverPublicKey; /** 設定 server 端的 public key */ static set serverPublicKey(key: string); /** 取得 server 端的 public key */ static get serverPublicKey(): string; /** * 密碼加密 * @param password 密碼 * @param isManagement 後台註記 * @memberof UofxCrypto */ static encryptBitBe(bitbe: string, isManagement?: boolean): string; /** * 加密資料用:透過 AES 加密內容,並使用 RSA 加密 AES key 與 iv * @param info 欲加密的資訊 * @param isManagement 後台註記 * @memberof UofxCrypto * @return 混合加密後的資料,包含 AES 加密的內容與 RSA 加密的 AES key 與 iv */ static encryptData(info: string, isManagement?: boolean): { encAesKey: string; encAesIv: string; encData: any; }; /** * 使用public key對資料進行RSA-OAEP加密 * - * 使用forge進行RSA-OAEP加密;Reference: https://www.npmjs.com/package/node-forge * @param {*} data 要被加密的資料 * @memberof UofxCrypto */ static encryptByPublicKey(data: unknown): string; /** * 進行AES加密,並取得一個暗碼字串 * @static * @param {unknown} encryptStr 要被加密的字串 * @param {string} key AES key * @param {Record} config AES相關設定 (iv、mode、padding...etc) * @return {*} 回傳暗碼結果 * @memberof UofxCrypto */ static aesEncrypt(encryptStr: string, key: string, config: Record): any; /** * 進行AES解密,並取得明碼結果 * @static * @param {string} decryptStr 要被解碼的暗碼字串 * @param {string} key AES key * @param {Record} config AES相關設定 (iv、mode、padding...etc) * @return {*} 回傳明碼結果 * @memberof UofxCrypto */ static aesDecrypt(decryptStr: string, key: string, config: Record): any; /** * 取得有RSA加密過的AES model * @static * @param {string} key AES key * @param {string} iv AES iv * @return {*} * @memberof UofxCrypto */ static getAesModelWithRsaEncrypt(key: string, iv: string): AesModel; /** * pdf viewer檔案解密後的密碼 * @static * @param {string} pdfPwd 從後端取得的暗碼 * @param {string} key AES key * @param {string} iv AES iv * @return {*} 解密後的明碼 * @memberof UofxCrypto */ static decryptPdfPwd(pdfPwd: string, key: string, iv: string): any; /** * @private 建立被加密的內容 * @static * @param {string} info 要被加密的資訊 * @param {boolean} isManagement 後台註記 * @return {*} * @memberof UofxCrypto */ private static createBitBePayload; /** * @private 產生可直接給 aesEncrypt 以 Utf8.parse 使用的隨機 ASCII 字串 * @static * @param {number} length 要產生的字串長度 * @return {*} {string} 產生的隨機 ASCII 字串 * @memberof UofxCrypto */ private static generateRandomAsciiSecret; }