rename the package to ucan-wg/go-dit-it
This commit is contained in:
|
Before Width: | Height: | Size: 202 KiB After Width: | Height: | Size: 202 KiB |
24
Readme.md
24
Readme.md
@@ -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/).
|
||||||
|
|
||||||

|
## Concepts
|
||||||
|
|
||||||
`go-did` concepts:
|

|
||||||
|
|
||||||

|
|
||||||
|
|||||||
@@ -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){
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
@@ -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]{
|
||||||
|
|||||||
@@ -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{}
|
||||||
|
|||||||
@@ -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{}
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -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]{
|
||||||
|
|||||||
@@ -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{}
|
||||||
|
|||||||
@@ -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{}
|
||||||
|
|||||||
@@ -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]{
|
||||||
|
|||||||
@@ -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{}
|
||||||
|
|||||||
@@ -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{}
|
||||||
|
|||||||
@@ -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]{
|
||||||
|
|||||||
@@ -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{}
|
||||||
|
|||||||
@@ -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{}
|
||||||
|
|||||||
@@ -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 (
|
||||||
|
|||||||
@@ -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]{
|
||||||
|
|||||||
@@ -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{}
|
||||||
|
|||||||
@@ -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{}
|
||||||
|
|||||||
@@ -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]{
|
||||||
|
|||||||
@@ -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{}
|
||||||
|
|||||||
@@ -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{}
|
||||||
|
|||||||
@@ -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]{
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
15
design.md
15
design.md
@@ -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
|
|
||||||
@@ -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() {
|
||||||
|
|||||||
@@ -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{}
|
||||||
|
|||||||
@@ -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
2
go.mod
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
@@ -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{}
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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/
|
||||||
|
|||||||
@@ -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() {
|
||||||
|
|||||||
@@ -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 |
@@ -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.
|
||||||
|
|||||||
@@ -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/
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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/
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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/
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user