package
0.6.3
Repository: https://github.com/onsonr/sonr.git
Documentation: pkg.go.dev

# Functions

FromPrivKey is a convenience function that returns the DID associated with the public key associated with the provided private key.
FromPubKey returns a did:key constructed from the provided public key.
GenerateECDSA generates an ECDSA private key and the matching DID for the default P256 curve.
GenerateECDSAWithCurve generates an ECDSA private key and matching DID for the user-supplied curve.
GenerateEd25519 generates an Ed25519 private key and the matching DID.
GenerateRSA generates a RSA private key and the matching DID.
GenerateSecp256k1 generates a Secp256k1 private key and the matching DID.
MustParse is like Parse but panics instead of returning an error.
Parse returns the DID from the string representation or an error if the prefix and method are incorrect, if an unknown encryption algorithm is specified or if the method-specific-identifier's bytes don't represent a public key for the specified encryption algorithm.
ToPubKey returns the crypto.PubKey encapsulated in the DID formed by parsing the provided string.

# Constants

UCAN required/recommended.
UCAN required.
Signature algorithms from the [did:key specification] [did:key specification]: https://w3c-ccg.github.io/did-method-key/#signature-method-creation-algorithm.
Signature algorithms from the [did:key specification] [did:key specification]: https://w3c-ccg.github.io/did-method-key/#signature-method-creation-algorithm.
Signature algorithms from the [did:key specification] [did:key specification]: https://w3c-ccg.github.io/did-method-key/#signature-method-creation-algorithm.
UCAN required.
Signature algorithms from the [did:key specification] [did:key specification]: https://w3c-ccg.github.io/did-method-key/#signature-method-creation-algorithm.

# Variables

Undef can be used to represent a nil or undefined DID, using DID{} directly is also acceptable.

# Structs

DID is a Decentralized Identifier of the did:key type, directly holding a cryptographic public key.