first commit

This commit is contained in:
Stefan Hacker
2026-04-03 09:38:48 +02:00
commit 37ad745546
47450 changed files with 3120798 additions and 0 deletions
Generated Vendored
+30
View File
@@ -0,0 +1,30 @@
Copyright (c) 2014, GlobalSign
Copyright (c) 2015-2019, Peculiar Ventures
All rights reserved.
Author 2014-2019, Yury Strozhevsky
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
* Neither the name of the {organization} nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+76
View File
@@ -0,0 +1,76 @@
<h1 align="center">
PKIjs
</h1>
<div align="center">
![NPM License](https://img.shields.io/npm/l/pkijs)
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/PeculiarVentures/PKI.js/library.yml?label=test)
[![npm version](https://img.shields.io/npm/v/pkijs.svg)](https://www.npmjs.com/package/pkijs)
![Coveralls](https://img.shields.io/coverallsCoverage/github/PeculiarVentures/PKI.js)
[![npm downloads](https://img.shields.io/npm/dm/pkijs.svg)](https://www.npmjs.com/package/pkijs)
</div>
PKIjs provides a Typescript implementation of the most common formats and algorithms needed to build PKI-enabled applications
## Capabilities
- The creation and validation of X.509 certificates (RFC 5280) is used by all certificate-enabled applications.
- PKCS#10 (RFC 2986) is the most commonly used enrollment data structure used by X.509 applications. It enables the requestor to prove control of a given public key.
- Cryptographic Message Syntax (RFC 5652) is the most commonly used data structure for signing data in X.509 applications. CMS makes it easy to both sign and represent all of the data needed to verify a signature.
- Cryptographic Message Syntax (RFC 5652) is also the most commonly used data structure for encrypting data in X.509 applications. CMS makes it easy to provide interoperable data encryption.
- Time-Stamp Protocol (RFC 3161) is the most commonly used protocol for proving that data
existed before a particular time. It is commonly used in signing applications to ensure signatures are verifiable long into the future.
## Objectives
- Typescript and object-oriented implementation
- Contains no cryptographic implementations and instead leverages Web Crypto API
- Work uniformly both in browser and in [Node](https://nodejs.org/)/[Deno](https://deno.com/)
## Installation
To install the stable version:
```bash
npm install --save pkijs
```
This assumes you are using [npm](https://www.npmjs.com/) as your package manager.
## Examples
### Certificates and Revocation
- [Create and validate an X.509 certificate](https://pkijs.org/docs/examples/certificates-and-revocation/create-and-validate-certificate)
- [Working with certificate requests](https://pkijs.org/docs/examples/certificates-and-revocation/working-with-certificate-requests)
- [Creating and parsing CRLs](https://pkijs.org/docs/examples/certificates-and-revocation/creating-and-parsing-CRLs)
- [Working with OCSP requests](https://pkijs.org/docs/examples/certificates-and-revocation/working-with-OCSP-requests)
- [Working with OCSP responses](https://pkijs.org/docs/examples/certificates-and-revocation/working-with-OCSP-responses)
### Signing and Encryption with CMS
- [Working with CMS Signing](https://pkijs.org/docs/examples/signing-and-encryption-with-CMS/working-with-CMS-signing)
- [Working with CMS Certificate-based Encryption](https://pkijs.org/docs/examples/signing-and-encryption-with-CMS/working-with-CMS-certificate-based-encryption)
- [Working with CMS password-based Encryption](https://pkijs.org/docs/examples/signing-and-encryption-with-CMS/working-with-CMS-password-based-encryption)
- [Working with PKCS#7 Certificate bags (P7B)](https://pkijs.org/docs/examples/signing-and-encryption-with-CMS/working-with-PKCS-7-certificate-bags-P7B)
### Timestamping
- [Creating a Timestamp request](https://pkijs.org/docs/examples/timestamping/creating-a-timestamp-request)
- [Creating a Timestamp response](https://pkijs.org/docs/examples/timestamping/creating-a-timestamp-response)
### Other
- [How to verify a signature in a PDF file](https://pkijs.org/docs/examples/other/how-to-verify-a-signature-in-a-PDF-file)
- [S/MIME signature verification](https://pkijs.org/docs/examples/other/S-MIME-signature-verification)
- [S/MIME signature encryption](https://pkijs.org/docs/examples/other/S-MIME-signature-encryption)
- [Working with PKCS#12 files](https://pkijs.org/docs/examples/other/working-with-PKCS-12-files)
## Documentation
You can find the PKI.js documentation [on the website](https://pkijs.org/docs/installation).
## Want to help?
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for [contribution](https://github.com/PeculiarVentures/PKI.js/blob/master/CONTRIBUTING.md).
## Core Contributors
[Stepan Miroshin](https://github.com/microshine)
+9261
View File
File diff suppressed because one or more lines are too long
+19115
View File
File diff suppressed because it is too large Load Diff
+19340
View File
File diff suppressed because it is too large Load Diff
+91
View File
@@ -0,0 +1,91 @@
{
"author": {
"email": "yury@strozhevsky.com",
"name": "Yury Strozhevsky"
},
"description": "Public Key Infrastructure (PKI) is the basis of how identity and key management is performed on the web today. PKIjs is a pure JavaScript library implementing the formats that are used in PKI applications. It is built on WebCrypto and aspires to make it possible to build native web applications that utilize X.509 and the related formats on the web without plug-ins",
"contributors": [
{
"email": "rmh@unmitigatedrisk.com",
"name": "Ryan Hurst"
}
],
"repository": {
"type": "git",
"url": "git://github.com/PeculiarVentures/PKI.js.git"
},
"devDependencies": {
"@peculiar/webcrypto": "^1.5.0",
"@rollup/plugin-alias": "^5.1.1",
"@rollup/plugin-commonjs": "^28.0.7",
"@rollup/plugin-node-resolve": "^16.0.3",
"@types/mocha": "^10.0.10",
"@types/node": "^20.19.21",
"@typescript-eslint/eslint-plugin": "^8.46.1",
"@typescript-eslint/parser": "^8.46.1",
"assert": "^2.1.0",
"emailjs-mime-builder": "^2.0.5",
"emailjs-mime-parser": "^2.0.7",
"eslint": "^9.37.0",
"mocha": "^11.7.4",
"nyc": "^17.1.0",
"rollup": "^4.52.4",
"rollup-plugin-dts": "^6.2.3",
"rollup-plugin-typescript2": "^0.36.0",
"ts-node": "^10.9.2",
"typescript": "^5.9.3"
},
"dependencies": {
"@noble/hashes": "1.4.0",
"asn1js": "^3.0.6",
"bytestreamjs": "^2.0.1",
"pvtsutils": "^1.3.6",
"pvutils": "^1.1.3",
"tslib": "^2.8.1"
},
"scripts": {
"build": "rollup -c",
"build:examples": "rollup -c examples/rollup.config.js",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint --fix . --ext .ts",
"coverage": "nyc npm test",
"test": "mocha",
"prepublishOnly": "npm run build"
},
"keywords": [
"ES6",
"ES2015",
"WebCrypto",
"Web Cryptography API",
"X.509",
"certificate",
"crl",
"cms",
"encrypted",
"enveloped",
"OCSP",
"timestamp",
"PKCS"
],
"files": [
"build",
"README.md",
"LICENSE"
],
"module": "build/index.es.js",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"name": "pkijs",
"version": "3.4.0",
"license": "BSD-3-Clause",
"engines": {
"node": ">=16.0.0"
},
"devEngines": {
"packageManager": {
"name": "npm",
"version": ">=10",
"onFail": "error"
}
}
}