validate-pfx
v1.0.1
Published
Check if a .pfx or .p12 certificate is valid
Maintainers
Readme
validate-pfx
A Node.js utility to check if a .pfx or .p12 certificate is valid.
This project was forked from https://github.com/talesmgodois/pfx-load. Thanks Tales!
Installation
npm install validate-pfxDescription
This package provides a simple way to validate .pfx (Personal Information Exchange) or .p12 (PKCS #12) certificate files. It helps you verify if a certificate is valid and can be used for authentication or signing purposes.
Features
- Validate .pfx and .p12 certificate files
- Check certificate expiration
- Verify certificate integrity
- Confirm password protection
Usage
import { validatePfx } from 'validate-pfx';
// Example with file path
const result = validatePfx({
pfxPath: '/path/to/certificate.pfx',
password: 'your-certificate-password'
});
console.log(result);
// { isPfxOutdated: true|false, isPasswordOrPfxInvalid: true|false, willWork: true|false }
API
validatePfx(options)
Validates a .pfx or .p12 certificate.
Options
pfxPath(string): Path to the .pfx or .p12 filepassword(string): Password for the certificate
Either pfxPath and password must be provided.
Returns
An object containing:
isPfxOutdated(boolean): Whether the certificate expiration date have reachedisPasswordOrPfxInvalid(boolean): If password is correct and certificate is validwillWork(boolean): if certificate is valid and password is correct
Development
# Install dependencies
npm install
# Run in development mode
npm run dev
# Build the project
npm run buildLicense
ISC
Author
Alessandro Tegla
