{"id":31395810,"url":"https://github.com/jacobshirley/pki-lite","last_synced_at":"2026-04-28T14:04:45.737Z","repository":{"id":317019691,"uuid":"1061196548","full_name":"jacobshirley/pki-lite","owner":"jacobshirley","description":"Lightweight, modern PKI toolkit for TypeScript — X.509, PKCS, signatures, and more","archived":false,"fork":false,"pushed_at":"2026-04-07T15:53:09.000Z","size":1312,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-07T16:31:58.898Z","etag":null,"topics":["certificate","library","npm","pki","typescript","validation","x509"],"latest_commit_sha":null,"homepage":"https://jacobshirley.github.io/pki-lite/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jacobshirley.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-21T12:47:24.000Z","updated_at":"2026-04-07T16:29:59.000Z","dependencies_parsed_at":"2025-09-28T10:21:18.752Z","dependency_job_id":"669cabed-4083-4e4b-af06-d864a521b103","html_url":"https://github.com/jacobshirley/pki-lite","commit_stats":null,"previous_names":["jacobshirley/pki-lite"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/jacobshirley/pki-lite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobshirley%2Fpki-lite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobshirley%2Fpki-lite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobshirley%2Fpki-lite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobshirley%2Fpki-lite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacobshirley","download_url":"https://codeload.github.com/jacobshirley/pki-lite/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobshirley%2Fpki-lite/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31520577,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["certificate","library","npm","pki","typescript","validation","x509"],"created_at":"2025-09-29T10:36:59.502Z","updated_at":"2026-04-07T17:02:01.941Z","avatar_url":"https://github.com/jacobshirley.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"**[Examples](./EXAMPLES.md)** | **[Documentation](https://jacobshirley.github.io/pki-lite/v1)**\n\n# PKI-Lite: Lightweight Public Key Infrastructure Library\n\nA modern, lightweight JavaScript/TypeScript library for Public Key Infrastructure (PKI) operations. PKI-Lite provides core cryptographic capabilities for working with X.509 certificates, PKCS standards, digital signatures, and more.\n\n\u003e **Notice:**  \n\u003e _This package is new. If you plan to use it in production, please review the code and functionality closely to ensure it meets your security and reliability requirements._\n\n[![npm version](https://img.shields.io/npm/v/pki-lite.svg)](https://www.npmjs.com/package/pki-lite)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## Features\n\n- **X.509 Certificate Operations**: Create, validate, and manage X.509 certificates\n- **PKCS Standards Support**: Implementations of PKCS#7, PKCS#5, PKCS#12\n- **Digital Signatures**: Create and verify digital signatures\n- **Time Stamping**: RFC 3161 time stamping protocol support\n- **OCSP**: Online Certificate Status Protocol implementation\n- **Certificate Revocation**: CRL (Certificate Revocation List) functionality\n- **Adobe Digital Signatures**: Supports Adobe-specific signature formats\n\n## Getting Started\n\n### Installation\n\n```bash\nnpm install pki-lite\npnpm add pki-lite\nyarn add pki-lite\n\n# If you need extended crypto functionality\nnpm install pki-lite-crypto-extended\npnpm add pki-lite-crypto-extended\nyarn add pki-lite-crypto-extended\n```\n\n## Usage Examples\n\n```typescript\nimport { PrivateKeyInfo } from 'pki-lite/keys/PrivateKeyInfo.js'\nimport { Certificate } from 'pki-lite/x509/Certificate.js'\n\nconst privateKeyPem = `-----BEGIN PRIVATE KEY-----{your private key here}-----END PRIVATE`\nconst certPem = `-----BEGIN CERTIFICATE-----{your certificate here}-----END CERTIFICATE-----`\n\nconst selfSigned = await Certificate.createSelfSigned({\n    subject: 'CN=Test Self-Signed Certificate, O=My Organization, C=US',\n    validity: {\n        notBefore: new Date('2023-01-01T00:00:00Z'),\n        notAfter: new Date('2024-01-01T00:00:00Z'),\n    },\n    privateKeyInfo: PrivateKeyInfo.fromPem(privateKeyPem),\n    subjectPublicKeyInfo:\n        Certificate.fromPem(certPem).tbsCertificate.subjectPublicKeyInfo,\n})\n\nconsole.log('Self-Signed Certificate PEM:', selfSigned.toPem())\n```\n\nFor more examples, see [EXAMPLES.md](EXAMPLES.md) file or the `examples` directory.\n\n## Crypto Providers\n\nPKI-Lite aims to keep the number of dependencies down to improve security and reduce bundle size. This means not all cryptographic algorithms are supported out of the box. To address this, PKI-Lite uses a layered approach to cryptographic operations:\n\n### Default: Web Crypto API\n\nThe core `pki-lite` package uses the **[Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API)** as its primary crypto provider. This provides:\n\n- **Zero additional dependencies** - Uses platform-native cryptography\n- **Modern algorithms** - RSA, ECDSA, SHA-256, SHA-384, SHA-512, AES-GCM\n- **Cross-platform** - Works in browsers and Node.js (16+)\n- **High performance** - Hardware-accelerated when available\n- **Secure** - Cryptographic operations are handled by the platform\n\n**The Web Crypto provider is sufficient for most modern PKI use cases.** [Learn more about Web Crypto API →](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API)\n\n### Extended: pki-lite-crypto-extended\n\nFor legacy systems or specialized requirements, use `pki-lite-crypto-extended`:\n\n- **Legacy algorithms** - MD5, older cipher modes\n- **Password-based encryption algorithms** - 3DES, RC2, RC4, etc\n- **Additional AES modes** - ECB, CBC (no padding)\n- **Additional dependencies** - Pulls in libraries `node-forge`, `@noble/hashes` and `@noble/ciphers`\n- **Larger bundle size** - Not recommended unless you need specific algorithms\n\n### When to Use Extended Crypto\n\n```typescript\n// When you need legacy algorithms or specific cipher modes\n// All you need is to import the extended package once,\n// and any PKI operations will automatically use it.\n// NB: It calls `setCryptoProvider` internally.\nimport 'pki-lite-crypto-extended'\n\n// Most modern use cases - use core pki-lite\nimport { Certificate } from 'pki-lite/x509/Certificate.js'\n```\n\n**Recommendation**: Start with the core `pki-lite` package. Only add `pki-lite-crypto-extended` if you encounter specific algorithm requirements that Web Crypto doesn't support.\n\n## Packages\n\nThis monorepo contains the following packages:\n\n| Package                    | Description                                                                          |\n| -------------------------- | ------------------------------------------------------------------------------------ |\n| `pki-lite`                 | Core PKI functionality with essential cryptographic operations                       |\n| `pki-lite-crypto-extended` | Extended cryptographic capabilities including MD5 hashing and AES ECB/CBC encryption |\n\n## Project aims\n\n- **Lightweight**: Minimal dependencies to reduce bundle size and improve security\n- **Cross-Platform**: Works seamlessly in both browser and Node.js environments\n- **Modern Standards**: Supports the latest PKI standards\n- **Extensible**: Easy to add new algorithms and structures\n- **Secure**: Prioritizes security best practices in all implementations\n\n## Development\n\n### Compilation\n\n```bash\n# Compile all packages\npnpm compile\n\n# Watch mode for development\ncd packages/pki-lite\npnpm watch\n```\n\n### Testing\n\n```bash\n# Run all tests\npnpm test\n\n# Run unit tests for a specific package\ncd packages/pki-lite\npnpm test:unit\n\n# Run acceptance tests\npnpm test:acceptance\n\n# Run integration tests\npnpm test:integration\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for more details.\n\n## Acknowledgments\n\n- Uses [asn1js](https://www.npmjs.com/package/asn1js) for ASN.1 parsing and serialization\n- Extended crypto functionality provided by [noble-hashes](https://github.com/paulmillr/noble-hashes) and [noble-ciphers](https://github.com/paulmillr/noble-ciphers) and [node-forge](https://github.com/digitalbazaar/forge)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacobshirley%2Fpki-lite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacobshirley%2Fpki-lite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacobshirley%2Fpki-lite/lists"}