Skip to content

Commit

Permalink
fix: key id
Browse files Browse the repository at this point in the history
  • Loading branch information
skynet2 committed Oct 1, 2024
1 parent 1c71b21 commit cdcd3d8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions wrapper/localsuite/creator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ import (
kmsapi "github.com/trustbloc/kms-go/spi/kms"
)

const (
keyID = "foo"
)

func TestKeyCreator(t *testing.T) {
t.Run("success", func(t *testing.T) {
keyBytes, _, err := ed25519.GenerateKey(rand.Reader)
require.NoError(t, err)

keyID := "foo"

creator := newKeyCreator(&mockkms.KeyManager{
CrAndExportPubKeyValue: keyBytes,
CrAndExportPubKeyID: keyID,
Expand All @@ -45,8 +47,6 @@ func TestKeyCreator(t *testing.T) {
keyBytes, _, err := ed25519.GenerateKey(rand.Reader)
require.NoError(t, err)

keyID := "foo"

creator := newKeyCreator(&mockkms.KeyManager{
ExportPubKeyTypeValue: kmsapi.ED25519Type,
ExportPubKeyBytesValue: keyBytes,
Expand Down Expand Up @@ -77,7 +77,7 @@ func TestKeyCreator(t *testing.T) {

t.Run("kms exports invalid key value", func(t *testing.T) {
creator := newKeyCreator(&mockkms.KeyManager{
CrAndExportPubKeyValue: []byte("foo"),
CrAndExportPubKeyValue: []byte(keyID),
})

pubJWK, err := creator.Create(kmsapi.ECDSAP256DER)
Expand Down

0 comments on commit cdcd3d8

Please sign in to comment.