@supernova-team/xml-sunat
Version:
Librería para poder firmar XML's según la SUNAT
27 lines (26 loc) • 985 B
TypeScript
export declare class XmlSignature {
private pfxFilePath;
private password;
private xmlStringStructure;
private readonly canonicalizationAlgorithm;
private readonly signatureAlgorithm;
private readonly signXpath;
private readonly transforms;
private readonly digestAlgorithm;
/**
*
* @param {string} pfxFilePath - The .pfx file path
* @param {string} password - The password of the .pfx file
* @param {string} xmlStringStructure - The XML string structure to be signed
*/
constructor(pfxFilePath: string, password: string, xmlStringStructure: string);
private verifyXMLStructure;
/**
* @throws {Error} Error if the XML structure is not valid
* @throws {Error} Error if the PFX file is not valid
* @throws {Error} Error if the PFX file does not contain a private key
* @returns {Promise<string>} The signed XML string
*/
getSignedXML(): Promise<string>;
private convertPFXtoPEM;
}