Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

wip: use trustbloc/kms-go instead of kmscrypto component #3625

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion component/didconfig/verifier/didconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import (

jsonld "github.com/piprate/json-gold/ld"

"github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose"
"github.com/trustbloc/kms-go/doc/jose"

"github.com/hyperledger/aries-framework-go/component/log"
diddoc "github.com/hyperledger/aries-framework-go/component/models/did"
"github.com/hyperledger/aries-framework-go/component/models/jwt"
Expand Down
11 changes: 6 additions & 5 deletions component/didconfig/verifier/didconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ import (

"github.com/stretchr/testify/require"

"github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto"
"github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose"
"github.com/hyperledger/aries-framework-go/component/kmscrypto/kms/localkms"
mockkms "github.com/hyperledger/aries-framework-go/component/kmscrypto/mock/kms"
"github.com/hyperledger/aries-framework-go/component/kmscrypto/secretlock/noop"
"github.com/trustbloc/kms-go/crypto/tinkcrypto"
"github.com/trustbloc/kms-go/doc/jose"
"github.com/trustbloc/kms-go/kms/localkms"
mockkms "github.com/trustbloc/kms-go/mock/kms"
"github.com/trustbloc/kms-go/secretlock/noop"

afgjwt "github.com/hyperledger/aries-framework-go/component/models/jwt"
ldcontext "github.com/hyperledger/aries-framework-go/component/models/ld/context"
ldtestutil "github.com/hyperledger/aries-framework-go/component/models/ld/testutil"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ SPDX-License-Identifier: Apache-2.0
// to use BBS+ keys created by the kms along with the framework's Crypto service.
//
// The default local Crypto service is found at:
// "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto"
// "github.com/trustbloc/kms-go/crypto/tinkcrypto"
//
// While the remote Crypto service is found at:
// "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/webkms"
// "github.com/trustbloc/kms-go/crypto/webkms"
package bbs12381g2pub

import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

"github.com/stretchr/testify/require"

"github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub"
"github.com/trustbloc/kms-go/crypto/primitive/bbs12381g2pub"
)

//nolint:lll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/btcsuite/btcutil/base58"
"github.com/stretchr/testify/require"

bbs "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub"
bbs "github.com/trustbloc/kms-go/crypto/primitive/bbs12381g2pub"
)

func TestGenerateKeyPair(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"github.com/stretchr/testify/require"

bbs "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub"
bbs "github.com/trustbloc/kms-go/crypto/primitive/bbs12381g2pub"
)

func TestParseSignature(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions component/kmscrypto/crypto/tinkcrypto/cl_crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (

"github.com/google/tink/go/keyset"

bld "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/cl/blinder"
sgn "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer"
bld "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/blinder"
sgn "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/signer"
)

// Blind will blind provided values with MasterSecret provided in a kh
Expand Down
4 changes: 2 additions & 2 deletions component/kmscrypto/crypto/tinkcrypto/cl_crypto_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"github.com/hyperledger/ursa-wrapper-go/pkg/libursa/ursa"
"github.com/stretchr/testify/require"

bld "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/cl/blinder"
sgn "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer"
bld "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/blinder"
sgn "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/signer"
)

func TestCL(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions component/kmscrypto/crypto/tinkcrypto/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (

"github.com/hyperledger/aries-framework-go/spi/crypto"

"github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead/subtle"
"github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/bbs"
"github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead/subtle"
"github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/bbs"
)

const (
Expand Down
16 changes: 8 additions & 8 deletions component/kmscrypto/crypto/tinkcrypto/crypto_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ import (

cryptoapi "github.com/hyperledger/aries-framework-go/spi/crypto"

"github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto"
"github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead"
"github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead/subtle"
"github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/bbs"
"github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh"
"github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/keyio"
ecdhpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto"
"github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1"
"github.com/trustbloc/kms-go/crypto"
"github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead"
"github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead/subtle"
"github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/bbs"
"github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/ecdh"
"github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/keyio"
ecdhpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto"
"github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/secp256k1"
)

const testMessage = "test message"
Expand Down
8 changes: 4 additions & 4 deletions component/kmscrypto/crypto/tinkcrypto/key_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ import (
"golang.org/x/crypto/chacha20poly1305"
"golang.org/x/crypto/curve25519"

"github.com/hyperledger/aries-framework-go/component/kmscrypto/util/cryptoutil"
"github.com/trustbloc/kms-go/util/cryptoutil"

cryptoapi "github.com/hyperledger/aries-framework-go/spi/crypto"

"github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead/subtle"
"github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/keyio"
ecdhpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto"
"github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead/subtle"
"github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/keyio"
ecdhpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto"
)

const defKeySize = 32
Expand Down
6 changes: 3 additions & 3 deletions component/kmscrypto/crypto/tinkcrypto/key_wrapper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ import (

"github.com/hyperledger/aries-framework-go/spi/crypto"

"github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh"
"github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/keyio"
ecdhpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto"
"github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/ecdh"
"github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/keyio"
ecdhpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto"
)

type mockKeyWrapperSupport struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import (
"github.com/google/tink/go/tink"
"github.com/stretchr/testify/require"

"github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead"
"github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead/subtle"
aescbcpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/aes_cbc_go_proto"
aeadpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/aes_cbc_hmac_aead_go_proto"
"github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead"
"github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead/subtle"
aescbcpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/aes_cbc_go_proto"
aeadpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/aes_cbc_hmac_aead_go_proto"
)

func TestFactoryMultipleKeys(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ import (
hmacpb "github.com/google/tink/go/proto/hmac_go_proto"
tinkpb "github.com/google/tink/go/proto/tink_go_proto"

"github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead/subtle"
aescbcpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/aes_cbc_go_proto"
aeadpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/aes_cbc_hmac_aead_go_proto"
"github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead/subtle"

aeadpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/aes_cbc_hmac_aead_go_proto"

aescbcpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/aes_cbc_go_proto"
)

// This file contains pre-generated KeyTemplates for AEAD keys. One can use these templates to generate new Keysets.
Expand All @@ -23,43 +25,43 @@ import (

// AES128CBCHMACSHA256KeyTemplate is a KeyTemplate that generates an AES-CBC-HMAC-AEAD key with the following
// parameters:
// - AES key size: 16 bytes
// - HMAC key size: 16 bytes
// - HMAC tag size: 16 bytes
// - HMAC hash function: SHA256
// - AES key size: 16 bytes
// - HMAC key size: 16 bytes
// - HMAC tag size: 16 bytes
// - HMAC hash function: SHA256
func AES128CBCHMACSHA256KeyTemplate() *tinkpb.KeyTemplate {
return createAESCBCHMACAEADKeyTemplate(subtle.AES128Size, subtle.AES128Size, subtle.AES128Size,
commonpb.HashType_SHA256)
}

// AES192CBCHMACSHA384KeyTemplate is a KeyTemplate that generates an AES-CBC-HMAC-AEAD key with the following
// parameters:
// - AES key size: 24 bytes
// - HMAC key size: 24 bytes
// - HMAC tag size: 24 bytes
// - HMAC hash function: SHA384
// - AES key size: 24 bytes
// - HMAC key size: 24 bytes
// - HMAC tag size: 24 bytes
// - HMAC hash function: SHA384
func AES192CBCHMACSHA384KeyTemplate() *tinkpb.KeyTemplate {
return createAESCBCHMACAEADKeyTemplate(subtle.AES192Size, subtle.AES192Size, subtle.AES192Size,
commonpb.HashType_SHA384)
}

// AES256CBCHMACSHA384KeyTemplate is a KeyTemplate that generates an AES-CBC-HMAC-AEAD key with the following
// parameters:
// - AES key size: 32 bytes
// - HMAC key size: 24 bytes
// - HMAC tag size: 24 bytes
// - HMAC hash function: SHA384
// - AES key size: 32 bytes
// - HMAC key size: 24 bytes
// - HMAC tag size: 24 bytes
// - HMAC hash function: SHA384
func AES256CBCHMACSHA384KeyTemplate() *tinkpb.KeyTemplate {
return createAESCBCHMACAEADKeyTemplate(subtle.AES256Size, subtle.AES192Size, subtle.AES192Size,
commonpb.HashType_SHA384)
}

// AES256CBCHMACSHA512KeyTemplate is a KeyTemplate that generates an AES-CBC-HMAC-AEAD key with the following
// parameters:
// - AES key size: 32 bytes
// - HMAC key size: 32 bytes
// - HMAC tag size: 32 bytes
// - HMAC hash function: SHA512
// - AES key size: 32 bytes
// - HMAC key size: 32 bytes
// - HMAC tag size: 32 bytes
// - HMAC hash function: SHA512
func AES256CBCHMACSHA512KeyTemplate() *tinkpb.KeyTemplate {
return createAESCBCHMACAEADKeyTemplate(subtle.AES256Size, subtle.AES256Size, subtle.AES256Size,
commonpb.HashType_SHA512)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
tinkpb "github.com/google/tink/go/proto/tink_go_proto"
"github.com/stretchr/testify/require"

"github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead"
"github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead"
)

func TestKeyTemplates(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/google/tink/go/core/registry"
"github.com/google/tink/go/keyset"

"github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead"
"github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead"
)

func Example() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ import (
"github.com/google/tink/go/subtle/random"
"google.golang.org/protobuf/proto"

"github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead/subtle"
cbcpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/aes_cbc_go_proto"
aeadpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/aes_cbc_hmac_aead_go_proto"
aeadpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/aes_cbc_hmac_aead_go_proto"

"github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead/subtle"
cbcpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/aes_cbc_go_proto"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import (
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/proto"

"github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead"
"github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead/subtle"
aescbcpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/aes_cbc_go_proto"
aeadpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/aes_cbc_hmac_aead_go_proto"
"github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead"
"github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead/subtle"
aescbcpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/aes_cbc_go_proto"
aeadpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/aes_cbc_hmac_aead_go_proto"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/google/tink/go/subtle/random"
"github.com/stretchr/testify/require"

"github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead/subtle"
"github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead/subtle"
)

func TestNewAESCBC(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
josecipher "github.com/go-jose/go-jose/v3/cipher"
"github.com/stretchr/testify/require"

"github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead/subtle"
"github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead/subtle"
)

func TestNewAESCBCHMAC(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"github.com/stretchr/testify/require"

"github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead/subtle"
"github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead/subtle"
)

func TestValidateAESKeySize(t *testing.T) {
Expand Down
Loading
Loading