rename the package to ucan-wg/go-dit-it

This commit is contained in:
Michael Muré
2025-07-10 15:56:45 +02:00
parent 0b255ea35b
commit b44cf50620
57 changed files with 159 additions and 177 deletions

View File

Before

Width:  |  Height:  |  Size: 202 KiB

After

Width:  |  Height:  |  Size: 202 KiB

View File

@@ -1,20 +1,20 @@
<div align="center"> <div align="center">
<h1 align="center">go-did</h1> <h1 align="center">go-did-it</h1>
<p> <p>
<a href="https://github.com/INFURA/go-did/tags"> <a href="https://github.com/ucan-wg/go-did-it/tags">
<img alt="GitHub Tag" src="https://img.shields.io/github/v/tag/INFURA/go-did"> <img alt="GitHub Tag" src="https://img.shields.io/github/v/tag/ucan-wg/go-did-it">
</a> </a>
<a href="https://github.com/INFURA/go-did/actions?query="> <a href="https://github.com/ucan-wg/go-did-it/actions?query=">
<img src="https://github.com/INFURA/go-did/actions/workflows/gotest.yml/badge.svg" alt="Build Status"> <img src="https://github.com/ucan-wg/go-did-it/actions/workflows/gotest.yml/badge.svg" alt="Build Status">
</a> </a>
<a href="https://INFURA.github.io/go-did/dev/bench/"> <a href="https://ucan-wg.github.io/go-did-it/dev/bench/">
<img alt="Go benchmarks" src="https://img.shields.io/badge/Benchmarks-go-blue"> <img alt="Go benchmarks" src="https://img.shields.io/badge/Benchmarks-go-blue">
</a> </a>
<a href="https://github.com/INFURA/go-did/blob/v1/LICENSE.md"> <a href="https://github.com/ucan-wg/go-did-it/blob/v1/LICENSE.md">
<img alt="Apache 2.0 + MIT License" src="https://img.shields.io/badge/License-Apache--2.0+MIT-green"> <img alt="Apache 2.0 + MIT License" src="https://img.shields.io/badge/License-Apache--2.0+MIT-green">
</a> </a>
<a href="https://pkg.go.dev/github.com/INFURA/go-did"> <a href="https://pkg.go.dev/github.com/ucan-wg/go-did-it">
<img src="https://img.shields.io/badge/Docs-godoc-blue" alt="Docs"> <img src="https://img.shields.io/badge/Docs-godoc-blue" alt="Docs">
</a> </a>
</p> </p>
@@ -27,10 +27,8 @@ This is an implementation of Decentralized Identifiers (DIDs) in go. It differs
- **support producing and using DIDs**: unlike some others, this all-in-one implementation is meant to create, manipulate and handle DIDs - **support producing and using DIDs**: unlike some others, this all-in-one implementation is meant to create, manipulate and handle DIDs
- **extensible**: you can easily register your custom DID method - **extensible**: you can easily register your custom DID method
DID spec concepts: Built with ❤️ by [Consensys](https://consensys.io/).
![DID spec concepts](resources/did_brief_architecture_overview.svg) ## Concepts
`go-did` concepts: ![`go-did-it` concepts](.github/concepts.png)
![`go-did` concepts](resources/go-did%20concepts.png)

View File

@@ -3,15 +3,15 @@ package allkeys
import ( import (
"fmt" "fmt"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
"github.com/INFURA/go-did/crypto/ed25519" "github.com/ucan-wg/go-did-it/crypto/ed25519"
helpers "github.com/INFURA/go-did/crypto/internal" helpers "github.com/ucan-wg/go-did-it/crypto/internal"
"github.com/INFURA/go-did/crypto/p256" "github.com/ucan-wg/go-did-it/crypto/p256"
"github.com/INFURA/go-did/crypto/p384" "github.com/ucan-wg/go-did-it/crypto/p384"
"github.com/INFURA/go-did/crypto/p521" "github.com/ucan-wg/go-did-it/crypto/p521"
"github.com/INFURA/go-did/crypto/rsa" "github.com/ucan-wg/go-did-it/crypto/rsa"
"github.com/INFURA/go-did/crypto/secp256k1" "github.com/ucan-wg/go-did-it/crypto/secp256k1"
"github.com/INFURA/go-did/crypto/x25519" "github.com/ucan-wg/go-did-it/crypto/x25519"
) )
var decoders = map[uint64]func(b []byte) (crypto.PublicKey, error){ var decoders = map[uint64]func(b []byte) (crypto.PublicKey, error){

View File

@@ -10,7 +10,7 @@ import (
"github.com/multiformats/go-varint" "github.com/multiformats/go-varint"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
) )
type TestHarness[PubT crypto.PublicKey, PrivT crypto.PrivateKey] struct { type TestHarness[PubT crypto.PublicKey, PrivT crypto.PrivateKey] struct {

View File

@@ -3,8 +3,8 @@ package ed25519
import ( import (
"testing" "testing"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
"github.com/INFURA/go-did/crypto/_testsuite" "github.com/ucan-wg/go-did-it/crypto/_testsuite"
) )
var harness = testsuite.TestHarness[PublicKey, PrivateKey]{ var harness = testsuite.TestHarness[PublicKey, PrivateKey]{

View File

@@ -8,7 +8,7 @@ import (
"golang.org/x/crypto/cryptobyte" "golang.org/x/crypto/cryptobyte"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
) )
var _ crypto.PrivateKeySigningBytes = &PrivateKey{} var _ crypto.PrivateKeySigningBytes = &PrivateKey{}

View File

@@ -9,8 +9,8 @@ import (
"golang.org/x/crypto/cryptobyte" "golang.org/x/crypto/cryptobyte"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
"github.com/INFURA/go-did/crypto/internal" "github.com/ucan-wg/go-did-it/crypto/internal"
) )
var _ crypto.PublicKeySigningBytes = PublicKey{} var _ crypto.PublicKeySigningBytes = PublicKey{}

View File

@@ -5,14 +5,14 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
"github.com/INFURA/go-did/crypto/ed25519" "github.com/ucan-wg/go-did-it/crypto/ed25519"
"github.com/INFURA/go-did/crypto/p256" "github.com/ucan-wg/go-did-it/crypto/p256"
"github.com/INFURA/go-did/crypto/p384" "github.com/ucan-wg/go-did-it/crypto/p384"
"github.com/INFURA/go-did/crypto/p521" "github.com/ucan-wg/go-did-it/crypto/p521"
"github.com/INFURA/go-did/crypto/rsa" "github.com/ucan-wg/go-did-it/crypto/rsa"
"github.com/INFURA/go-did/crypto/secp256k1" "github.com/ucan-wg/go-did-it/crypto/secp256k1"
"github.com/INFURA/go-did/crypto/x25519" "github.com/ucan-wg/go-did-it/crypto/x25519"
) )
type PrivateJwk struct { type PrivateJwk struct {

View File

@@ -5,14 +5,14 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
"github.com/INFURA/go-did/crypto/ed25519" "github.com/ucan-wg/go-did-it/crypto/ed25519"
"github.com/INFURA/go-did/crypto/p256" "github.com/ucan-wg/go-did-it/crypto/p256"
"github.com/INFURA/go-did/crypto/p384" "github.com/ucan-wg/go-did-it/crypto/p384"
"github.com/INFURA/go-did/crypto/p521" "github.com/ucan-wg/go-did-it/crypto/p521"
"github.com/INFURA/go-did/crypto/rsa" "github.com/ucan-wg/go-did-it/crypto/rsa"
"github.com/INFURA/go-did/crypto/secp256k1" "github.com/ucan-wg/go-did-it/crypto/secp256k1"
"github.com/INFURA/go-did/crypto/x25519" "github.com/ucan-wg/go-did-it/crypto/x25519"
) )
// Specification: // Specification:

View File

@@ -6,8 +6,8 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
"github.com/INFURA/go-did/crypto/_testsuite" "github.com/ucan-wg/go-did-it/crypto/_testsuite"
) )
var harness = testsuite.TestHarness[*PublicKey, *PrivateKey]{ var harness = testsuite.TestHarness[*PublicKey, *PrivateKey]{

View File

@@ -9,7 +9,7 @@ import (
"fmt" "fmt"
"math/big" "math/big"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
) )
var _ crypto.PrivateKeySigningBytes = &PrivateKey{} var _ crypto.PrivateKeySigningBytes = &PrivateKey{}

View File

@@ -8,8 +8,8 @@ import (
"fmt" "fmt"
"math/big" "math/big"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
helpers "github.com/INFURA/go-did/crypto/internal" helpers "github.com/ucan-wg/go-did-it/crypto/internal"
) )
var _ crypto.PublicKeySigningBytes = &PublicKey{} var _ crypto.PublicKeySigningBytes = &PublicKey{}

View File

@@ -3,8 +3,8 @@ package p384
import ( import (
"testing" "testing"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
"github.com/INFURA/go-did/crypto/_testsuite" "github.com/ucan-wg/go-did-it/crypto/_testsuite"
) )
var harness = testsuite.TestHarness[*PublicKey, *PrivateKey]{ var harness = testsuite.TestHarness[*PublicKey, *PrivateKey]{

View File

@@ -9,7 +9,7 @@ import (
"fmt" "fmt"
"math/big" "math/big"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
) )
var _ crypto.PrivateKeySigningBytes = &PrivateKey{} var _ crypto.PrivateKeySigningBytes = &PrivateKey{}

View File

@@ -8,8 +8,8 @@ import (
"fmt" "fmt"
"math/big" "math/big"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
helpers "github.com/INFURA/go-did/crypto/internal" helpers "github.com/ucan-wg/go-did-it/crypto/internal"
) )
var _ crypto.PublicKeySigningBytes = &PublicKey{} var _ crypto.PublicKeySigningBytes = &PublicKey{}

View File

@@ -3,8 +3,8 @@ package p521
import ( import (
"testing" "testing"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
"github.com/INFURA/go-did/crypto/_testsuite" "github.com/ucan-wg/go-did-it/crypto/_testsuite"
) )
var harness = testsuite.TestHarness[*PublicKey, *PrivateKey]{ var harness = testsuite.TestHarness[*PublicKey, *PrivateKey]{

View File

@@ -9,7 +9,7 @@ import (
"fmt" "fmt"
"math/big" "math/big"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
) )
var _ crypto.PrivateKeySigningBytes = &PrivateKey{} var _ crypto.PrivateKeySigningBytes = &PrivateKey{}

View File

@@ -8,8 +8,8 @@ import (
"fmt" "fmt"
"math/big" "math/big"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
helpers "github.com/INFURA/go-did/crypto/internal" helpers "github.com/ucan-wg/go-did-it/crypto/internal"
) )
var _ crypto.PublicKeySigningBytes = &PublicKey{} var _ crypto.PublicKeySigningBytes = &PublicKey{}

View File

@@ -5,7 +5,7 @@ import (
"crypto/rsa" "crypto/rsa"
"fmt" "fmt"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
) )
const ( const (

View File

@@ -6,8 +6,8 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
"github.com/INFURA/go-did/crypto/_testsuite" "github.com/ucan-wg/go-did-it/crypto/_testsuite"
) )
var harness2048 = testsuite.TestHarness[*PublicKey, *PrivateKey]{ var harness2048 = testsuite.TestHarness[*PublicKey, *PrivateKey]{

View File

@@ -9,7 +9,7 @@ import (
"fmt" "fmt"
"math/big" "math/big"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
) )
var _ crypto.PrivateKeySigningASN1 = &PrivateKey{} var _ crypto.PrivateKeySigningASN1 = &PrivateKey{}

View File

@@ -8,8 +8,8 @@ import (
"fmt" "fmt"
"math/big" "math/big"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
helpers "github.com/INFURA/go-did/crypto/internal" helpers "github.com/ucan-wg/go-did-it/crypto/internal"
) )
var _ crypto.PublicKeySigningASN1 = &PublicKey{} var _ crypto.PublicKeySigningASN1 = &PublicKey{}

View File

@@ -6,8 +6,8 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
"github.com/INFURA/go-did/crypto/_testsuite" "github.com/ucan-wg/go-did-it/crypto/_testsuite"
) )
var harness = testsuite.TestHarness[*PublicKey, *PrivateKey]{ var harness = testsuite.TestHarness[*PublicKey, *PrivateKey]{

View File

@@ -9,7 +9,7 @@ import (
"github.com/decred/dcrd/dcrec/secp256k1/v4" "github.com/decred/dcrd/dcrec/secp256k1/v4"
"github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa" "github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
) )
var _ crypto.PrivateKeySigningBytes = &PrivateKey{} var _ crypto.PrivateKeySigningBytes = &PrivateKey{}

View File

@@ -9,8 +9,8 @@ import (
"github.com/decred/dcrd/dcrec/secp256k1/v4" "github.com/decred/dcrd/dcrec/secp256k1/v4"
"github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa" "github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
helpers "github.com/INFURA/go-did/crypto/internal" helpers "github.com/ucan-wg/go-did-it/crypto/internal"
) )
var _ crypto.PublicKeySigningBytes = &PublicKey{} var _ crypto.PublicKeySigningBytes = &PublicKey{}

View File

@@ -5,8 +5,8 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/INFURA/go-did/crypto/_testsuite" "github.com/ucan-wg/go-did-it/crypto/_testsuite"
"github.com/INFURA/go-did/crypto/ed25519" "github.com/ucan-wg/go-did-it/crypto/ed25519"
) )
var harness = testsuite.TestHarness[*PublicKey, *PrivateKey]{ var harness = testsuite.TestHarness[*PublicKey, *PrivateKey]{

View File

@@ -7,8 +7,8 @@ import (
"encoding/pem" "encoding/pem"
"fmt" "fmt"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
"github.com/INFURA/go-did/crypto/ed25519" "github.com/ucan-wg/go-did-it/crypto/ed25519"
) )
var _ crypto.PrivateKeyKeyExchange = (*PrivateKey)(nil) var _ crypto.PrivateKeyKeyExchange = (*PrivateKey)(nil)

View File

@@ -7,9 +7,9 @@ import (
"fmt" "fmt"
"math/big" "math/big"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
"github.com/INFURA/go-did/crypto/ed25519" "github.com/ucan-wg/go-did-it/crypto/ed25519"
helpers "github.com/INFURA/go-did/crypto/internal" helpers "github.com/ucan-wg/go-did-it/crypto/internal"
) )
var _ crypto.PublicKey = (*PublicKey)(nil) var _ crypto.PublicKey = (*PublicKey)(nil)

View File

@@ -6,7 +6,7 @@ General:
- coding style should be clean, straightforward and documented, in a similar fashion as go-ucan. - coding style should be clean, straightforward and documented, in a similar fashion as go-ucan.
- keep the dependencies minimal, favor the standard go libraries - keep the dependencies minimal, favor the standard go libraries
- code should be decently tested and profiled - code should be decently tested and profiled
- specifications and test vectors used MUST be referenced in a comment - specifications and test vectors origins used MUST be referenced in a comment
- if something differs from a specification, it should be documented and explained - if something differs from a specification, it should be documented and explained
- consider how an average user will read and understand your code, rather than how you read it - consider how an average user will read and understand your code, rather than how you read it
@@ -17,16 +17,3 @@ DIDs:
Crypto: Crypto:
- a user of the library shouldn't have to know or care about the underlying crypto to use it "server side" (signature verification, key agreement). Thus, it should be abstracted behind the VerificationMethod interfaces. - a user of the library shouldn't have to know or care about the underlying crypto to use it "server side" (signature verification, key agreement). Thus, it should be abstracted behind the VerificationMethod interfaces.
- for each, we should expose some generally useful functions to handle private keys (generation, marshalling...) - for each, we should expose some generally useful functions to handle private keys (generation, marshalling...)
## Minimal target features
Methods:
- did:key
- did:pkh
Verification Methods:
- ed25519
- x25519
- secp256k1
- p256
- p384

View File

@@ -7,9 +7,9 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/INFURA/go-did" "github.com/ucan-wg/go-did-it"
"github.com/INFURA/go-did/crypto/x25519" "github.com/ucan-wg/go-did-it/crypto/x25519"
_ "github.com/INFURA/go-did/methods/did-key" _ "github.com/ucan-wg/go-did-it/methods/did-key"
) )
func Example_signature() { func Example_signature() {

View File

@@ -7,8 +7,8 @@ import (
"io" "io"
"net/url" "net/url"
"github.com/INFURA/go-did" "github.com/ucan-wg/go-did-it"
"github.com/INFURA/go-did/verifications" "github.com/ucan-wg/go-did-it/verifications"
) )
var _ did.Document = &Document{} var _ did.Document = &Document{}

View File

@@ -6,10 +6,10 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
_ "github.com/INFURA/go-did/methods/did-key" _ "github.com/ucan-wg/go-did-it/methods/did-key"
"github.com/INFURA/go-did/verifications/ed25519" "github.com/ucan-wg/go-did-it/verifications/ed25519"
"github.com/INFURA/go-did/verifications/jsonwebkey" "github.com/ucan-wg/go-did-it/verifications/jsonwebkey"
"github.com/INFURA/go-did/verifications/x25519" "github.com/ucan-wg/go-did-it/verifications/x25519"
) )
func TestRoundTrip(t *testing.T) { func TestRoundTrip(t *testing.T) {

2
go.mod
View File

@@ -1,4 +1,4 @@
module github.com/INFURA/go-did module github.com/ucan-wg/go-did-it
go 1.23.0 go 1.23.0

View File

@@ -4,7 +4,7 @@ import (
"encoding/json" "encoding/json"
"net/url" "net/url"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
) )
// DID is a decoded (i.e. from a string) Decentralized Identifier. // DID is a decoded (i.e. from a string) Decentralized Identifier.

View File

@@ -4,7 +4,7 @@ import (
"encoding/json" "encoding/json"
"net/url" "net/url"
"github.com/INFURA/go-did" "github.com/ucan-wg/go-did-it"
) )
var _ did.Document = &document{} var _ did.Document = &document{}

View File

@@ -6,8 +6,8 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/INFURA/go-did" "github.com/ucan-wg/go-did-it"
"github.com/INFURA/go-did/methods/did-key/testvectors" "github.com/ucan-wg/go-did-it/methods/did-key/testvectors"
) )
func TestDocument(t *testing.T) { func TestDocument(t *testing.T) {

View File

@@ -4,22 +4,22 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/INFURA/go-did" "github.com/ucan-wg/go-did-it"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
allkeys "github.com/INFURA/go-did/crypto/_allkeys" allkeys "github.com/ucan-wg/go-did-it/crypto/_allkeys"
"github.com/INFURA/go-did/crypto/ed25519" "github.com/ucan-wg/go-did-it/crypto/ed25519"
"github.com/INFURA/go-did/crypto/p256" "github.com/ucan-wg/go-did-it/crypto/p256"
"github.com/INFURA/go-did/crypto/p384" "github.com/ucan-wg/go-did-it/crypto/p384"
"github.com/INFURA/go-did/crypto/p521" "github.com/ucan-wg/go-did-it/crypto/p521"
"github.com/INFURA/go-did/crypto/rsa" "github.com/ucan-wg/go-did-it/crypto/rsa"
"github.com/INFURA/go-did/crypto/secp256k1" "github.com/ucan-wg/go-did-it/crypto/secp256k1"
"github.com/INFURA/go-did/crypto/x25519" "github.com/ucan-wg/go-did-it/crypto/x25519"
"github.com/INFURA/go-did/verifications/ed25519" "github.com/ucan-wg/go-did-it/verifications/ed25519"
"github.com/INFURA/go-did/verifications/jsonwebkey" "github.com/ucan-wg/go-did-it/verifications/jsonwebkey"
"github.com/INFURA/go-did/verifications/multikey" "github.com/ucan-wg/go-did-it/verifications/multikey"
p256vm "github.com/INFURA/go-did/verifications/p256" p256vm "github.com/ucan-wg/go-did-it/verifications/p256"
secp256k1vm "github.com/INFURA/go-did/verifications/secp256k1" secp256k1vm "github.com/ucan-wg/go-did-it/verifications/secp256k1"
"github.com/INFURA/go-did/verifications/x25519" "github.com/ucan-wg/go-did-it/verifications/x25519"
) )
// Specification: https://w3c-ccg.github.io/did-method-key/ // Specification: https://w3c-ccg.github.io/did-method-key/

View File

@@ -7,9 +7,9 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/INFURA/go-did" "github.com/ucan-wg/go-did-it"
"github.com/INFURA/go-did/crypto/ed25519" "github.com/ucan-wg/go-did-it/crypto/ed25519"
didkey "github.com/INFURA/go-did/methods/did-key" didkey "github.com/ucan-wg/go-did-it/methods/did-key"
) )
func ExampleGenerateKeyPair() { func ExampleGenerateKeyPair() {

View File

@@ -8,15 +8,15 @@ import (
"github.com/mr-tron/base58" "github.com/mr-tron/base58"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
"github.com/INFURA/go-did/crypto/ed25519" "github.com/ucan-wg/go-did-it/crypto/ed25519"
"github.com/INFURA/go-did/crypto/jwk" "github.com/ucan-wg/go-did-it/crypto/jwk"
"github.com/INFURA/go-did/crypto/p256" "github.com/ucan-wg/go-did-it/crypto/p256"
"github.com/INFURA/go-did/crypto/secp256k1" "github.com/ucan-wg/go-did-it/crypto/secp256k1"
ed25519vm "github.com/INFURA/go-did/verifications/ed25519" ed25519vm "github.com/ucan-wg/go-did-it/verifications/ed25519"
"github.com/INFURA/go-did/verifications/jsonwebkey" "github.com/ucan-wg/go-did-it/verifications/jsonwebkey"
p256vm "github.com/INFURA/go-did/verifications/p256" p256vm "github.com/ucan-wg/go-did-it/verifications/p256"
secp256k1vm "github.com/INFURA/go-did/verifications/secp256k1" secp256k1vm "github.com/ucan-wg/go-did-it/verifications/secp256k1"
) )
// Origin: https://github.com/w3c-ccg/did-key-spec/tree/main/test-vectors // Origin: https://github.com/w3c-ccg/did-key-spec/tree/main/test-vectors

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -3,7 +3,7 @@ package did
import ( import (
"fmt" "fmt"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
) )
// TryAllVerify tries to verify the signature with all the methods in the slice. // TryAllVerify tries to verify the signature with all the methods in the slice.

View File

@@ -7,8 +7,8 @@ import (
"github.com/mr-tron/base58" "github.com/mr-tron/base58"
"github.com/INFURA/go-did" "github.com/ucan-wg/go-did-it"
"github.com/INFURA/go-did/crypto/ed25519" "github.com/ucan-wg/go-did-it/crypto/ed25519"
) )
// Specification: https://w3c-ccg.github.io/lds-ed25519-2018/ // Specification: https://w3c-ccg.github.io/lds-ed25519-2018/

View File

@@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
ed25519vm "github.com/INFURA/go-did/verifications/ed25519" ed25519vm "github.com/ucan-wg/go-did-it/verifications/ed25519"
) )
func TestJsonRoundTrip2018(t *testing.T) { func TestJsonRoundTrip2018(t *testing.T) {

View File

@@ -5,8 +5,8 @@ import (
"errors" "errors"
"fmt" "fmt"
"github.com/INFURA/go-did" "github.com/ucan-wg/go-did-it"
"github.com/INFURA/go-did/crypto/ed25519" "github.com/ucan-wg/go-did-it/crypto/ed25519"
) )
// Specification: https://w3c.github.io/cg-reports/credentials/CG-FINAL-di-eddsa-2020-20220724/ // Specification: https://w3c.github.io/cg-reports/credentials/CG-FINAL-di-eddsa-2020-20220724/

View File

@@ -7,10 +7,10 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/INFURA/go-did" "github.com/ucan-wg/go-did-it"
"github.com/INFURA/go-did/crypto/ed25519" "github.com/ucan-wg/go-did-it/crypto/ed25519"
_ "github.com/INFURA/go-did/methods/did-key" _ "github.com/ucan-wg/go-did-it/methods/did-key"
"github.com/INFURA/go-did/verifications/ed25519" "github.com/ucan-wg/go-did-it/verifications/ed25519"
) )
func TestJsonRoundTrip2020(t *testing.T) { func TestJsonRoundTrip2020(t *testing.T) {

View File

@@ -4,13 +4,13 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/INFURA/go-did" "github.com/ucan-wg/go-did-it"
"github.com/INFURA/go-did/verifications/ed25519" "github.com/ucan-wg/go-did-it/verifications/ed25519"
"github.com/INFURA/go-did/verifications/jsonwebkey" "github.com/ucan-wg/go-did-it/verifications/jsonwebkey"
"github.com/INFURA/go-did/verifications/multikey" "github.com/ucan-wg/go-did-it/verifications/multikey"
p256vm "github.com/INFURA/go-did/verifications/p256" p256vm "github.com/ucan-wg/go-did-it/verifications/p256"
secp256k1vm "github.com/INFURA/go-did/verifications/secp256k1" secp256k1vm "github.com/ucan-wg/go-did-it/verifications/secp256k1"
"github.com/INFURA/go-did/verifications/x25519" "github.com/ucan-wg/go-did-it/verifications/x25519"
) )
func UnmarshalJSON(data []byte) (did.VerificationMethod, error) { func UnmarshalJSON(data []byte) (did.VerificationMethod, error) {

View File

@@ -4,9 +4,9 @@ import (
"encoding/json" "encoding/json"
"errors" "errors"
"github.com/INFURA/go-did" "github.com/ucan-wg/go-did-it"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
"github.com/INFURA/go-did/crypto/jwk" "github.com/ucan-wg/go-did-it/crypto/jwk"
) )
// Specification: // Specification:

View File

@@ -5,9 +5,9 @@ import (
"errors" "errors"
"fmt" "fmt"
"github.com/INFURA/go-did" "github.com/ucan-wg/go-did-it"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
allkeys "github.com/INFURA/go-did/crypto/_allkeys" allkeys "github.com/ucan-wg/go-did-it/crypto/_allkeys"
) )
// Specification: https://www.w3.org/TR/cid-1.0/#Multikey // Specification: https://www.w3.org/TR/cid-1.0/#Multikey

View File

@@ -6,8 +6,8 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
_ "github.com/INFURA/go-did/methods/did-key" _ "github.com/ucan-wg/go-did-it/methods/did-key"
"github.com/INFURA/go-did/verifications/multikey" "github.com/ucan-wg/go-did-it/verifications/multikey"
) )
func TestJsonRoundTrip(t *testing.T) { func TestJsonRoundTrip(t *testing.T) {

View File

@@ -7,9 +7,9 @@ import (
"github.com/mr-tron/base58" "github.com/mr-tron/base58"
"github.com/INFURA/go-did" "github.com/ucan-wg/go-did-it"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
"github.com/INFURA/go-did/crypto/p256" "github.com/ucan-wg/go-did-it/crypto/p256"
) )
// Specification: missing // Specification: missing

View File

@@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
p256vm "github.com/INFURA/go-did/verifications/p256" p256vm "github.com/ucan-wg/go-did-it/verifications/p256"
) )
func TestJsonRoundTrip(t *testing.T) { func TestJsonRoundTrip(t *testing.T) {

View File

@@ -7,9 +7,9 @@ import (
"github.com/mr-tron/base58" "github.com/mr-tron/base58"
"github.com/INFURA/go-did" "github.com/ucan-wg/go-did-it"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
"github.com/INFURA/go-did/crypto/secp256k1" "github.com/ucan-wg/go-did-it/crypto/secp256k1"
) )
// Specification: https://w3c-ccg.github.io/lds-ecdsa-secp256k1-2019/ // Specification: https://w3c-ccg.github.io/lds-ecdsa-secp256k1-2019/

View File

@@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
secp256k1vm "github.com/INFURA/go-did/verifications/secp256k1" secp256k1vm "github.com/ucan-wg/go-did-it/verifications/secp256k1"
) )
func TestJsonRoundTrip(t *testing.T) { func TestJsonRoundTrip(t *testing.T) {

View File

@@ -7,9 +7,9 @@ import (
"github.com/mr-tron/base58" "github.com/mr-tron/base58"
"github.com/INFURA/go-did" "github.com/ucan-wg/go-did-it"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
"github.com/INFURA/go-did/crypto/x25519" "github.com/ucan-wg/go-did-it/crypto/x25519"
) )
// Specification: https://github.com/digitalbazaar/x25519-key-agreement-key-2019 // Specification: https://github.com/digitalbazaar/x25519-key-agreement-key-2019

View File

@@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
x25519vm "github.com/INFURA/go-did/verifications/x25519" x25519vm "github.com/ucan-wg/go-did-it/verifications/x25519"
) )
func TestJsonRoundTrip2019(t *testing.T) { func TestJsonRoundTrip2019(t *testing.T) {

View File

@@ -5,9 +5,9 @@ import (
"errors" "errors"
"fmt" "fmt"
"github.com/INFURA/go-did" "github.com/ucan-wg/go-did-it"
"github.com/INFURA/go-did/crypto" "github.com/ucan-wg/go-did-it/crypto"
"github.com/INFURA/go-did/crypto/x25519" "github.com/ucan-wg/go-did-it/crypto/x25519"
) )
// Specification: https://w3c-ccg.github.io/did-method-key/#ed25519-x25519 // Specification: https://w3c-ccg.github.io/did-method-key/#ed25519-x25519

View File

@@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
x25519vm "github.com/INFURA/go-did/verifications/x25519" x25519vm "github.com/ucan-wg/go-did-it/verifications/x25519"
) )
func TestJsonRoundTrip2020(t *testing.T) { func TestJsonRoundTrip2020(t *testing.T) {