···2121 // These fields represent a parsed subset of a DID document. They are all nullable. Note that the services and keys maps do not preserve order, so they don't exactly round-trip DID documents.
2222 AlsoKnownAs []string
2323 Services map[string]ServiceEndpoint
2424- Keys map[string]IdentityKey
2424+ Keys map[string]VerificationMethod
2525}
26262727-type IdentityKey struct {
2727+// Sub-field type for [Identity], representing a crytographic public key declared as a "verificationMethod" in the DID document.
2828+type VerificationMethod struct {
2829 Type string
2930 PublicKeyMultibase string
3031}
31323333+// Sub-field type for [Identity], representing a service endpoint URL declared in the DID document.
3234type ServiceEndpoint struct {
3335 Type string
3436 URL string
···3840//
3941// Always returns an invalid Handle field; calling code should only populate that field if it has been bi-directionally verified.
4042func ParseIdentity(doc *DIDDocument) Identity {
4141- keys := make(map[string]IdentityKey, len(doc.VerificationMethod))
4343+ keys := make(map[string]VerificationMethod, len(doc.VerificationMethod))
4244 for _, vm := range doc.VerificationMethod {
4345 parts := strings.SplitN(vm.ID, "#", 2)
4446 if len(parts) < 2 {
···5355 continue
5456 }
5557 // TODO: verify that ID and type match for atproto-specific services?
5656- keys[parts[1]] = IdentityKey{
5858+ keys[parts[1]] = VerificationMethod{
5759 Type: vm.Type,
5860 PublicKeyMultibase: vm.PublicKeyMultibase,
5961 }