UNPKG

xmldsigjs

Version:

XML Digital Signature implementation in TypeScript/JavaScript using Web Crypto API

34 lines (33 loc) 1.78 kB
import { IHashAlgorithm, ISignatureAlgorithm, HashAlgorithm, SignatureAlgorithm, ISignatureAlgorithmConstructable, IHashAlgorithmConstructable } from './algorithm.js'; import { SignatureMethod } from './xml/signature_method.js'; import { Transform } from './xml/index.js'; import { KeyInfoClauseConstructable } from './xml/key_infos/index.js'; export declare class CryptoConfig { /** * Creates Transform from given name * if name is not exist then throws error * * @static * @param {(string |)} [name=null] * @returns * * @memberOf CryptoConfig */ static CreateFromName(name: string | null): Transform; /** * Creates an instance of a signature algorithm based on the provided signature method. * * @param method - The signature method containing algorithm information and optional parameters. * @returns An instance of the resolved `SignatureAlgorithm`. * @throws {XmlError} If RSA-PSS parameters cannot be determined. * @throws {XmlError} If the signature algorithm is not supported. */ static CreateSignatureAlgorithm(method: SignatureMethod): SignatureAlgorithm; static CreateHashAlgorithm(namespace: string): HashAlgorithm; static GetHashAlgorithm(algorithm: AlgorithmIdentifier): IHashAlgorithm; static GetSignatureAlgorithm(algorithm: AlgorithmIdentifier): ISignatureAlgorithm; static CreateSignatureMethod(algorithm: ISignatureAlgorithm): SignatureMethod; static RegisterSignatureAlgorithm(namespace: string, algorithm: ISignatureAlgorithmConstructable): void; static RegisterHashAlgorithm(namespace: string, algorithm: IHashAlgorithmConstructable): void; static RegisterKeyInfoClause(localName: string, keyValue: KeyInfoClauseConstructable): void; }