Skip to main content

Module key

Module key 

Source
Available on crate feature did-key and (crate features did-jwk or did-key or did-web) only.
Expand description

did:key: a DID that is a public key.

The did:key method (v0.9) expands did:key:<multibase> deterministically into a DID document: the method-specific id is the Multikey form of the public key (base58btc multibase of the multicodec header and the raw key, see Jwk::from_multikey), the document has one verification method whose fragment is that same Multikey string, referenced from authentication, assertionMethod, capabilityInvocation and capabilityDelegation, and optionally an X25519 key agreement method derived from an Ed25519 key. The method cannot update or deactivate.

Supported key types are those of KeyCodec: Ed25519, X25519, P-256, secp256k1 (feature secp256k1) and RSA. The version segment of did:key:1:<multibase> is accepted and must be a positive integer.

Structs§

DidKey
The did:key method: a DidResolver that expands the DID and a DidProducer that encodes one public key.

Enums§

DidKeyError
Why a key has no did:key.
KeyFormat
How a verification method of a did:key document carries the key (the publicKeyFormat option of the method).