#did #key #document #reusable #applications #didcomm #didcomm-messaging

did-utils

A Rust library for implementing reusable utility code for DID-based applications

1 unstable release

new 0.1.0 Nov 25, 2024

#608 in Cryptography

Download history 73/week @ 2024-11-19

76 downloads per month

Apache-2.0

320KB
6K SLoC

did-utils

A Rust library for implementing reusable utility code for DID-based applications.

Features

  • Manipulate JSON DID documents.
  • Create keys.
  • Sign, verify, encrypt, and decrypt DID documents.

Installation

cargo install did-utils

Usage

use did_utils::*;

// Create a DID document.
let did_document = DidDocument::new(
    "did:example:1234567890",
    "My DID",
    "My public key",
);

// Sign the DID document.
let signature = did_document.sign(&my_private_key);

// Verify the signature of the DID document.
let is_valid = did_document.verify_signature(&signature);

// Encrypt the DID document.
let encrypted_did_document = did_document.encrypt(&my_public_key);

// Decrypt the encrypted DID document.
let decrypted_did_document = encrypted_did_document.decrypt(&my_private_key);

Dependencies

  • serde
  • sha2
  • x25519-dalek

Documentation

The documentation for the library is available here: https://docs.rs/did-utils/

License

The library is licensed under the MIT License.

Dependencies

~16–29MB
~459K SLoC