Integrate go-varsig and go-did-it

- go-varsig provides a varsig V1 implementation
- go-did-it provides a complete and extensible DID implementation
This commit is contained in:
Michael Muré
2025-07-31 14:43:42 +02:00
parent 947add66c5
commit 33e8a8a821
74 changed files with 317 additions and 2736 deletions

View File

@@ -9,11 +9,12 @@ import (
"testing"
"time"
"github.com/MetaMask/go-did-it"
"github.com/MetaMask/go-did-it/controller/did-key"
"github.com/MetaMask/go-did-it/crypto/ed25519"
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p/core/crypto"
"github.com/stretchr/testify/require"
"github.com/ucan-wg/go-ucan/did"
"github.com/ucan-wg/go-ucan/pkg/command"
"github.com/ucan-wg/go-ucan/pkg/policy"
"github.com/ucan-wg/go-ucan/pkg/policy/literal"
@@ -172,15 +173,12 @@ func BenchmarkContainerSerialisation(b *testing.B) {
}
}
func randDID() (crypto.PrivKey, did.DID) {
privKey, _, err := crypto.GenerateEd25519Key(rand.Reader)
if err != nil {
panic(err)
}
d, err := did.FromPrivKey(privKey)
func randDID() (ed25519.PrivateKey, did.DID) {
_, privKey, err := ed25519.GenerateKeyPair()
if err != nil {
panic(err)
}
d := didkeyctl.FromPrivateKey(privKey)
return privKey, d
}