Function Signature
Description
Reads a PKCS#12 certificate file (.p12 or .pfx) from the local filesystem and returns it as an ArrayBuffer suitable for use with thesignXml() function.
PKCS#12 files contain both the private key and certificate chain needed for digital signatures. These files are typically password-protected.
Parameters
The file system path to the PKCS#12 certificate file. Can be relative or absolute.
Returns
The certificate file data as an ArrayBuffer, ready to be passed to
signXml().Errors
- Throws file system errors if the file doesn’t exist or cannot be read
- May throw permission errors if the process lacks read access to the file
Example Usage
Example with Absolute Path
Related Functions
getP12FromUrl()- Load certificate from a URLsignXml()- Sign XML documents with the loaded certificate
src/services/signing.ts:5