Skip to content

Commit

Permalink
Document the resolve method.
Browse files Browse the repository at this point in the history
Documented that  the resolve method to adheres to the DID:x509 v1.0 Draft specification. Notable changes include the implementation of the "otherName" SAN policy and support for "serialNumber" in the "subject" policy. The "eku" policy remains unimplemented.
  • Loading branch information
rolandgroen committed Nov 4, 2024
1 parent 104af82 commit 6b1208f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vdr/didx509/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ type X509DidReference struct {
}

// Resolve resolves a DID document given its identifier and corresponding metadata.
// The resolve method resolves using the did:x509 v1.0 Draft method specification found at:
// https://trustoverip.github.io/tswg-did-x509-method-specification/
// Given this specification, this implementation diverges from the spec at the following:
// * Besides the "san" policies "email" / "dns" / "uri", the san policy "otherName" is also implemented.
// * The policy "subject" also supports "serialNumber", besides the "CN" / "L" / "ST" / "O" / "OU" / "C" / "STREET" fields.
// * The policy "eku" is not implemented.
func (r Resolver) Resolve(id did.DID, metadata *resolver.ResolveMetadata) (*did.Document, *resolver.DocumentMetadata, error) {
if id.Method != MethodName {
return nil, nil, fmt.Errorf("unsupported DID method: %s", id.Method)
Expand Down

0 comments on commit 6b1208f

Please sign in to comment.