import { Signature } from './common'; type BinaryLike = ArrayBufferLike | ArrayBufferView; export declare function buf2base64url(buffer: BinaryLike): string; export declare function base64ToBuf(base64: string): Uint8Array; export declare function hex2buf(hex: string): Uint8Array; export declare function buf2string(buffer: BinaryLike): string; export declare function string2buf(str: string): ArrayBuffer; /** * !!! READ PEM FILE DERIVATES INTENTIONALLY LEFT OUT (fs operations) !!! */ interface MakeMessageChunkSignatureOptions { algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams; privateKey: CryptoKey; } /** * @method makeMessageChunkSignature * @param chunk * @param options * @param options.signatureLength * @param options.algorithm for example "RSA-SHA256" * @param options.privateKey * @return - the signature */ export declare function makeMessageChunkSignature(chunk: BinaryLike, options: MakeMessageChunkSignatureOptions): Promise; export interface VerifyMessageChunkSignatureOptions { algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams; publicKey: CryptoKey; } /** * @method verifyMessageChunkSignature * * var signer = { * signatureLength : 128, * algorithm : "RSA-SHA256", * public_key: "qsdqsdqsd" * }; * @param block_to_verify {Buffer} * @param signature {Buffer} * @param options {Object} * @param options.signatureLength {Number} * @param options.algorithm {String} for example "RSA-SHA256" * @param options.publicKey {Buffer}* * @return {Boolean} - true if the signature is valid */ export declare function verifyMessageChunkSignature(blockToVerify: BinaryLike, signature: BinaryLike, options: VerifyMessageChunkSignatureOptions): PromiseLike; export declare function makeSHA1Thumbprint(buffer: BinaryLike): PromiseLike; export declare enum PaddingAlgorithm { RSA_PKCS1_OAEP_PADDING = 4, RSA_PKCS1_PADDING = 1 } export declare const RSA_PKCS1_PADDING = PaddingAlgorithm.RSA_PKCS1_PADDING; export declare const RSA_PKCS1_OAEP_PADDING = PaddingAlgorithm.RSA_PKCS1_OAEP_PADDING; export declare function publicEncrypt_long(buffer: Uint8Array, publicKey: CryptoKey, padding: number, algorithm?: PaddingAlgorithm): Promise; export declare function privateDecrypt_long(buffer: Uint8Array, privateKey: CryptoKey, algorithm?: number): Promise; export declare function rsaKeyLength(key: CryptoKey): number; export {}; //# sourceMappingURL=crypto_utils.d.ts.map