did_key_dart 0.1.1 did_key_dart: ^0.1.1 copied to clipboard
A Dart package for generating and resolving Decentralized Identifiers (DIDs) using various cryptographic algorithms, including P-256 and Ed25519. This package provides functionality to create DIDs, re [...]
example/did_key_dart_example.dart
import 'dart:convert';
import 'package:did_key_dart/did_key_dart.dart';
import 'package:jose/jose.dart';
void main() {
const awesome = DIDKeyDriver();
final jwk = JsonWebKey.generate('ES256');
final did = awesome.generateDIDFromJWK(
keyAlgorithm: P256(),
jwk: jsonEncode(jwk.toJson()),
);
// This is a sample DID generated by the DIDGenerator
// ignore: avoid_print
print('Sample DID: $did');
}