didweb

package
v6.2.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2026 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const MethodName = "web"

MethodName is the DID method name used by did:web

Variables

This section is empty.

Functions

func DIDToURL

func DIDToURL(id did.DID) (*url.URL, error)

DIDToURL converts a Web DID (did:web) to a URL. Examples: - did:web:localhost -> https://localhost - did:web:localhost:alice%2Band%2Bbob:path -> https://localhost/alice+and+bob/path - did:web:localhost%3A3000:alice -> https://localhost:3000/alice

func ServerURLToDIDWeb

func ServerURLToDIDWeb(t *testing.T, stringUrl string) did.DID

func URLToDID

func URLToDID(u url.URL) (*did.DID, error)

URLToDID converts a URL back to a Web DID (did:web). It removes /did.json and /.well-known/did.json from the path, if present. Examples: - https://localhost/.well-known/did.json -> did:web:localhost - https://localhost/alice+and+bob/path/did.json -> did:web:localhost:alice%2Band%2Bbob:path - https://localhost:3000/alice -> did:web:localhost%3A3000:alice - https://nodeA/iam/5/ -> did:web:nodeA:iam:5

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager creates and updates did:web documents

func NewManager

func NewManager(rootDID did.DID, tenantPath string, keyStore nutsCrypto.KeyStore, db *gorm.DB) *Manager

NewManager creates a new Manager to create and update did:web DID documents.

func (Manager) Commit

func (m Manager) Commit(_ context.Context, _ orm.DIDChangeLog) error

Commit does nothing for did:web. This is important since only the one of the method managers may have a failing commit. This is a poor-mans 2-phase commit.

func (Manager) IsCommitted

func (m Manager) IsCommitted(_ context.Context, _ orm.DIDChangeLog) (bool, error)

IsCommitted always returns true for did:web. did:web gets its state from the primary DB.

func (Manager) NewDocument

func (m Manager) NewDocument(ctx context.Context, keyFlags orm.DIDKeyFlags) (*orm.DidDocument, error)

func (Manager) NewVerificationMethod

func (m Manager) NewVerificationMethod(ctx context.Context, controller did.DID, requestedKeyFlags orm.DIDKeyFlags) (*did.VerificationMethod, error)

type Resolver

type Resolver struct {
	HttpClient core.HTTPRequestDoer
}

Resolver is a DID resolver for the did:web method.

func NewResolver

func NewResolver() *Resolver

NewResolver creates a new did:web Resolver with default TLS configuration.

func (Resolver) Resolve

Resolve implements the DIDResolver interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL