UNPKG

myinvois-sdk

Version:

TypeScript SDK for interacting with the Malaysia e-invoicing system (MyInvois) API

53 lines (52 loc) 1.64 kB
import { CertificateHandler } from './certificate-handler'; import { Invoice } from '../models/invoice'; import { SignedInvoice } from '../models/signed-invoice'; /** * Handles document signing operations */ export declare class DocumentSigner { private certificateHandler; /** * Creates a new document signer * @param certificateHandler The certificate handler to use */ constructor(certificateHandler: CertificateHandler); /** * Signs an invoice * @param invoice The invoice to sign * @returns A signed invoice */ signInvoice(invoice: Invoice): Promise<SignedInvoice>; /** * Transforms the document for signing * @param document The document to transform * @returns The transformed document as a string */ private transformForSigning; /** * Generates a document hash * @param document The document to hash * @returns The document hash */ private generateDocumentHash; /** * Creates signed properties * @returns The signed properties */ private createSignedProperties; /** * Generates a hash for the signed properties * @param signedProperties The signed properties * @returns The signed properties hash */ private generateSignedPropertiesHash; /** * Creates signature information * @param signature The signature * @param documentHash The document hash * @param signedProperties The signed properties * @param signedPropertiesHash The signed properties hash * @returns The signature information */ private createSignatureInfo; }