PKIjs

PKI.js 是一个纯 JavaScript 库,实现了 PKI 应用中使用的格式(签名、加密、证书请求、OCSP 和 TSP 请求/回复)。它建立在 WebCrypto(Web Cryptography API)上,不需要任何插件。「PKI.js is a pure JavaScript library implementing the formats that are used in PKI applications (signing, encryption, certificate requests, OCSP and TSP requests/responses). It is built on WebCrypto (Web Cryptography API) and requires no plug-ins.」

Github星跟蹤圖

PKIjs

PKIjs 为构建 PKI 应用所需的最常见的格式和算法提供了一个 Typescript 实现。

能力

  • X.509 证书(RFC 5280)的创建和验证被所有支持证书的应用程序所使用。
  • PKCS#10(RFC 2986)是 X.509 应用最常用的注册数据结构。它使请求者能够证明对特定公钥的控制。
  • Cryptographic Message Syntax(RFC 5652)是 X.509 应用中最常用的数据结构,用于签署数据。CMS 使得签署和表示验证签名所需的所有数据都很容易。
  • 加密信息语法(RFC 5652)也是 X.509 应用中最常用的数据结构,用于加密数据。CMS 使得提供可互操作的数据加密变得容易。
  • 时间戳协议(RFC 3161)是证明数据在某个特定时间之前存在的最常用协议。它通常用于签名应用,以确保签名在未来很长一段时间内都是可验证的。

目标

  • 类型脚本和面向对象的实现
  • 不包含加密实现,而是利用 Web Crypto API
  • 在浏览器和 Node/Dino 中都能统一工作

安装

要安装稳定版。

npm install --save pkijs

假设你使用 npm 作为你的软件包管理器。

实例

证书和废止

用CMS进行签名和加密

时间戳

其他

文档

你可以 在网站上 找到 PKI.js 的文档。

想帮忙吗?

想提交一个错误,贡献一些代码,或改进文档吗?很好! 请阅读我们的贡献指南。

核心贡献者

Stepan Miroshin


主要指標

概覽
名稱與所有者PeculiarVentures/PKI.js
主編程語言TypeScript
編程語言JavaScript (語言數: 5)
平台Linux, Mac, Web browsers, Windows
許可證Other
所有者活动
創建於2014-02-06 18:38:11
推送於2025-04-08 08:08:30
最后一次提交2025-04-08 11:08:28
發布數38
最新版本名稱v3.2.5 (發布於 2025-03-12 17:36:42)
第一版名稱v1.0.2 (發布於 )
用户参与
星數1.3k
關注者數63
派生數208
提交數621
已啟用問題?
問題數329
打開的問題數63
拉請求數72
打開的拉請求數6
關閉的拉請求數33
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?

PKIjs

License
CircleCI
Known Vulnerabilities Coverage Status

NPM

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/Dino

Installation

To install the stable version:

npm install --save pkijs

This assumes you are using npm as your package manager.

Examples

Certificates and Revocation

Signing and Encryption with CMS

Timestamping

Other

Documentation

You can find the PKI.js documentation on the website.

Want to help?

Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contribution.

Core Contributors

Stepan Miroshin