# @digitalbazaar/ecdsa-rdfc-2019-cryptosuite 中文文档

规范地址：https://npmcn.com/package/%40digitalbazaar/ecdsa-rdfc-2019-cryptosuite/

版本：1\.3\.0
npm 元数据更新时间：2026-02-05T19:13:06.914Z
中文译文更新时间：2026-11-12T08:43:07.188Z
软件包许可：BSD-3-Clause

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40digitalbazaar/ecdsa-rdfc-2019-cryptosuite
原文对照：https://npmcn.com/package/%40digitalbazaar/ecdsa-rdfc-2019-cryptosuite/?lang=original
项目主页：https://github.com/digitalbazaar/ecdsa-rdfc-2019-cryptosuite
源码仓库：https://github.com/digitalbazaar/ecdsa-rdfc-2019-cryptosuite

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：13.8 kB，10 个文件
- 模块格式：ES Module
- TypeScript 类型：未声明
- Node.js 要求：\>=18
- 运行依赖：3 个
- 首次发布：2023-11-13T23:00:12.110Z
- 最新版本发布：2026-02-05T19:13:06.749Z
- 近 30 天下载量：7188（2026-10-12 至 2026-11-10，npm 官方下载统计）
- 已发布版本数：6（近 12 个月 1 个）

## 中文简介

ECDSA-RDFC-2019 数据 用Jsonld签名使用的完整密码套件.

## 安装

```sh
npm install @digitalbazaar/ecdsa-rdfc-2019-cryptosuite
```

也可以使用：`pnpm add @digitalbazaar/ecdsa-rdfc-2019-cryptosuite`、`yarn add @digitalbazaar/ecdsa-rdfc-2019-cryptosuite`、`bun add @digitalbazaar/ecdsa-rdfc-2019-cryptosuite`

## README

# ECDSA RDFC 2019 数据完整性 Cryptosuite _(@digitalbazaar/ecdsa-rdfc-2019-cryptosuite) (中文(简体) )_

[![Build status](https://img.shields.io/github/actions/workflow/status/digitalbazaar/ecdsa-rdfc-2019-cryptosuite/main.yml)](https://github.com/digitalbazaar/ecdsa-rdfc-2019-cryptosuite/actions?query=workflow%3A%22Node.js+CI%22) [![Coverage status](https://img.shields.io/codecov/c/github/digitalbazaar/ecdsa-rdfc-2019-cryptosuite)](https://codecov.io/gh/digitalbazaar/ecdsa-rdfc-2019-cryptosuite) [![NPM Version](https://img.shields.io/npm/v/@digitalbazaar/ecdsa-rdfc-2019-cryptosuite.svg)](https://npm.im/@digitalbazaar/ecdsa-rdfc-2019-cryptosuite)

> ECDSA RDFC 2019 数据完整性 Cryptosuite 用于Jsonld签名.

## 目录

-   [背景情况](https://npmcn.com/package/%40digitalbazaar/ecdsa-rdfc-2019-cryptosuite/#readme-background)
-   [警卫](https://npmcn.com/package/%40digitalbazaar/ecdsa-rdfc-2019-cryptosuite/#readme-security)
-   [安装](https://npmcn.com/package/%40digitalbazaar/ecdsa-rdfc-2019-cryptosuite/#readme-install)
-   [使用量](https://npmcn.com/package/%40digitalbazaar/ecdsa-rdfc-2019-cryptosuite/#readme-usage)
-   [贡献](https://npmcn.com/package/%40digitalbazaar/ecdsa-rdfc-2019-cryptosuite/#readme-contribute)
-   [商业支助](https://npmcn.com/package/%40digitalbazaar/ecdsa-rdfc-2019-cryptosuite/#readme-commercial-support)
-   [许可证](https://npmcn.com/package/%40digitalbazaar/ecdsa-rdfc-2019-cryptosuite/#readme-license)

## 背景情况

用于与 [https://github.com/digitalbazaar/jsonld-signers (中文(简体) )](https://github.com/digitalbazaar/jsonld-signatures) v11.0及以上编.

另见相关的规格:

-   [可验证的可信数据完整性](https://w3c.github.io/vc-data-integrity/)

## 警卫

传统发展

## 安装

-   浏览器和Node.js 18+得到支持.

从国家预防机制安装:

```
npm install @digitalbazaar/ecdsa-rdfc-2019-cryptosuite
```

在当地安装(用于开发):

```
git clone https://github.com/digitalbazaar/ecdsa-rdfc-2019-cryptosuite.git
cd ecdsa-rdfc-2019-cryptosuite
npm install
```

## 使用量

以下代码片段提供了一个完整的数字签名示例 使用此库的可核查证书:

```javascript
import * as EcdsaMultikey from '@digitalbazaar/ecdsa-multikey';
import {DataIntegrityProof} from '@digitalbazaar/data-integrity';
import {cryptosuite as ecdsaRdfc2019Cryptosuite} from
  '@digitalbazaar/ecdsa-rdfc-2019-cryptosuite';
import jsigs from 'jsonld-signatures';
const {purposes: {AssertionProofPurpose}} = jsigs;


// create the unsigned credential
const unsignedCredential = {
  '@context': [
    'https://www.w3.org/2018/credentials/v1',
    {
      AlumniCredential: 'https://schema.org#AlumniCredential',
      alumniOf: 'https://schema.org#alumniOf'
    }
  ],
  id: 'http://example.edu/credentials/1872',
  type: [ 'VerifiableCredential', 'AlumniCredential' ],
  issuer: 'https://example.edu/issuers/565049',
  issuanceDate: '2010-01-01T19:23:24Z',
  credentialSubject: {
    id: 'https://example.edu/students/alice',
    alumniOf: 'Example University'
  }
};

// create the keypair to use when signing
const controller = 'https://example.edu/issuers/565049';
const keyPair = await EcdsaMultikey.from({
  '@context': 'https://w3id.org/security/multikey/v1',
  id: 'https://example.edu/issuers/565049#zDnaekGZTbQBerwcehBSXLqAg6s55hVEBms1zFy89VHXtJSa9',
  type: 'Multikey',
  controller: 'https://example.edu/issuers/565049',
  publicKeyMultibase: 'zDnaekGZTbQBerwcehBSXLqAg6s55hVEBms1zFy89VHXtJSa9',
  secretKeyMultibase: 'z42tqZ5smVag3DtDhjY9YfVwTMyVHW6SCHJi2ZMrD23DGYS3'
});

// export public key and add to document loader
const publicKey = await keyPair.export({publicKey: true, includeContext: true});
addDocumentToLoader({url: publicKey.id, document: publicKey});

// create key's controller document
const controllerDoc = {
  '@context': [
    'https://www.w3.org/ns/did/v1',
    'https://w3id.org/security/multikey/v1'
  ],
  id: controller,
  assertionMethod: [publicKey]
};
addDocumentToLoader({url: controllerDoc.id, document: controllerDoc});

// create suite
const suite = new DataIntegrityProof({
  signer: keyPair.signer(), cryptosuite: ecdsaRdfc2019Cryptosuite
});

// create signed credential
const signedCredential = await jsigs.sign(unsignedCredential, {
  suite,
  purpose: new AssertionProofPurpose(),
  documentLoader
});

// results in the following signed VC
{
  "@context": [
    "https://www.w3.org/2018/credentials/v1",
    {
      "AlumniCredential": "https://schema.org#AlumniCredential",
      "alumniOf": "https://schema.org#alumniOf"
    },
    "https://w3id.org/security/data-integrity/v2"
  ],
  "id": "http://example.edu/credentials/1872",
  "type": [
    "VerifiableCredential",
    "AlumniCredential"
  ],
  "issuer": "https://example.edu/issuers/565049",
  "issuanceDate": "2010-01-01T19:23:24Z",
  "credentialSubject": {
    "id": "https://example.edu/students/alice",
    "alumniOf": "Example University"
  },
  "proof": {
    "type": "DataIntegrityProof",
    "created": "2023-03-01T21:29:24Z",
    "verificationMethod": "https://example.edu/issuers/565049#zDnaekGZTbQBerwcehBSXLqAg6s55hVEBms1zFy89VHXtJSa9",
    "cryptosuite": "ecdsa-rdfc-2019",
    "proofPurpose": "assertionMethod",
    "proofValue": "z5grbn9Tp8xC7p6LpmUdxxRdAx37azC2GQDdHBqq7ivFsaFUJtC81b8puwe2NmaEUYpxXQooXNnXL3M2NqySrzC5Z"
  }
}
```

## 贡献

见 [贡献文件](https://github.com/digitalbazaar/bedrock/blob/master/CONTRIBUTING.md)来啊!

公关接受.

请遵照 [标准读取](https://github.com/RichardLitt/standard-readme) 规格.

## 商业支助

该图书馆的商务支助可应下列请求提供: 数字集市: [支持@ digitalbazaar.com](mailto:support@digitalbazaar.com)

## 许可证

[新建 BSD 许可证( 3- clause)](https://npmcn.com/package/%40digitalbazaar/ecdsa-rdfc-2019-cryptosuite/LICENSE) 2023年数字集市

## 常见问题

### @digitalbazaar/ecdsa-rdfc-2019-cryptosuite 是什么？

ECDSA-RDFC-2019 数据 用Jsonld签名使用的完整密码套件\.

### 如何安装 @digitalbazaar/ecdsa-rdfc-2019-cryptosuite？

在项目目录运行 npm install @digitalbazaar/ecdsa-rdfc-2019-cryptosuite，或使用 pnpm add / yarn add / bun add。

### @digitalbazaar/ecdsa-rdfc-2019-cryptosuite 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/digitalbazaar\_\_ecdsa-rdfc-2019-cryptosuite 是否存在。

### @digitalbazaar/ecdsa-rdfc-2019-cryptosuite 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @digitalbazaar/ecdsa-rdfc-2019-cryptosuite 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=18。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @digitalbazaar/ecdsa-rdfc-2019-cryptosuite 可以商用吗？

@digitalbazaar/ecdsa-rdfc-2019-cryptosuite 使用 BSD-3-Clause 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。另外不得用原作者名义为衍生产品背书。以上为概括，不构成法律意见，请以许可原文为准。

### @digitalbazaar/ecdsa-rdfc-2019-cryptosuite 的下载量有多少？

根据 npm 官方下载统计，@digitalbazaar/ecdsa-rdfc-2019-cryptosuite 在 2026/10/12 – 2026/11/10 这 30 天内被下载 7,188 次，日均约 240 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @digitalbazaar/ecdsa-rdfc-2019-cryptosuite 还在维护吗？

最新版本 1\.3\.0 发布于 2026/02/06（9 个月前）；至今共发布 6 个版本，其中过去 12 个月发布了 1 个；首次发布于 2023/11/14。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

