Documentation
¶
Index ¶
- Constants
- func DIDToURL(id did.DID) (*url.URL, error)
- func ServerURLToDIDWeb(t *testing.T, stringUrl string) did.DID
- func URLToDID(u url.URL) (*did.DID, error)
- type Manager
- func (m Manager) Commit(_ context.Context, _ orm.DIDChangeLog) error
- func (m Manager) IsCommitted(_ context.Context, _ orm.DIDChangeLog) (bool, error)
- func (m Manager) NewDocument(ctx context.Context, keyFlags orm.DIDKeyFlags) (*orm.DidDocument, error)
- func (m Manager) NewVerificationMethod(ctx context.Context, controller did.DID, requestedKeyFlags orm.DIDKeyFlags) (*did.VerificationMethod, error)
- type Resolver
Constants ¶
const MethodName = "web"
MethodName is the DID method name used by did:web
Variables ¶
This section is empty.
Functions ¶
func DIDToURL ¶
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 URLToDID ¶
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 ¶
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 ¶
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.