buildWebDid

fun buildWebDid(domain: String, path: String? = null): String

Builds a did:web identifier from a domain.

Per the W3C did:web specification, a port separator in the host must be percent-encoded so it is not confused with the path delimiter: example.com:8080 → did:web:example.com%3A8080.

Return

DID string (e.g., "did:web:example.com:user:alice", "did:web:example.com%3A8080")

Parameters

domain

The domain name, optionally with port (e.g., "example.com", "example.com:8080")

path

Optional path (e.g., "user:alice")