Crates.io | did-utils |
lib.rs | did-utils |
version | 0.1.0 |
source | src |
created_at | 2024-11-25 09:13:49.441389 |
updated_at | 2024-11-25 09:13:49.441389 |
description | A Rust library for implementing reusable utility code for DID-based applications |
homepage | |
repository | https://github.com/adorsys/didcomm-mediator-rs/tree/main/crates/web-plugins/didcomm-messaging/did-utils |
max_upload_size | |
id | 1460105 |
size | 388,762 |
A Rust library for implementing reusable utility code for DID-based applications.
cargo install did-utils
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);
The documentation for the library is available here: https://docs.rs/did-utils/
The library is licensed under the MIT License.