Merge pull request #15 from MetaMask/repo-rename

adjust to the repo moving to MetaMask org
This commit is contained in:
Michael Muré
2025-07-28 13:23:04 +02:00
committed by GitHub
59 changed files with 188 additions and 187 deletions

View File

@@ -2,19 +2,19 @@
<h1 align="center">go-did-it</h1>
<p>
<a href="https://github.com/ucan-wg/go-did-it/tags">
<img alt="GitHub Tag" src="https://img.shields.io/github/v/tag/ucan-wg/go-did-it">
<a href="https://github.com/MetaMask/go-did-it/tags">
<img alt="GitHub Tag" src="https://img.shields.io/github/v/tag/MetaMask/go-did-it">
</a>
<a href="https://github.com/ucan-wg/go-did-it/actions?query=">
<img src="https://github.com/ucan-wg/go-did-it/actions/workflows/gotest.yml/badge.svg" alt="Build Status">
<a href="https://github.com/MetaMask/go-did-it/actions?query=">
<img src="https://github.com/MetaMask/go-did-it/actions/workflows/gotest.yml/badge.svg" alt="Build Status">
</a>
<a href="https://ucan-wg.github.io/go-did-it/dev/bench/">
<a href="https://MetaMask.github.io/go-did-it/dev/bench/">
<img alt="Go benchmarks" src="https://img.shields.io/badge/Benchmarks-go-blue">
</a>
<a href="https://github.com/ucan-wg/go-did-it/blob/v1/LICENSE.md">
<a href="https://github.com/MetaMask/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">
</a>
<a href="https://pkg.go.dev/github.com/ucan-wg/go-did-it">
<a href="https://pkg.go.dev/github.com/MetaMask/go-did-it">
<img src="https://img.shields.io/badge/Docs-godoc-blue" alt="Docs">
</a>
</p>
@@ -36,7 +36,7 @@ Built with ❤️ by [Consensys](https://consensys.io/).
## Installation
```bash
go get github.com/ucan-wg/go-did-it
go get github.com/MetaMask/go-did-it
```
## Usage
@@ -52,10 +52,10 @@ import (
"encoding/base64"
"fmt"
"github.com/ucan-wg/go-did-it"
"github.com/MetaMask/go-did-it"
// 0) Import the methods you want to support
_ "github.com/ucan-wg/go-did-it/verifiers/did-key"
_ "github.com/MetaMask/go-did-it/verifiers/did-key"
)
func main() {
@@ -90,11 +90,11 @@ import (
"encoding/base64"
"fmt"
"github.com/ucan-wg/go-did-it"
"github.com/ucan-wg/go-did-it/crypto/x25519"
"github.com/MetaMask/go-did-it"
"github.com/MetaMask/go-did-it/crypto/x25519"
// 0) Import the methods you want to support
_ "github.com/ucan-wg/go-did-it/verifiers/did-key"
_ "github.com/MetaMask/go-did-it/verifiers/did-key"
)
func main() {
@@ -141,14 +141,15 @@ func main() {
### Supported Cryptographic Algorithms
#### Signing Keys
| Algorithm | Signature Format | Public Key Formats | Private Key Formats |
|-----------------|-------------------|-------------------------------------|---------------------------|
| Ed25519 | Raw bytes, ASN.1 | Raw bytes, X.509 DER/PEM, Multibase | Raw bytes, PKCS#8 DER/PEM |
| ECDSA P-256 | Raw bytes, ASN.1 | Raw bytes, X.509 DER/PEM, Multibase | Raw bytes, PKCS#8 DER/PEM |
| ECDSA P-384 | Raw bytes, ASN.1 | Raw bytes, X.509 DER/PEM, Multibase | Raw bytes, PKCS#8 DER/PEM |
| ECDSA P-521 | Raw bytes, ASN.1 | Raw bytes, X.509 DER/PEM, Multibase | Raw bytes, PKCS#8 DER/PEM |
| ECDSA secp256k1 | Raw bytes, ASN.1 | Raw bytes, X.509 DER/PEM, Multibase | Raw bytes, PKCS#8 DER/PEM |
| RSA | PKCS#1 v1.5 ASN.1 | X.509 DER/PEM, Multibase | PKCS#8 DER/PEM |
| Algorithm | Signature Format | Public Key Formats | Private Key Formats | Key Agreement |
|-----------------|-------------------|-------------------------------------|---------------------------|----------------|
| Ed25519 | Raw bytes, ASN.1 | Raw bytes, X.509 DER/PEM, Multibase | Raw bytes, PKCS#8 DER/PEM | ✅ (via X25519) |
| ECDSA P-256 | Raw bytes, ASN.1 | Raw bytes, X.509 DER/PEM, Multibase | Raw bytes, PKCS#8 DER/PEM | ✅ |
| ECDSA P-384 | Raw bytes, ASN.1 | Raw bytes, X.509 DER/PEM, Multibase | Raw bytes, PKCS#8 DER/PEM | ✅ |
| ECDSA P-521 | Raw bytes, ASN.1 | Raw bytes, X.509 DER/PEM, Multibase | Raw bytes, PKCS#8 DER/PEM | ✅ |
| ECDSA secp256k1 | Raw bytes, ASN.1 | Raw bytes, X.509 DER/PEM, Multibase | Raw bytes, PKCS#8 DER/PEM | ✅ |
| RSA | PKCS#1 v1.5 ASN.1 | X.509 DER/PEM, Multibase | PKCS#8 DER/PEM | ❌ |
| X25519 | ❌ | Raw bytes, X.509 DER/PEM, Multibase | Raw bytes, PKCS#8 DER/PEM | ✅ |
#### Key Agreement (Encryption)

View File

@@ -1,9 +1,9 @@
package didkeyctl
import (
"github.com/ucan-wg/go-did-it"
"github.com/ucan-wg/go-did-it/crypto"
didkey "github.com/ucan-wg/go-did-it/verifiers/did-key"
"github.com/MetaMask/go-did-it"
"github.com/MetaMask/go-did-it/crypto"
didkey "github.com/MetaMask/go-did-it/verifiers/did-key"
)
func FromPublicKey(pub crypto.PublicKey) did.DID {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -6,8 +6,8 @@ import (
"github.com/stretchr/testify/require"
"github.com/ucan-wg/go-did-it/crypto"
"github.com/ucan-wg/go-did-it/crypto/_testsuite"
"github.com/MetaMask/go-did-it/crypto"
"github.com/MetaMask/go-did-it/crypto/_testsuite"
)
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/ecdsa"
"github.com/ucan-wg/go-did-it/crypto"
"github.com/MetaMask/go-did-it/crypto"
)
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/ecdsa"
"github.com/ucan-wg/go-did-it/crypto"
helpers "github.com/ucan-wg/go-did-it/crypto/internal"
"github.com/MetaMask/go-did-it/crypto"
helpers "github.com/MetaMask/go-did-it/crypto/internal"
)
var _ crypto.PublicKeySigningBytes = &PublicKey{}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

2
go.mod
View File

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

View File

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

View File

@@ -3,7 +3,7 @@ package did
import (
"fmt"
"github.com/ucan-wg/go-did-it/crypto"
"github.com/MetaMask/go-did-it/crypto"
)
// 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/ucan-wg/go-did-it"
"github.com/ucan-wg/go-did-it/crypto/ed25519"
"github.com/MetaMask/go-did-it"
"github.com/MetaMask/go-did-it/crypto/ed25519"
)
// Specification: https://w3c-ccg.github.io/lds-ed25519-2018/

View File

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

View File

@@ -5,8 +5,8 @@ import (
"errors"
"fmt"
"github.com/ucan-wg/go-did-it"
"github.com/ucan-wg/go-did-it/crypto/ed25519"
"github.com/MetaMask/go-did-it"
"github.com/MetaMask/go-did-it/crypto/ed25519"
)
// 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/ucan-wg/go-did-it"
"github.com/ucan-wg/go-did-it/crypto/ed25519"
ed25519vm "github.com/ucan-wg/go-did-it/verifiers/_methods/ed25519"
_ "github.com/ucan-wg/go-did-it/verifiers/did-key"
"github.com/MetaMask/go-did-it"
"github.com/MetaMask/go-did-it/crypto/ed25519"
ed25519vm "github.com/MetaMask/go-did-it/verifiers/_methods/ed25519"
_ "github.com/MetaMask/go-did-it/verifiers/did-key"
)
func TestJsonRoundTrip2020(t *testing.T) {

View File

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

View File

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

View File

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

View File

@@ -6,9 +6,9 @@ import (
"github.com/stretchr/testify/require"
_ "github.com/ucan-wg/go-did-it/verifiers/did-key"
_ "github.com/MetaMask/go-did-it/verifiers/did-key"
"github.com/ucan-wg/go-did-it/verifiers/_methods/multikey"
"github.com/MetaMask/go-did-it/verifiers/_methods/multikey"
)
func TestJsonRoundTrip(t *testing.T) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -5,9 +5,9 @@ import (
"errors"
"fmt"
"github.com/ucan-wg/go-did-it"
"github.com/ucan-wg/go-did-it/crypto"
"github.com/ucan-wg/go-did-it/crypto/x25519"
"github.com/MetaMask/go-did-it"
"github.com/MetaMask/go-did-it/crypto"
"github.com/MetaMask/go-did-it/crypto/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/ucan-wg/go-did-it/verifiers/_methods/x25519"
"github.com/MetaMask/go-did-it/verifiers/_methods/x25519"
)
func TestJsonRoundTrip2020(t *testing.T) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/ucan-wg/go-did-it"
"github.com/MetaMask/go-did-it"
)
func TestDocument(t *testing.T) {

View File

@@ -8,19 +8,19 @@ import (
"net/url"
"strings"
"github.com/ucan-wg/go-did-it"
allkeys "github.com/ucan-wg/go-did-it/crypto/_allkeys"
"github.com/ucan-wg/go-did-it/crypto/ed25519"
"github.com/ucan-wg/go-did-it/crypto/p256"
"github.com/ucan-wg/go-did-it/crypto/p384"
"github.com/ucan-wg/go-did-it/crypto/p521"
"github.com/ucan-wg/go-did-it/crypto/rsa"
"github.com/ucan-wg/go-did-it/crypto/secp256k1"
ed25519vm "github.com/ucan-wg/go-did-it/verifiers/_methods/ed25519"
"github.com/ucan-wg/go-did-it/verifiers/_methods/jsonwebkey"
"github.com/ucan-wg/go-did-it/verifiers/_methods/multikey"
p256vm "github.com/ucan-wg/go-did-it/verifiers/_methods/p256"
secp256k1vm "github.com/ucan-wg/go-did-it/verifiers/_methods/secp256k1"
"github.com/MetaMask/go-did-it"
allkeys "github.com/MetaMask/go-did-it/crypto/_allkeys"
"github.com/MetaMask/go-did-it/crypto/ed25519"
"github.com/MetaMask/go-did-it/crypto/p256"
"github.com/MetaMask/go-did-it/crypto/p384"
"github.com/MetaMask/go-did-it/crypto/p521"
"github.com/MetaMask/go-did-it/crypto/rsa"
"github.com/MetaMask/go-did-it/crypto/secp256k1"
ed25519vm "github.com/MetaMask/go-did-it/verifiers/_methods/ed25519"
"github.com/MetaMask/go-did-it/verifiers/_methods/jsonwebkey"
"github.com/MetaMask/go-did-it/verifiers/_methods/multikey"
p256vm "github.com/MetaMask/go-did-it/verifiers/_methods/p256"
secp256k1vm "github.com/MetaMask/go-did-it/verifiers/_methods/secp256k1"
)
// Specification: https://web.plc.directory/spec/v0.1/did-plc

View File

@@ -5,7 +5,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/ucan-wg/go-did-it"
"github.com/MetaMask/go-did-it"
)
func TestParseDIDPlc(t *testing.T) {