fairpm/did-manager 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

fairpm/did-manager

最新稳定版本:0.0.4

Composer 安装命令:

composer require fairpm/did-manager

包简介

Core PHP library for DID management, key handling, and PLC operations

README 文档

README

fairpm/did-manager is the core FAIR DID library. It contains generic DID lifecycle management, PLC operations, key generation/export, and local key storage.

Features

  • Create, resolve, update, rotate, and deactivate did:plc identifiers
  • Generate secp256k1 rotation keys and Ed25519 verification keys
  • Encode/sign PLC operations with CBOR and multibase helpers
  • Store DIDs, keys, and generic metadata locally
  • Export keys in JSON, text, and environment-variable formats

Requirements

  • PHP 8.3 or higher
  • Composer
  • Extensions: curl, json

Installation

git clone https://github.com/fairpm/did-manager.git
cd did-manager
composer install

For WordPress package metadata parsing, install fairpm/did-manager-wordpress alongside this package.

Quick Start

<?php

require_once 'vendor/autoload.php';

use FAIR\DID\DIDManager;
use FAIR\DID\PLC\PlcClient;
use FAIR\DID\Storage\KeyStore;

$store = new KeyStore(__DIR__ . '/keys.json');
$client = new PlcClient();
$manager = new DIDManager($store, $client);

$result = $manager->create_did(
	handle: 'example-package',
	service_endpoint: 'https://example.com/did-endpoint',
	type: 'package',
	metadata: ['owner' => 'Example Org'],
);

echo $result['did'] . PHP_EOL;

Namespaces

  • FAIR\DID\Crypto for encoding, canonicalization, and DID helpers
  • FAIR\DID\Keys for key generation, decoding, and export
  • FAIR\DID\PLC for PLC client and operation objects
  • FAIR\DID\Storage for local key/DID persistence
  • FAIR\DID for high-level DID lifecycle orchestration

Examples

Core examples remain in examples:

  • 01-generate-keys.php
  • 02-plc-operations.php
  • 03-key-storage.php
  • 04-export-keys.php
  • 05-generate-and-submit-did.php

WordPress examples were moved to the did-manager-wordpress package.

Testing

composer test
composer lint
composer analyze

Related Packages

  • fairpm/did-manager-wordpress for WordPress header parsing, readme parsing, and FAIR metadata generation

Security

Never commit private keys or generated keystore files to version control.

License

GPL-3.0-or-later. See LICENSE.md for details.

统计信息

  • 总下载量: 156
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2026-01-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固