did_simple/
lib.rs

1//! A Decentralized Identifier (aka [DID][spec]), is a globally unique
2//! identifier that provides a general purpose way of looking up public keys
3//! associated with the identifier.
4//!
5//! This means that ownership of a UUID can be proven and that support for
6//! common cryptography operations such as signing, verifying, and encrypting
7//! messages is possible. This makes DIDs strictly more useful than traditional
8//! UUIDs as account identifiers and are very useful for building federated or
9//! decentralized services.
10//!
11//! Services that use DIDs give users self-custody over their account identity.
12//! Authentication of users can happen without the need for a centralized
13//! authentication service or user database. Instead, whoever holds the private
14//! keys associated with a DID will be able to authenticate as the account owner.
15//!
16//! This gives users the ability to maintain the same account handles/identities
17//! across multiple separate services (or migrate homeservers in a federated
18//! system) without having to create a different account or identity for each
19//! service.
20//!
21//! [spec]: https://www.w3.org/TR/did-core/
22
23#![cfg_attr(not(feature = "allow-unsafe"), forbid(unsafe_code))]
24
25use std::str::FromStr;
26
27pub mod crypto;
28pub(crate) mod key_algos;
29pub mod methods;
30pub mod url;
31pub mod utf8bytes;
32mod varint;
33
34pub use crate::key_algos::KeyAlgo;
35pub use crate::methods::DidDyn;
36pub use crate::url::DidUrl;
37
38pub trait Did: FromStr {
39	fn url(&self) -> self::url::DidUrl;
40}