did-utils

Crates.iodid-utils
lib.rsdid-utils
version0.1.0
sourcesrc
created_at2024-11-25 09:13:49.441389
updated_at2024-11-25 09:13:49.441389
descriptionA Rust library for implementing reusable utility code for DID-based applications
homepage
repositoryhttps://github.com/adorsys/didcomm-mediator-rs/tree/main/crates/web-plugins/didcomm-messaging/did-utils
max_upload_size
id1460105
size388,762
Enow Scott (Blindspot22)

documentation

README

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.

Commit count: 0

cargo fmt