Versions in this module Expand all Collapse all v1 v1.0.0 Dec 23, 2023 Changes in this version + const Base58BTCMultiBase + const BuilderEmptyError + const DIDDocumentLDContext + const DIDDocumentType + const Ed25519MultiCodec + const KnownDIDContext + const P256MultiCodec + const P384MultiCodec + const P521MultiCodec + const RSAMultiCodec + const SECP256k1MultiCodec + const SHA256MultiCodec + const X25519MultiCodec + func DecodeMultibaseEncodedKey(d string) ([]byte, cryptosuite.LDKeyType, crypto.KeyType, error) + func DecodeMultibasePublicKeyWithType(data []byte) ([]byte, cryptosuite.LDKeyType, error) + func FullyQualifiedVerificationMethodID(did, verificationMethodID string) string + func GetKeyFromVerificationMethod(did Document, kid string) (gocrypto.PublicKey, error) + func KeyTypeToMultiCodec(kt crypto.KeyType) (multicodec.Code, error) + func KeyTypeToMultikeyLDType(kt crypto.KeyType) (cryptosuite.LDKeyType, error) + func MultiBaseToPubKeyBytes(mb string) ([]byte, error) + func MultiCodecToKeyType(codec multicodec.Code) (crypto.KeyType, error) + func MultiCodecToLDKeyType(codec multicodec.Code) (cryptosuite.LDKeyType, error) + type DID interface + IsValid func() bool + Method func() Method + String func() string + Suffix func() (string, error) + type Document struct + AlsoKnownAs string + AssertionMethod []VerificationMethodSet + Authentication []VerificationMethodSet + CapabilityDelegation []VerificationMethodSet + CapabilityInvocation []VerificationMethodSet + Context any + Controller string + ID string + KeyAgreement []VerificationMethodSet + Services []Service + VerificationMethod []VerificationMethod + func (d *Document) IsEmpty() bool + func (d *Document) IsValid() error + type DocumentBuilder struct + func NewDIDDocumentBuilder() DocumentBuilder + func (builder *DocumentBuilder) AddAssertionMethod(m VerificationMethodSet) error + func (builder *DocumentBuilder) AddAuthenticationMethod(m VerificationMethodSet) error + func (builder *DocumentBuilder) AddCapabilityDelegation(m VerificationMethodSet) error + func (builder *DocumentBuilder) AddCapabilityInvocation(m VerificationMethodSet) error + func (builder *DocumentBuilder) AddContext(context any) error + func (builder *DocumentBuilder) AddKeyAgreement(m VerificationMethodSet) error + func (builder *DocumentBuilder) AddService(s Service) error + func (builder *DocumentBuilder) AddVerificationMethod(m VerificationMethod) error + func (builder *DocumentBuilder) Build() (*Document, error) + func (builder *DocumentBuilder) IsEmpty() bool + func (builder *DocumentBuilder) SetAlsoKnownAs(name string) error + func (builder *DocumentBuilder) SetController(controller string) error + func (builder *DocumentBuilder) SetID(id string) error + type Method string + const IONMethod + const JWKMethod + const KeyMethod + const PKHMethod + const PeerMethod + const WebMethod + func (m Method) String() string + type PublicKeyPurpose string + const AssertionMethod + const Authentication + const CapabilityDelegation + const CapabilityInvocation + const KeyAgreement + type Service struct + Accept []string + ID string + RoutingKeys []string + ServiceEndpoint any + Type string + func (s *Service) IsValid() bool + type VerificationMethod struct + BlockchainAccountID string + Controller string + ID string + PublicKeyBase58 string + PublicKeyJWK *jwx.PublicKeyJWK + PublicKeyMultibase string + Type cryptosuite.LDKeyType + func ConstructJWKVerificationMethod(id, controller string, pubKeyBytes []byte, cryptoKeyType crypto.KeyType) (*VerificationMethod, error) + func ConstructMultibaseVerificationMethod(id, controller string, pubKey []byte, keyType cryptosuite.LDKeyType) (*VerificationMethod, error) + type VerificationMethodSet any