Versions in this module Expand all Collapse all v1 v1.0.1 Dec 24, 2023 Changes in this version + const Prefix + func Canonicalize(data []byte) ([]byte, error) + func CanonicalizeAny(data any) ([]byte, error) + func Commit(key sdkcrypto.PublicKeyJWK) (reveal, commitment string, err error) + func CreateLongFormDID(recoveryKey, updateKey jwx.PublicKeyJWK, document Document) (string, error) + func CreateShortFormDID(suffixData any) (string, error) + func Decode(data string) ([]byte, error) + func Encode(data []byte) string + func EncodeAny(data any) (string, error) + func EncodeString(data string) string + func Hash(data []byte) []byte + func HashEncode(data []byte) (string, error) + func IsLongFormDID(maybeLongFormDID string) bool + func LongToShortFormDID(longFormDID string) (string, error) + func Multihash(data []byte) ([]byte, error) + func NewIONDID(doc Document) (*DID, *CreateRequest, error) + func PatchesToDIDDocument(shortFormDID, longFormDID string, patches []Patch) (*did.Document, error) + type AddPublicKeysAction struct + Action PatchAction + PublicKeys []PublicKey + func (a AddPublicKeysAction) GetAction() PatchAction + type AddServicesAction struct + Action PatchAction + Services []did.Service + func (a AddServicesAction) GetAction() PatchAction + type AnchorOperation interface + GetType func() OperationType + type BTCSignerVerifier struct + func NewBTCSignerVerifier(privateKey sdkcrypto.PrivateKeyJWK) (*BTCSignerVerifier, error) + func (*BTCSignerVerifier) GetJWSHeader() map[string]any + func (sv *BTCSignerVerifier) Sign(dataHash []byte) ([]byte, error) + func (sv *BTCSignerVerifier) SignJWT(data any) (string, error) + func (sv *BTCSignerVerifier) Verify(data, signature []byte) (bool, error) + func (sv *BTCSignerVerifier) VerifyJWS(jws string) (bool, error) + type CreateRequest struct + Delta Delta + SuffixData SuffixData + Type OperationType + func NewCreateRequest(recoveryKey, updateKey jwx.PublicKeyJWK, document Document) (*CreateRequest, error) + func (CreateRequest) GetType() OperationType + type DID struct + func (d DID) Deactivate() (*DID, *DeactivateRequest, error) + func (d DID) GetRecoveryPrivateKey() jwx.PrivateKeyJWK + func (d DID) GetUpdatePrivateKey() jwx.PrivateKeyJWK + func (d DID) ID() string + func (d DID) IsEmpty() bool + func (d DID) LongForm() string + func (d DID) Operation(index int) any + func (d DID) Operations() []any + func (d DID) Recover(doc Document) (*DID, *RecoverRequest, error) + func (d DID) Update(stateChange StateChange) (*DID, *UpdateRequest, error) + type DeactivateRequest struct + DIDSuffix string + RevealValue string + SignedData string + Type OperationType + func NewDeactivateRequest(didSuffix string, recoveryKey jwx.PublicKeyJWK, signer BTCSignerVerifier) (*DeactivateRequest, error) + func (DeactivateRequest) GetType() OperationType + type DeactivateSignedDataObject struct + DIDSuffix string + RecoveryKey jwx.PublicKeyJWK + type Delta struct + Patches []Patch + UpdateCommitment string + func NewDelta(updateCommitment string) Delta + func (d *Delta) AddAddPublicKeysAction(patch AddPublicKeysAction) + func (d *Delta) AddAddServicesAction(patch AddServicesAction) + func (d *Delta) AddRemovePublicKeysAction(patch RemovePublicKeysAction) + func (d *Delta) AddRemoveServicesAction(patch RemoveServicesAction) + func (d *Delta) AddReplaceAction(patch ReplaceAction) + func (d *Delta) GetPatches() []Patch + func (d *Delta) UnmarshalJSON(data []byte) error + type Document struct + PublicKeys []PublicKey + Services []did.Service + func (d Document) IsEmpty() bool + type ErrorCode string + const DIDDocumentPublicKeyIDDuplicated + const DIDDocumentPublicKeyMissingOrIncorrectType + const DIDDocumentServiceIDDuplicated + const DIDSuffixIncorrectLength + const DeltaExceedsMaximumSize + const EncodedStringIncorrectEncoding + const IDNotUsingBase64URLCharacterSet + const IDTooLong + const JWKES256kHasIncorrectLengthOfD + const JWKES256kHasIncorrectLengthOfX + const JWKES256kHasIncorrectLengthOfY + const JWKES256kMissingOrInvalidCRV + const JWKES256kMissingOrInvalidKTY + const MultihashStringNotAMultihash + const MultihashUnsupportedHashAlgorithm + const PublicKeyJWKES256kHasUnexpectedProperty + const PublicKeyPurposeDuplicated + const ServiceEndpointCannotBeAnArray + const ServiceEndpointStringNotValidURI + const ServiceTypeTooLong + type ION string + func (ION) Method() did.Method + func (d ION) IsValid() bool + func (d ION) String() string + func (d ION) Suffix() (string, error) + type InitialState struct + Delta Delta + SuffixData SuffixData + func DecodeLongFormDID(longFormDID string) (string, *InitialState, error) + func (is InitialState) ToDIDStrings() (shortFormDID string, longFormDID string, err error) + type LocalResolver struct + func (LocalResolver) Methods() []did.Method + func (LocalResolver) Resolve(_ context.Context, id string, _ ...resolution.Option) (*resolution.Result, error) + type Network string + const Mainnet + const Testnet + type OperationKeyType string + const Private + const Public + type OperationType string + const Create + const Deactivate + const Recover + const Update + type Patch interface + GetAction func() PatchAction + type PatchAction string + const AddPublicKeys + const AddServices + const RemovePublicKeys + const RemoveServices + const Replace + func (p PatchAction) String() string + type PublicKey struct + ID string + PublicKeyJWK jwx.PublicKeyJWK + Purposes []did.PublicKeyPurpose + Type string + type RecoverRequest struct + DIDSuffix string + Delta Delta + RevealValue string + SignedData string + Type OperationType + func NewRecoverRequest(didSuffix string, recoveryKey, nextRecoveryKey, nextUpdateKey jwx.PublicKeyJWK, ...) (*RecoverRequest, error) + func (RecoverRequest) GetType() OperationType + type RecoverySignedDataObject struct + AnchorOrigin string + DeltaHash string + RecoveryCommitment string + RecoveryKey jwx.PublicKeyJWK + type RemovePublicKeysAction struct + Action PatchAction + IDs []string + func (a RemovePublicKeysAction) GetAction() PatchAction + type RemoveServicesAction struct + Action PatchAction + IDs []string + func (a RemoveServicesAction) GetAction() PatchAction + type ReplaceAction struct + Action PatchAction + Document Document + func (a ReplaceAction) GetAction() PatchAction + type Resolver struct + func NewIONResolver(client *http.Client, baseURL string) (*Resolver, error) + func (Resolver) Methods() []did.Method + func (i Resolver) Anchor(ctx context.Context, op AnchorOperation) (*resolution.Result, error) + func (i Resolver) Resolve(ctx context.Context, id string, _ ...resolution.Option) (*resolution.Result, error) + type StateChange struct + PublicKeyIDsToRemove []string + PublicKeysToAdd []PublicKey + ServiceIDsToRemove []string + ServicesToAdd []did.Service + func (s StateChange) IsEmpty() bool + func (s StateChange) IsValid() error + type SuffixData struct + DeltaHash string + RecoveryCommitment string + type UpdateRequest struct + DIDSuffix string + Delta Delta + RevealValue string + SignedData string + Type OperationType + func NewUpdateRequest(didSuffix string, updateKey, nextUpdateKey jwx.PublicKeyJWK, ...) (*UpdateRequest, error) + func (UpdateRequest) GetType() OperationType + type UpdateSignedDataObject struct + DeltaHash string + UpdateKey jwx.PublicKeyJWK