func keyAgreementSort(result *did.Document) less {
    return func(i, j int) bool {
        is := result.KeyAgreement[i].ID.String()
        js := result.KeyAgreement[j].ID.String()
        return strings.Compare(is, js) == -1