diff --git a/component/didconfig/verifier/didconfig.go b/component/didconfig/verifier/didconfig.go index ec7765cf0..41a3e4fad 100644 --- a/component/didconfig/verifier/didconfig.go +++ b/component/didconfig/verifier/didconfig.go @@ -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" diff --git a/component/didconfig/verifier/didconfig_test.go b/component/didconfig/verifier/didconfig_test.go index 3c44c0026..3dbd950c9 100644 --- a/component/didconfig/verifier/didconfig_test.go +++ b/component/didconfig/verifier/didconfig_test.go @@ -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" diff --git a/component/kmscrypto/crypto/primitive/bbs12381g2pub/bbs12381g2pub.go b/component/kmscrypto/crypto/primitive/bbs12381g2pub/bbs12381g2pub.go index 9bbe15be0..b737748fc 100644 --- a/component/kmscrypto/crypto/primitive/bbs12381g2pub/bbs12381g2pub.go +++ b/component/kmscrypto/crypto/primitive/bbs12381g2pub/bbs12381g2pub.go @@ -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 ( diff --git a/component/kmscrypto/crypto/primitive/bbs12381g2pub/bbs_test.go b/component/kmscrypto/crypto/primitive/bbs12381g2pub/bbs_test.go index 7166a2fdd..bb9207869 100644 --- a/component/kmscrypto/crypto/primitive/bbs12381g2pub/bbs_test.go +++ b/component/kmscrypto/crypto/primitive/bbs12381g2pub/bbs_test.go @@ -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 diff --git a/component/kmscrypto/crypto/primitive/bbs12381g2pub/keys_test.go b/component/kmscrypto/crypto/primitive/bbs12381g2pub/keys_test.go index a92df44f5..6e71634ac 100644 --- a/component/kmscrypto/crypto/primitive/bbs12381g2pub/keys_test.go +++ b/component/kmscrypto/crypto/primitive/bbs12381g2pub/keys_test.go @@ -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) { diff --git a/component/kmscrypto/crypto/primitive/bbs12381g2pub/signature_test.go b/component/kmscrypto/crypto/primitive/bbs12381g2pub/signature_test.go index a8f15cb07..94c22d3c7 100644 --- a/component/kmscrypto/crypto/primitive/bbs12381g2pub/signature_test.go +++ b/component/kmscrypto/crypto/primitive/bbs12381g2pub/signature_test.go @@ -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) { diff --git a/component/kmscrypto/crypto/tinkcrypto/cl_crypto.go b/component/kmscrypto/crypto/tinkcrypto/cl_crypto.go index 492a799a5..bdd7ddc38 100644 --- a/component/kmscrypto/crypto/tinkcrypto/cl_crypto.go +++ b/component/kmscrypto/crypto/tinkcrypto/cl_crypto.go @@ -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 diff --git a/component/kmscrypto/crypto/tinkcrypto/cl_crypto_test.go b/component/kmscrypto/crypto/tinkcrypto/cl_crypto_test.go index db476330f..0ceb2a43f 100644 --- a/component/kmscrypto/crypto/tinkcrypto/cl_crypto_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/cl_crypto_test.go @@ -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) { diff --git a/component/kmscrypto/crypto/tinkcrypto/crypto.go b/component/kmscrypto/crypto/tinkcrypto/crypto.go index d179f2b62..27ab98fba 100644 --- a/component/kmscrypto/crypto/tinkcrypto/crypto.go +++ b/component/kmscrypto/crypto/tinkcrypto/crypto.go @@ -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 ( diff --git a/component/kmscrypto/crypto/tinkcrypto/crypto_test.go b/component/kmscrypto/crypto/tinkcrypto/crypto_test.go index d15d81c7e..85f7f090b 100644 --- a/component/kmscrypto/crypto/tinkcrypto/crypto_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/crypto_test.go @@ -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" diff --git a/component/kmscrypto/crypto/tinkcrypto/key_wrapper.go b/component/kmscrypto/crypto/tinkcrypto/key_wrapper.go index a5cdee7e3..315f8d03b 100644 --- a/component/kmscrypto/crypto/tinkcrypto/key_wrapper.go +++ b/component/kmscrypto/crypto/tinkcrypto/key_wrapper.go @@ -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 diff --git a/component/kmscrypto/crypto/tinkcrypto/key_wrapper_test.go b/component/kmscrypto/crypto/tinkcrypto/key_wrapper_test.go index b440786e8..0eda2cd6b 100644 --- a/component/kmscrypto/crypto/tinkcrypto/key_wrapper_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/key_wrapper_test.go @@ -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 { diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/aead/aead_factory_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/aead/aead_factory_test.go index 733f900c9..3a1ce8c8b 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/aead/aead_factory_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/aead/aead_factory_test.go @@ -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) { diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/aead/aead_key_templates.go b/component/kmscrypto/crypto/tinkcrypto/primitive/aead/aead_key_templates.go index f96c43778..977437f8b 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/aead/aead_key_templates.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/aead/aead_key_templates.go @@ -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. @@ -23,10 +25,10 @@ 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) @@ -34,10 +36,10 @@ func AES128CBCHMACSHA256KeyTemplate() *tinkpb.KeyTemplate { // 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) @@ -45,10 +47,10 @@ func AES192CBCHMACSHA384KeyTemplate() *tinkpb.KeyTemplate { // 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) @@ -56,10 +58,10 @@ func AES256CBCHMACSHA384KeyTemplate() *tinkpb.KeyTemplate { // 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) diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/aead/aead_key_templates_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/aead/aead_key_templates_test.go index 8652c419e..cdf675da2 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/aead/aead_key_templates_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/aead/aead_key_templates_test.go @@ -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) { diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/aead/aead_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/aead/aead_test.go index e6633cf7f..ff97a6761 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/aead/aead_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/aead/aead_test.go @@ -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() { diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/aead/aes_cbc_hmac_aead_key_manager.go b/component/kmscrypto/crypto/tinkcrypto/primitive/aead/aes_cbc_hmac_aead_key_manager.go index 5d6f65153..7dad4cf40 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/aead/aes_cbc_hmac_aead_key_manager.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/aead/aes_cbc_hmac_aead_key_manager.go @@ -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 ( diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/aead/aes_cbc_hmac_aead_key_manager_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/aead/aes_cbc_hmac_aead_key_manager_test.go index 5c778ee9b..86a7aeff2 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/aead/aes_cbc_hmac_aead_key_manager_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/aead/aes_cbc_hmac_aead_key_manager_test.go @@ -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 ( diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/aead/subtle/aes_cbc_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/aead/subtle/aes_cbc_test.go index 836b6f6e0..2f5e556ac 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/aead/subtle/aes_cbc_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/aead/subtle/aes_cbc_test.go @@ -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) { diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/aead/subtle/gojose_aes_cbc_hmac_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/aead/subtle/gojose_aes_cbc_hmac_test.go index 5d57018f6..b514d71aa 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/aead/subtle/gojose_aes_cbc_hmac_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/aead/subtle/gojose_aes_cbc_hmac_test.go @@ -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) { diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/aead/subtle/subtle_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/aead/subtle/subtle_test.go index f6d58816f..33a14645c 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/aead/subtle/subtle_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/aead/subtle/subtle_test.go @@ -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) { diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs.go b/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs.go index 0e943b803..32c729a68 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs.go @@ -9,84 +9,83 @@ SPDX-License-Identifier: Apache-2.0 // The functionality of BBS+ signatures/proofs is represented as a pair of // primitives (interfaces): // -// * Signer for signing a list of messages with a private key -// -// * Verifier for verifying a signature against a list of messages, deriving a proof from a signature for a given -// set of sub messages and verifying such derived proof. +// - Signer for signing a list of messages with a private key // +// - Verifier for verifying a signature against a list of messages, deriving a proof from a signature for a given +// set of sub messages and verifying such derived proof. // // Example: // -// package main +// package main // -// import ( -// "bytes" +// import ( +// "bytes" // -// "github.com/google/tink/go/keyset" +// "github.com/google/tink/go/keyset" // -// "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/bbs" -// ) +// "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/bbs" +// ) // -// func main() { -// // create signer keyset handle -// kh, err := keyset.NewHandle(bbs.BLS12381G2KeyTemplate()) -// if err != nil { -// //handle error -// } +// func main() { +// // create signer keyset handle +// kh, err := keyset.NewHandle(bbs.BLS12381G2KeyTemplate()) +// if err != nil { +// //handle error +// } // -// // extract signer public keyset handle and key for signature verification and proof derivation/verification -// verKH, err := kh.Public() -// if err != nil { -// //handle error -// } +// // extract signer public keyset handle and key for signature verification and proof derivation/verification +// verKH, err := kh.Public() +// if err != nil { +// //handle error +// } // -// // finally get the BBS+ signing primitive from the private key handle created above -// s:= bbs.NewSigner(kh) +// // finally get the BBS+ signing primitive from the private key handle created above +// s:= bbs.NewSigner(kh) // -// // create a message to be signed -// messages := [][]byte{[]byte("message 1"), []byte("message 2"), []byte("message 3"), []byte("message 4")} +// // create a message to be signed +// messages := [][]byte{[]byte("message 1"), []byte("message 2"), []byte("message 3"), []byte("message 4")} // -// // and now sign using s -// sig, err = s.Sign(messages) -// if err != nil { -// // handle error -// } +// // and now sign using s +// sig, err = s.Sign(messages) +// if err != nil { +// // handle error +// } // -// // to verify, get the BBS+ verification primitive from the public key handle created earlier above -// v := bbs.NewVerifier(verKH) +// // to verify, get the BBS+ verification primitive from the public key handle created earlier above +// v := bbs.NewVerifier(verKH) // -// // and verify signature -// err = v.Verify(messages, sig) -// if err != nil { -// // handle error -// } +// // and verify signature +// err = v.Verify(messages, sig) +// if err != nil { +// // handle error +// } // -// // to derive a proof from the bbs signature, create the indices of the messages to be revealed by the proof -// revealedIndexes := []int{0, 2} +// // to derive a proof from the bbs signature, create the indices of the messages to be revealed by the proof +// revealedIndexes := []int{0, 2} // -// // and a nonce -// nonce := make([]byte, 10) +// // and a nonce +// nonce := make([]byte, 10) // -// _, err = rand.Read(nonce) -// if err != nil { -// // handle error -// } +// _, err = rand.Read(nonce) +// if err != nil { +// // handle error +// } // -// // then derive a proof for messages at index 0 and 2 as follows -// proof, err := verifier.DeriveProof(messages, sig, nonce, revealedIndexes) -// if err != nil { -// // handle error -// } +// // then derive a proof for messages at index 0 and 2 as follows +// proof, err := verifier.DeriveProof(messages, sig, nonce, revealedIndexes) +// if err != nil { +// // handle error +// } // -// // create a copy of the revealed messages to the party that should only access messages at index 0 and 2 -// revealedMsgs := [][]byte{messages[0], messages[2]} +// // create a copy of the revealed messages to the party that should only access messages at index 0 and 2 +// revealedMsgs := [][]byte{messages[0], messages[2]} // -// // finally to verify the proof's authenticity for revealedMsgs, do the following -// err = verifier.VerifyProof(revealedMsgs, proof, nonce) -// if err != nil { -// // handle error -// } -// } +// // finally to verify the proof's authenticity for revealedMsgs, do the following +// err = verifier.VerifyProof(revealedMsgs, proof, nonce) +// if err != nil { +// // handle error +// } +// } package bbs import ( diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_key_template.go b/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_key_template.go index 214108cee..15c913842 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_key_template.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_key_template.go @@ -11,7 +11,7 @@ import ( commonpb "github.com/google/tink/go/proto/common_go_proto" tinkpb "github.com/google/tink/go/proto/tink_go_proto" - bbspb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/bbs_go_proto" + bbspb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/bbs_go_proto" ) // BLS12381G2KeyTemplate creates a Tink key template for BBS+ on BLS12-381 curve with G2 group. diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_primitive_factory_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_primitive_factory_test.go index c02968d7c..ebf4a7abf 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_primitive_factory_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_primitive_factory_test.go @@ -23,9 +23,9 @@ import ( "github.com/google/tink/go/tink" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/api" - bbspb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/bbs_go_proto" + "github.com/trustbloc/kms-go/crypto/primitive/bbs12381g2pub" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/bbs/api" + bbspb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/bbs_go_proto" ) func TestSignerVerifierFactory(t *testing.T) { diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_signer_factory.go b/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_signer_factory.go index aadec8d1d..ff0b3d807 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_signer_factory.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_signer_factory.go @@ -15,7 +15,7 @@ import ( "github.com/google/tink/go/keyset" tinkpb "github.com/google/tink/go/proto/tink_go_proto" - bbsapi "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/api" + bbsapi "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/bbs/api" ) // NewSigner returns a BBS Signer primitive from the given keyset handle. diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_signer_key_manager.go b/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_signer_key_manager.go index 98a1db2b4..a9a86b2ab 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_signer_key_manager.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_signer_key_manager.go @@ -17,9 +17,9 @@ import ( "github.com/google/tink/go/subtle" "google.golang.org/protobuf/proto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" - bbssubtle "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/subtle" - bbspb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/bbs_go_proto" + "github.com/trustbloc/kms-go/crypto/primitive/bbs12381g2pub" + bbssubtle "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/bbs/subtle" + bbspb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/bbs_go_proto" ) const ( diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_signer_key_manager_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_signer_key_manager_test.go index 27d3a0b5d..169cf7d12 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_signer_key_manager_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_signer_key_manager_test.go @@ -15,7 +15,7 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/protobuf/proto" - bbspb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/bbs_go_proto" + bbspb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/bbs_go_proto" ) func TestBBSignerKeyManager_Primitive(t *testing.T) { diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_verifier_factory.go b/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_verifier_factory.go index 294c4a4fc..638a126d7 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_verifier_factory.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_verifier_factory.go @@ -16,7 +16,7 @@ import ( "github.com/google/tink/go/keyset" tinkpb "github.com/google/tink/go/proto/tink_go_proto" - bbsapi "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/api" + bbsapi "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/bbs/api" ) // NewVerifier returns a Verifier primitive from the given keyset handle. diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_verifier_key_manager.go b/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_verifier_key_manager.go index a0e34ab87..8f984ea66 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_verifier_key_manager.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_verifier_key_manager.go @@ -14,8 +14,8 @@ import ( tinkpb "github.com/google/tink/go/proto/tink_go_proto" "google.golang.org/protobuf/proto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/subtle" - bbspb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/bbs_go_proto" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/bbs/subtle" + bbspb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/bbs_go_proto" ) const ( diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_verifier_key_manager_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_verifier_key_manager_test.go index 38a347ac2..ad3939915 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_verifier_key_manager_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/bbs_verifier_key_manager_test.go @@ -15,8 +15,8 @@ import ( "github.com/google/tink/go/subtle" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" - bbspb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/bbs_go_proto" + "github.com/trustbloc/kms-go/crypto/primitive/bbs12381g2pub" + bbspb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/bbs_go_proto" ) func TestVerifierKeyManager_Primitive(t *testing.T) { diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/subtle/bls12381g2_signer.go b/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/subtle/bls12381g2_signer.go index 0cbecd2a0..769513426 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/subtle/bls12381g2_signer.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/subtle/bls12381g2_signer.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package subtle import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" + "github.com/trustbloc/kms-go/crypto/primitive/bbs12381g2pub" ) // BLS12381G2Signer is the BBS+ signer for BLS12-381 curve for keys on a G2 group. @@ -29,8 +29,9 @@ func NewBLS12381G2Signer(privateKey []byte) *BLS12381G2Signer { // Sign will sign create signature of each message and aggregate it into a single signature using the signer's // private key. // returns: -// signature in []byte -// error in case of errors +// +// signature in []byte +// error in case of errors func (s *BLS12381G2Signer) Sign(messages [][]byte) ([]byte, error) { return s.bbsPrimitive.Sign(messages, s.privateKeyBytes) } diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/subtle/bls12381g2_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/subtle/bls12381g2_test.go index 2b70be7a2..fe2814998 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/subtle/bls12381g2_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/subtle/bls12381g2_test.go @@ -13,7 +13,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 TestBBSG2_Sign(t *testing.T) { diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/subtle/bls12381g2_verifier.go b/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/subtle/bls12381g2_verifier.go index 01d15af40..8de6d2609 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/subtle/bls12381g2_verifier.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/subtle/bls12381g2_verifier.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package subtle import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" + "github.com/trustbloc/kms-go/crypto/primitive/bbs12381g2pub" ) // BLS12381G2Verifier is the BBS+ signature/proof verifier for keys on BLS12-381 curve with a point in the G2 group. @@ -28,14 +28,16 @@ func NewBLS12381G2Verifier(signerPublicKey []byte) *BLS12381G2Verifier { // Verify will verify an aggregated signature of one or more messages against the signer's public key. // returns: -// error in case of errors or nil if signature verification was successful +// +// error in case of errors or nil if signature verification was successful func (v *BLS12381G2Verifier) Verify(messages [][]byte, signature []byte) error { return v.bbsPrimitive.Verify(messages, signature, v.signerPubKeyBytes) } // VerifyProof will verify a BBS+ signature proof (generated e.g. by DeriveProof()) with the signer's public key. // returns: -// error in case of errors or nil if signature proof verification was successful +// +// error in case of errors or nil if signature proof verification was successful func (v *BLS12381G2Verifier) VerifyProof(messages [][]byte, proof, nonce []byte) error { return v.bbsPrimitive.VerifyProof(messages, proof, nonce, v.signerPubKeyBytes) } @@ -43,8 +45,9 @@ func (v *BLS12381G2Verifier) VerifyProof(messages [][]byte, proof, nonce []byte) // DeriveProof will create a BBS+ signature proof for a list of revealed messages using BBS signature // (can be built using a Signer's Sign() call) and the signer's public key. // returns: -// signature proof in []byte -// error in case of errors +// +// signature proof in []byte +// error in case of errors func (v *BLS12381G2Verifier) DeriveProof(messages [][]byte, signature, nonce []byte, revealedIndexes []int) ([]byte, error) { return v.bbsPrimitive.DeriveProof(messages, signature, nonce, v.signerPubKeyBytes, revealedIndexes) diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/blinder/cl_blinder_factory.go b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/blinder/cl_blinder_factory.go index 0f8bd9590..c374fcbb6 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/blinder/cl_blinder_factory.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/blinder/cl_blinder_factory.go @@ -16,7 +16,7 @@ import ( "github.com/google/tink/go/core/registry" "github.com/google/tink/go/keyset" - clapi "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/cl/api" + clapi "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/api" ) // NewBlinder returns a CL Blinder primitive from the given keyset handle. diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/blinder/cl_blinder_key_manager.go b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/blinder/cl_blinder_key_manager.go index 1143ebfaf..dab8039ec 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/blinder/cl_blinder_key_manager.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/blinder/cl_blinder_key_manager.go @@ -18,8 +18,8 @@ import ( "github.com/hyperledger/ursa-wrapper-go/pkg/libursa/ursa" "google.golang.org/protobuf/proto" - clsubtle "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/cl/subtle" - clpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/cl_go_proto" + clsubtle "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/subtle" + clpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/cl_go_proto" ) const ( diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/blinder/cl_blinder_key_manager_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/blinder/cl_blinder_key_manager_test.go index e5c9703a7..c4b54c551 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/blinder/cl_blinder_key_manager_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/blinder/cl_blinder_key_manager_test.go @@ -15,8 +15,8 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/protobuf/proto" - clsubtle "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/cl/subtle" - clpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/cl_go_proto" + clsubtle "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/subtle" + clpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/cl_go_proto" ) func TestCLBlinderKeyManager_Primitive(t *testing.T) { diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/blinder/cl_blinder_key_template.go b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/blinder/cl_blinder_key_template.go index 33ee30c3d..092819ee2 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/blinder/cl_blinder_key_template.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/blinder/cl_blinder_key_template.go @@ -13,7 +13,7 @@ import ( tinkpb "github.com/google/tink/go/proto/tink_go_proto" "google.golang.org/protobuf/proto" - clpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/cl_go_proto" + clpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/cl_go_proto" ) // MasterSecretKeyTemplate is for creating CL Master Secret key template. diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/blinder/cl_blinder_key_template_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/blinder/cl_blinder_key_template_test.go index 87a8605d8..eee8f694d 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/blinder/cl_blinder_key_template_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/blinder/cl_blinder_key_template_test.go @@ -15,7 +15,7 @@ import ( "github.com/google/tink/go/keyset" "github.com/stretchr/testify/require" - clsubtle "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/cl/subtle" + clsubtle "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/subtle" ) func TestCLMasterSecretKeyTemplateSuccess(t *testing.T) { diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer/cl_signer_factory.go b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer/cl_signer_factory.go index f0f715f71..f57751b86 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer/cl_signer_factory.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer/cl_signer_factory.go @@ -16,7 +16,7 @@ import ( "github.com/google/tink/go/core/registry" "github.com/google/tink/go/keyset" - clapi "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/cl/api" + clapi "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/api" ) // NewSigner returns a CL Signer primitive from the given keyset handle. diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer/cl_signer_key_manager.go b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer/cl_signer_key_manager.go index 74e7cf47f..4d1980b5a 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer/cl_signer_key_manager.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer/cl_signer_key_manager.go @@ -18,9 +18,9 @@ import ( "github.com/hyperledger/ursa-wrapper-go/pkg/libursa/ursa" "google.golang.org/protobuf/proto" - clsubtle "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/cl/subtle" - clpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/cl_go_proto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/internal/ursautil" + clsubtle "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/subtle" + clpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/cl_go_proto" + "github.com/trustbloc/kms-go/internal/ursautil" ) const ( diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer/cl_signer_key_manager_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer/cl_signer_key_manager_test.go index cf071b5db..31c589588 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer/cl_signer_key_manager_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer/cl_signer_key_manager_test.go @@ -15,8 +15,8 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/protobuf/proto" - clsubtle "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/cl/subtle" - clpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/cl_go_proto" + clsubtle "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/subtle" + clpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/cl_go_proto" ) func TestCLSignerKeyManager_Primitive(t *testing.T) { diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer/cl_signer_key_template.go b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer/cl_signer_key_template.go index da2db2144..0edbe0635 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer/cl_signer_key_template.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer/cl_signer_key_template.go @@ -13,7 +13,7 @@ import ( tinkpb "github.com/google/tink/go/proto/tink_go_proto" "google.golang.org/protobuf/proto" - clpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/cl_go_proto" + clpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/cl_go_proto" ) // CredDefKeyTemplate si fro creating CL Cred Def key template. diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer/cl_signer_key_template_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer/cl_signer_key_template_test.go index fdcde7810..f4b6dc48e 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer/cl_signer_key_template_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer/cl_signer_key_template_test.go @@ -16,7 +16,7 @@ import ( "github.com/hyperledger/ursa-wrapper-go/pkg/libursa/ursa" "github.com/stretchr/testify/require" - clsubtle "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/cl/subtle" + clsubtle "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/subtle" ) func TestCLCredDefKeyTemplateSuccess(t *testing.T) { diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer/cl_signer_pubkey_helper.go b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer/cl_signer_pubkey_helper.go index 4f1179a8a..eb95dd032 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer/cl_signer_pubkey_helper.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer/cl_signer_pubkey_helper.go @@ -17,7 +17,7 @@ import ( "github.com/google/tink/go/keyset" tinkpb "github.com/google/tink/go/proto/tink_go_proto" - clproto "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/cl_go_proto" + clproto "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/cl_go_proto" ) // ExportCredDefPubKey will export corresponding pubKey in bytes. diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/subtle/cl_blinder.go b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/subtle/cl_blinder.go index 16369192e..263012d90 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/subtle/cl_blinder.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/subtle/cl_blinder.go @@ -15,7 +15,7 @@ import ( "github.com/hyperledger/ursa-wrapper-go/pkg/libursa/ursa" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/internal/ursautil" + "github.com/trustbloc/kms-go/internal/ursautil" ) // CLBlinder is used for blinding CL MasterSecret with arbitrary values. diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/subtle/cl_blinder_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/subtle/cl_blinder_test.go index d95190b73..b7246924b 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/subtle/cl_blinder_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/subtle/cl_blinder_test.go @@ -14,7 +14,7 @@ import ( "github.com/stretchr/testify/require" - clapi "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/cl/api" + clapi "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/api" ) func TestIsCLBlinder(t *testing.T) { diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/subtle/cl_signer.go b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/subtle/cl_signer.go index 06383a657..92632b703 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/subtle/cl_signer.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/subtle/cl_signer.go @@ -14,7 +14,7 @@ import ( "github.com/hyperledger/ursa-wrapper-go/pkg/libursa/ursa" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/internal/ursautil" + "github.com/trustbloc/kms-go/internal/ursautil" ) // CLSigner is used for CL signature using the provided CredDef key. diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/subtle/cl_signer_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/subtle/cl_signer_test.go index 7902d4fb9..39951777b 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/subtle/cl_signer_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/subtle/cl_signer_test.go @@ -15,7 +15,7 @@ import ( "github.com/hyperledger/ursa-wrapper-go/pkg/libursa/ursa" "github.com/stretchr/testify/require" - clapi "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/cl/api" + clapi "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/api" ) func TestIsCLSigner(t *testing.T) { diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/subtle/test_utils.go b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/subtle/test_utils.go index c85f21b9d..21fd33e54 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/cl/subtle/test_utils.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/cl/subtle/test_utils.go @@ -16,7 +16,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/internal/ursautil" + "github.com/trustbloc/kms-go/internal/ursautil" ) // NewTestCLSigner returns test CLSigner. diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh.go b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh.go index baa14de88..886d63fae 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh.go @@ -9,90 +9,89 @@ SPDX-License-Identifier: Apache-2.0 // The functionality of ecdh Encryption is represented as a pair of // primitives (interfaces): // -// * ECDHEncrypt for encryption of data and aad for a given cek (recipients cek wrapping is not done in this primitive) -// -// * ECDHDecrypt for decryption of data for a given cek and returning decrypted plaintext +// - ECDHEncrypt for encryption of data and aad for a given cek (recipients cek wrapping is not done in this primitive) // +// - ECDHDecrypt for decryption of data for a given cek and returning decrypted plaintext // // Example: // -// package main -// -// import ( -// "bytes" -// -// "github.com/google/tink/go/keyset" -// -// "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite" -// "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh" -// ) -// -// func main() { -// // create recipient side keyset handle -// recKH, err := keyset.NewHandle(ecdh.NISTP256ECDHKWKeyTemplate()) -// if err != nil { -// //handle error -// } -// -// // extract recipient public keyset handle and key -// recPubKH, err := recKH.Public() -// if err != nil { -// //handle error -// } -// -// buf := new(bytes.Buffer) -// pubKeyWriter := ecdh.NewWriter(buf) -// err = recPubKH.WriteWithNoSecrets(pubKeyWriter) -// if err != nil { -// //handle error -// } -// // ecPubKey represents a recipient public key that can be used to wrap cek -// ecPubKey := new(composite.VerificationMethod) -// err := json.Unmarshal(buf.Bytes(), ecPubKey) -// -// // see pkg/crypto/tinkcrypto to see how you can wrap a shared secret (cek) -// -// // once a cek is created create an ECDH KH that can be used to encrypt plaintext as follows -// // for AES256GCM content encryption using a NIST P key for cek wrapping as an example -// kt := ecdh.KeyTemplateForECDHPrimitiveWithCEK(cek, true, ecdh.AES256GCM) -// -// kh, err := keyset.NewHandle(kt) -// if err != nil { -// // handle error -// } -// -// pubKH, err := kh.Public() -// if err != nil { -// // handle error -// } -// -// // finally get the encryption primitive from the public key handle created above -// e:= ecdh.NewECDHEncrypt(pubKH) -// -// // and now encrypt using e -// ct, err = e.Encrypt([]byte("secret message"), []byte("some aad")) -// if err != nil { -// // handle error -// } -// -// // to decrypt, recreate kh for the cek (once unwrapped from pkg/crypto) -// // for AES256GCM content encryption using a NIST P key for cek wrapping to match the encryption template above -// kt = ecdh.KeyTemplateForECDHPrimitiveWithCEK(cek, true, ecdh.AES256GCM) -// -// kh, err = keyset.NewHandle(kt) -// if err != nil { -// // handle error -// } -// -// // get the decryption primtive for kh -// d := ecdh.NewECDHDecrypt(kh) -// -// // and decrypt -// pt, err := d.Decrypt(ct) -// if err != nil { -// // handle error -// } -// } +// package main +// +// import ( +// "bytes" +// +// "github.com/google/tink/go/keyset" +// +// "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite" +// "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/ecdh" +// ) +// +// func main() { +// // create recipient side keyset handle +// recKH, err := keyset.NewHandle(ecdh.NISTP256ECDHKWKeyTemplate()) +// if err != nil { +// //handle error +// } +// +// // extract recipient public keyset handle and key +// recPubKH, err := recKH.Public() +// if err != nil { +// //handle error +// } +// +// buf := new(bytes.Buffer) +// pubKeyWriter := ecdh.NewWriter(buf) +// err = recPubKH.WriteWithNoSecrets(pubKeyWriter) +// if err != nil { +// //handle error +// } +// // ecPubKey represents a recipient public key that can be used to wrap cek +// ecPubKey := new(composite.VerificationMethod) +// err := json.Unmarshal(buf.Bytes(), ecPubKey) +// +// // see pkg/crypto/tinkcrypto to see how you can wrap a shared secret (cek) +// +// // once a cek is created create an ECDH KH that can be used to encrypt plaintext as follows +// // for AES256GCM content encryption using a NIST P key for cek wrapping as an example +// kt := ecdh.KeyTemplateForECDHPrimitiveWithCEK(cek, true, ecdh.AES256GCM) +// +// kh, err := keyset.NewHandle(kt) +// if err != nil { +// // handle error +// } +// +// pubKH, err := kh.Public() +// if err != nil { +// // handle error +// } +// +// // finally get the encryption primitive from the public key handle created above +// e:= ecdh.NewECDHEncrypt(pubKH) +// +// // and now encrypt using e +// ct, err = e.Encrypt([]byte("secret message"), []byte("some aad")) +// if err != nil { +// // handle error +// } +// +// // to decrypt, recreate kh for the cek (once unwrapped from pkg/crypto) +// // for AES256GCM content encryption using a NIST P key for cek wrapping to match the encryption template above +// kt = ecdh.KeyTemplateForECDHPrimitiveWithCEK(cek, true, ecdh.AES256GCM) +// +// kh, err = keyset.NewHandle(kt) +// if err != nil { +// // handle error +// } +// +// // get the decryption primtive for kh +// d := ecdh.NewECDHDecrypt(kh) +// +// // and decrypt +// pt, err := d.Decrypt(ct) +// if err != nil { +// // handle error +// } +// } package ecdh import ( diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_decrypt_factory.go b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_decrypt_factory.go index bac6c63ac..a29699993 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_decrypt_factory.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_decrypt_factory.go @@ -15,7 +15,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/composite/api" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/api" ) // NewECDHDecrypt returns an CompositeDecrypt primitive from the given keyset handle. diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_encrypt_factory.go b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_encrypt_factory.go index 52d1056fa..5128eea00 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_encrypt_factory.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_encrypt_factory.go @@ -14,7 +14,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/composite/api" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/api" ) // NewECDHEncrypt returns an CompositeEncrypt primitive from the given keyset handle. diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_factory_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_factory_test.go index bdb9b6b7a..72ea7c173 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_factory_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_factory_test.go @@ -27,10 +27,10 @@ import ( "github.com/google/tink/go/testutil" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/util/cryptoutil" + "github.com/trustbloc/kms-go/util/cryptoutil" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite" - 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" + ecdhpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" ) func TestECDHESFactory(t *testing.T) { diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_key_template.go b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_key_template.go index cfdbf4c59..dedc6d867 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_key_template.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_key_template.go @@ -12,9 +12,9 @@ import ( commonpb "github.com/google/tink/go/proto/common_go_proto" tinkpb "github.com/google/tink/go/proto/tink_go_proto" - cbcaead "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" - ecdhpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" + cbcaead "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead/subtle" + ecdhpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" ) // AEADAlg represents the AEAD implementation algorithm used by ECDH. @@ -49,7 +49,8 @@ var EncryptionAlgLabel = map[AEADAlg]string{ //nolint:gochecknoglobals // encryption. CEK wrapping is done outside of this Tink key (in the tinkcrypto service). // Keys from this template represent a valid recipient public/private key pairs and can be stored in the KMS. The // recipient key represented in this key template uses the following key wrapping curve: -// - NIST curve P-256. +// - NIST curve P-256. +// // Keys created with this template are mainly used for key wrapping of a cek. They are independent of the AEAD content // encryption algorithm. func NISTP256ECDHKWKeyTemplate() *tinkpb.KeyTemplate { @@ -61,7 +62,8 @@ func NISTP256ECDHKWKeyTemplate() *tinkpb.KeyTemplate { // encryption. CEK wrapping is done outside of this Tink key (in the tinkcrypto service). // Keys from this template represent a valid recipient public/private key pairs and can be stored in the KMS. The // recipient key represented in this key template uses the following key wrapping curve: -// - NIST curve P-384 +// - NIST curve P-384 +// // Keys created with this template are mainly used for key wrapping of a cek. They are independent of the AEAD content // encryption algorithm. func NISTP384ECDHKWKeyTemplate() *tinkpb.KeyTemplate { @@ -73,7 +75,8 @@ func NISTP384ECDHKWKeyTemplate() *tinkpb.KeyTemplate { // encryption. CEK wrapping is done outside of this Tink key (in the tinkcrypto service). // Keys from this template represent a valid recipient public/private key pairs and can be stored in the KMS. The // recipient key represented in this key template uses the following key wrapping curve: -// - NIST curve P-521 +// - NIST curve P-521 +// // Keys created with this template are mainly used for key wrapping of a cek. They are independent of the AEAD content // encryption algorithm. func NISTP521ECDHKWKeyTemplate() *tinkpb.KeyTemplate { @@ -85,7 +88,8 @@ func NISTP521ECDHKWKeyTemplate() *tinkpb.KeyTemplate { // encryption. CEK wrapping is done outside of this Tink key (in the tinkcrypto service). // Keys from this template represent a valid recipient public/private key pairs and can be stored in the KMS.The // recipient key represented in this key template uses the following key wrapping curve: -// - Curve25519 +// - Curve25519 +// // Keys created with this template are mainly used for key wrapping of a cek. They are independent of the AEAD content // encryption algorithm. func X25519ECDHKWKeyTemplate() *tinkpb.KeyTemplate { @@ -99,7 +103,8 @@ func X25519ECDHKWKeyTemplate() *tinkpb.KeyTemplate { // Keys from this template offer valid CompositeEncrypt primitive execution only and should not be stored in the KMS. // The key created from this template has no recipient key info linked to it. It is exclusively used for primitive // execution using content encryption. Available content encryption algorithms: -// - AES256GCM, XChacaha20Poly1305, AES128CBC+HMAC256, AES192CBC+HMAC384, AES256CBC+HMAC384, AES256CBC+HMAC512 +// - AES256GCM, XChacaha20Poly1305, AES128CBC+HMAC256, AES192CBC+HMAC384, AES256CBC+HMAC384, AES256CBC+HMAC512 +// // It works with both key wrapping modes (executed outside of the key primitive created by this template): // NIST P kw or XC20P kw // cek should be of size: @@ -114,8 +119,8 @@ func KeyTemplateForECDHPrimitiveWithCEK(cek []byte, nistpKW bool, encAlg AEADAlg } // createKeyTemplate creates a new ECDH-AEAD key template with the set cek for primitive execution. Boolean flag used: -// - nistpKW flag to state if kw is either NIST P curves (true) or Curve25519 (false) -// - encAlg + cek to determine the the nested AEAD key template to use +// - nistpKW flag to state if kw is either NIST P curves (true) or Curve25519 (false) +// - encAlg + cek to determine the the nested AEAD key template to use func createKeyTemplate(nistpKW bool, encAlg AEADAlg, c commonpb.EllipticCurveType, cek []byte) *tinkpb.KeyTemplate { typeURL, keyType, encTemplate := getTypeParams(nistpKW, encAlg, cek) diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_key_template_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_key_template_test.go index 3dd1e9300..b0a46c025 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_key_template_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_key_template_test.go @@ -15,7 +15,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 TestECDHESKeyTemplateSuccess(t *testing.T) { diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_nistpkw_private_key_manager.go b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_nistpkw_private_key_manager.go index a9e1301e9..e3b71b262 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_nistpkw_private_key_manager.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_nistpkw_private_key_manager.go @@ -17,9 +17,9 @@ import ( tinkpb "github.com/google/tink/go/proto/tink_go_proto" "google.golang.org/protobuf/proto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/subtle" - 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" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/ecdh/subtle" + ecdhpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" ) const ( diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_nistpkw_private_key_manager_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_nistpkw_private_key_manager_test.go index c7ab06a84..5d327fb86 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_nistpkw_private_key_manager_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_nistpkw_private_key_manager_test.go @@ -21,9 +21,9 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/protobuf/proto" - cbcaead "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite" - ecdhpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" + cbcaead "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite" + ecdhpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" ) func TestECDHNISTPAESPrivateKeyManager_Primitive(t *testing.T) { diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_nistpkw_public_key_manager.go b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_nistpkw_public_key_manager.go index 6dbe1a59c..c3e0d050d 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_nistpkw_public_key_manager.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_nistpkw_public_key_manager.go @@ -16,9 +16,9 @@ import ( tinkpb "github.com/google/tink/go/proto/tink_go_proto" "google.golang.org/protobuf/proto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/subtle" - 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" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/ecdh/subtle" + ecdhpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" ) const ( diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_nistpkw_public_key_manager_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_nistpkw_public_key_manager_test.go index 47a2cb24c..2b346eed2 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_nistpkw_public_key_manager_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_nistpkw_public_key_manager_test.go @@ -20,9 +20,9 @@ import ( tinkpb "github.com/google/tink/go/proto/tink_go_proto" "github.com/stretchr/testify/require" - cbcaead "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite" - ecdhpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" + cbcaead "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite" + ecdhpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" ) func TestECDHNISTPAESPublicKeyManager_Primitive(t *testing.T) { diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_x25519kw_private_key_manager.go b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_x25519kw_private_key_manager.go index 4ec273764..1a3d6bcb4 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_x25519kw_private_key_manager.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_x25519kw_private_key_manager.go @@ -18,11 +18,11 @@ import ( tinkpb "github.com/google/tink/go/proto/tink_go_proto" "google.golang.org/protobuf/proto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/util/cryptoutil" + "github.com/trustbloc/kms-go/util/cryptoutil" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/subtle" - 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" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/ecdh/subtle" + ecdhpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" ) const ( diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_x25519kw_private_key_manager_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_x25519kw_private_key_manager_test.go index 9c32f4b3f..7520bfce1 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_x25519kw_private_key_manager_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_x25519kw_private_key_manager_test.go @@ -18,10 +18,10 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/protobuf/proto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/util/cryptoutil" + "github.com/trustbloc/kms-go/util/cryptoutil" - cbcaead "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead" - ecdhpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" + cbcaead "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead" + ecdhpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" ) func TestECDHX25519XChachaPrivateKeyManager_Primitive(t *testing.T) { diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_x25519kw_public_key_manager.go b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_x25519kw_public_key_manager.go index 824924bdf..3cd2cbde2 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_x25519kw_public_key_manager.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_x25519kw_public_key_manager.go @@ -15,9 +15,9 @@ import ( tinkpb "github.com/google/tink/go/proto/tink_go_proto" "google.golang.org/protobuf/proto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/subtle" - 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" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/ecdh/subtle" + ecdhpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" ) const ( diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_x25519kw_public_key_manager_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_x25519kw_public_key_manager_test.go index ac98da39c..4923885f8 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_x25519kw_public_key_manager_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_x25519kw_public_key_manager_test.go @@ -18,10 +18,10 @@ import ( tinkpb "github.com/google/tink/go/proto/tink_go_proto" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/util/cryptoutil" + "github.com/trustbloc/kms-go/util/cryptoutil" - cbcaead "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead" - ecdhpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" + cbcaead "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead" + ecdhpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" ) func TestECDHX25519XChachaPublicKeyManager_Primitive(t *testing.T) { diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/subtle/ecdh_aes_aead_composite_decrypt.go b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/subtle/ecdh_aes_aead_composite_decrypt.go index cb2640928..9c9e4280a 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/subtle/ecdh_aes_aead_composite_decrypt.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/subtle/ecdh_aes_aead_composite_decrypt.go @@ -10,7 +10,7 @@ import ( "encoding/json" "fmt" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite" ) // package subtle provides the core crypto primitives to be used by ECDH composite primitives. It is intended for diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/subtle/ecdh_aes_aead_composite_encrypt.go b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/subtle/ecdh_aes_aead_composite_encrypt.go index 1e2542f8c..18d46cc9d 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/subtle/ecdh_aes_aead_composite_encrypt.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/subtle/ecdh_aes_aead_composite_encrypt.go @@ -9,8 +9,8 @@ package subtle import ( "fmt" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/api" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/api" ) // ECDHAEADCompositeEncrypt is an instance of ECDH-ES encryption with Concat KDF diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/subtle/ecdh_aes_aead_composite_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/subtle/ecdh_aes_aead_composite_test.go index 532e17da7..7f7c76c7f 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/subtle/ecdh_aes_aead_composite_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/subtle/ecdh_aes_aead_composite_test.go @@ -20,7 +20,7 @@ import ( "github.com/google/tink/go/tink" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite" ) func TestEncryptDecrypt(t *testing.T) { diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/keyio/composite_key_export.go b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/keyio/composite_key_export.go index 6c25728a2..0c5cae4ad 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/keyio/composite_key_export.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/keyio/composite_key_export.go @@ -26,9 +26,9 @@ import ( cryptoapi "github.com/hyperledger/aries-framework-go/spi/crypto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh" - 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" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/ecdh" + ecdhpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" ) // Package keyio supports exporting of Composite keys (aka Write) and converting the public key part of the a composite diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/keyio/composite_key_export_import_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/keyio/composite_key_export_import_test.go index 43f5c9681..6ed15f2f4 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/keyio/composite_key_export_import_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/keyio/composite_key_export_import_test.go @@ -28,8 +28,8 @@ import ( cryptoapi "github.com/hyperledger/aries-framework-go/spi/crypto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh" - 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" + ecdhpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" ) func TestPubKeyExport(t *testing.T) { diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/register_ecdh_aead_enc_helper.go b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/register_ecdh_aead_enc_helper.go index 708d3b50f..0235731e5 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/register_ecdh_aead_enc_helper.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/register_ecdh_aead_enc_helper.go @@ -22,8 +22,8 @@ import ( "golang.org/x/crypto/poly1305" "google.golang.org/protobuf/proto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead/subtle" - cbchmacpb "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" + cbchmacpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/aes_cbc_hmac_aead_go_proto" ) const ( @@ -51,6 +51,7 @@ type RegisterCompositeAEADEncHelper struct { var _ EncrypterHelper = (*RegisterCompositeAEADEncHelper)(nil) // NewRegisterCompositeAEADEncHelper initializes and returns a RegisterCompositeAEADEncHelper. +// //nolint:gocyclo func NewRegisterCompositeAEADEncHelper(k *tinkpb.KeyTemplate) (*RegisterCompositeAEADEncHelper, error) { var ( diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/register_ecdh_aead_enc_helper_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/register_ecdh_aead_enc_helper_test.go index 837ae681c..8644825b5 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/composite/register_ecdh_aead_enc_helper_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/composite/register_ecdh_aead_enc_helper_test.go @@ -23,9 +23,9 @@ import ( "golang.org/x/crypto/chacha20poly1305" "golang.org/x/crypto/poly1305" - cbchmacaead "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead" - subtlecbchmacaead "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead/subtle" - aeadpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/aes_cbc_hmac_aead_go_proto" + cbchmacaead "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead" + subtlecbchmacaead "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" ) func newKeyTemplates() ([]*tinkpb.KeyTemplate, []int) { diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/proto/aes_cbc_hmac_aead_go_proto/aes_cbc_hmac_aead.pb.go b/component/kmscrypto/crypto/tinkcrypto/primitive/proto/aes_cbc_hmac_aead_go_proto/aes_cbc_hmac_aead.pb.go index c8a518e98..f3280c1d0 100755 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/proto/aes_cbc_hmac_aead_go_proto/aes_cbc_hmac_aead.pb.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/proto/aes_cbc_hmac_aead_go_proto/aes_cbc_hmac_aead.pb.go @@ -15,7 +15,7 @@ import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - aes_cbc_go_proto "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/aes_cbc_go_proto" + aes_cbc_go_proto "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/aes_cbc_go_proto" ) const ( diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/secp256k1_key_templates.go b/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/secp256k1_key_templates.go index 917fa43e3..6a03b527c 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/secp256k1_key_templates.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/secp256k1_key_templates.go @@ -11,7 +11,7 @@ import ( commonpb "github.com/google/tink/go/proto/common_go_proto" tinkpb "github.com/google/tink/go/proto/tink_go_proto" - secp256k1pb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/secp256k1_go_proto" + secp256k1pb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/secp256k1_go_proto" ) // This file contains pre-generated KeyTemplates for Signer and Verifier. diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/secp256k1_key_templates_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/secp256k1_key_templates_test.go index 8c360d60c..0401895cf 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/secp256k1_key_templates_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/secp256k1_key_templates_test.go @@ -14,7 +14,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/secp256k1" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/secp256k1" ) func TestKeyTemplates(t *testing.T) { diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/secp256k1_signer_key_manager.go b/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/secp256k1_signer_key_manager.go index dc857e7c8..2c2999e1b 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/secp256k1_signer_key_manager.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/secp256k1_signer_key_manager.go @@ -18,8 +18,8 @@ import ( tinkpb "github.com/google/tink/go/proto/tink_go_proto" "google.golang.org/protobuf/proto" - secp256k1pb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/secp256k1_go_proto" - subtleSignature "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/subtle" + secp256k1pb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/secp256k1_go_proto" + subtleSignature "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/secp256k1/subtle" ) const ( diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/secp256k1_signer_key_manager_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/secp256k1_signer_key_manager_test.go index a134f9ee9..e2e31e3f7 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/secp256k1_signer_key_manager_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/secp256k1_signer_key_manager_test.go @@ -20,8 +20,8 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/protobuf/proto" - secp256k1pb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/secp256k1_go_proto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/subtle" + secp256k1pb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/secp256k1_go_proto" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/secp256k1/subtle" ) const ( diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/secp256k1_verifier_key_manager.go b/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/secp256k1_verifier_key_manager.go index 24dc3df6a..bc642d152 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/secp256k1_verifier_key_manager.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/secp256k1_verifier_key_manager.go @@ -13,8 +13,8 @@ import ( tinkpb "github.com/google/tink/go/proto/tink_go_proto" "google.golang.org/protobuf/proto" - secp256k1pb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/secp256k1_go_proto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/subtle" + secp256k1pb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/secp256k1_go_proto" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/secp256k1/subtle" ) const ( diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/secp256k1_verifier_key_manager_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/secp256k1_verifier_key_manager_test.go index 7841bf969..d49483e2a 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/secp256k1_verifier_key_manager_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/secp256k1_verifier_key_manager_test.go @@ -15,7 +15,7 @@ import ( "github.com/google/tink/go/testutil" "github.com/stretchr/testify/require" - secp256k1pb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/secp256k1_go_proto" + secp256k1pb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/secp256k1_go_proto" ) const secp256k1VerifierTypeURL = "type.googleapis.com/google.crypto.tink.secp256k1PublicKey" diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/subtle/secp256k1.go b/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/subtle/secp256k1.go index 09799cdbe..e024c4f5d 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/subtle/secp256k1.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/subtle/secp256k1.go @@ -14,7 +14,7 @@ import ( "github.com/btcsuite/btcd/btcec" - secp256k1pb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/secp256k1_go_proto" + secp256k1pb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/secp256k1_go_proto" ) var errUnsupportedEncoding = errors.New("secp256k1: unsupported encoding") diff --git a/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/subtle/secp256k1_signer_verifier_test.go b/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/subtle/secp256k1_signer_verifier_test.go index 49875c827..fa8156970 100644 --- a/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/subtle/secp256k1_signer_verifier_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/subtle/secp256k1_signer_verifier_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/tink/go/subtle/random" "github.com/stretchr/testify/require" - subtleSignature "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/subtle" + subtleSignature "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/secp256k1/subtle" ) func TestSignVerify(t *testing.T) { diff --git a/component/kmscrypto/crypto/tinkcrypto/unwrap_support.go b/component/kmscrypto/crypto/tinkcrypto/unwrap_support.go index e486db6fe..3a497dc43 100644 --- a/component/kmscrypto/crypto/tinkcrypto/unwrap_support.go +++ b/component/kmscrypto/crypto/tinkcrypto/unwrap_support.go @@ -20,7 +20,7 @@ import ( commonpb "github.com/google/tink/go/proto/common_go_proto" tinkpb "github.com/google/tink/go/proto/tink_go_proto" - ecdhpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" + ecdhpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" ) func extractPrivKey(kh *keyset.Handle) (interface{}, error) { diff --git a/component/kmscrypto/crypto/tinkcrypto/unwrap_support_test.go b/component/kmscrypto/crypto/tinkcrypto/unwrap_support_test.go index 3781a1f97..20644d740 100644 --- a/component/kmscrypto/crypto/tinkcrypto/unwrap_support_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/unwrap_support_test.go @@ -23,9 +23,9 @@ import ( "github.com/google/tink/go/testutil" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/util/cryptoutil" + "github.com/trustbloc/kms-go/util/cryptoutil" - ecdhpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" + ecdhpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" ) func Test_ExtractPrivKey(t *testing.T) { diff --git a/component/kmscrypto/crypto/tinkcrypto/withkms_test.go b/component/kmscrypto/crypto/tinkcrypto/withkms_test.go index 4bd6c9d8e..8afd0fa9b 100644 --- a/component/kmscrypto/crypto/tinkcrypto/withkms_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/withkms_test.go @@ -11,17 +11,17 @@ import ( "github.com/stretchr/testify/require" - mockstorage "github.com/hyperledger/aries-framework-go/component/kmscrypto/internal/mock/storage" + mockstorage "github.com/trustbloc/kms-go/internal/mock/storage" kmsapi "github.com/hyperledger/aries-framework-go/spi/kms" "github.com/hyperledger/aries-framework-go/spi/secretlock" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/jwkkid" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms/localkms" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/secretlock/noop" + "github.com/trustbloc/kms-go/crypto/tinkcrypto" + "github.com/trustbloc/kms-go/doc/util/jwkkid" + "github.com/trustbloc/kms-go/kms" + "github.com/trustbloc/kms-go/kms/localkms" + "github.com/trustbloc/kms-go/secretlock/noop" ) type kmsProvider struct { diff --git a/component/kmscrypto/crypto/tinkcrypto/wrap_support.go b/component/kmscrypto/crypto/tinkcrypto/wrap_support.go index 530e46c95..2d4dff84e 100644 --- a/component/kmscrypto/crypto/tinkcrypto/wrap_support.go +++ b/component/kmscrypto/crypto/tinkcrypto/wrap_support.go @@ -22,9 +22,9 @@ import ( hybrid "github.com/google/tink/go/hybrid/subtle" "golang.org/x/crypto/chacha20poly1305" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/util/cryptoutil" + "github.com/trustbloc/kms-go/util/cryptoutil" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead/subtle" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead/subtle" ) type keyWrapper interface { diff --git a/component/kmscrypto/crypto/tinkcrypto/wrap_support_test.go b/component/kmscrypto/crypto/tinkcrypto/wrap_support_test.go index 7fd9ea6c1..394acb98e 100644 --- a/component/kmscrypto/crypto/tinkcrypto/wrap_support_test.go +++ b/component/kmscrypto/crypto/tinkcrypto/wrap_support_test.go @@ -19,7 +19,7 @@ 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" ) func Test_ecKWSupportFailures(t *testing.T) { diff --git a/component/kmscrypto/crypto/webkms/cl_remotecrypto_test.go b/component/kmscrypto/crypto/webkms/cl_remotecrypto_test.go index dcdcbe96b..1bc32de59 100644 --- a/component/kmscrypto/crypto/webkms/cl_remotecrypto_test.go +++ b/component/kmscrypto/crypto/webkms/cl_remotecrypto_test.go @@ -22,9 +22,9 @@ 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" - webkmsimpl "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms/webkms" + bld "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/blinder" + sgn "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/signer" + webkmsimpl "github.com/trustbloc/kms-go/kms/webkms" ) func TestClMethods(t *testing.T) { diff --git a/component/kmscrypto/crypto/webkms/remotecrypto.go b/component/kmscrypto/crypto/webkms/remotecrypto.go index d5a0d6141..b27c4c87c 100644 --- a/component/kmscrypto/crypto/webkms/remotecrypto.go +++ b/component/kmscrypto/crypto/webkms/remotecrypto.go @@ -25,8 +25,9 @@ import ( "github.com/hyperledger/aries-framework-go/component/log" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/keyio" - webkmsimpl "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms/webkms" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/keyio" + webkmsimpl "github.com/trustbloc/kms-go/kms/webkms" + spi "github.com/hyperledger/aries-framework-go/spi/log" ) diff --git a/component/kmscrypto/crypto/webkms/remotecrypto_test.go b/component/kmscrypto/crypto/webkms/remotecrypto_test.go index 9496ae5fd..001e32878 100644 --- a/component/kmscrypto/crypto/webkms/remotecrypto_test.go +++ b/component/kmscrypto/crypto/webkms/remotecrypto_test.go @@ -36,11 +36,11 @@ import ( cryptoapi "github.com/hyperledger/aries-framework-go/spi/crypto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto" - "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/kms/localkms" - webkmsimpl "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms/webkms" + "github.com/trustbloc/kms-go/crypto/tinkcrypto" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/bbs" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/ecdh" + "github.com/trustbloc/kms-go/kms/localkms" + webkmsimpl "github.com/trustbloc/kms-go/kms/webkms" ) const ( diff --git a/component/kmscrypto/doc/jose/common.go b/component/kmscrypto/doc/jose/common.go index e902cedf1..37a6ec336 100644 --- a/component/kmscrypto/doc/jose/common.go +++ b/component/kmscrypto/doc/jose/common.go @@ -7,8 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package jose import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/ecdh" + "github.com/trustbloc/kms-go/doc/jose/jwk" ) // IANA registered JOSE headers (https://tools.ietf.org/html/rfc7515#section-4.1) diff --git a/component/kmscrypto/doc/jose/common_test.go b/component/kmscrypto/doc/jose/common_test.go index dbdf6ca1d..a8cbe18b7 100644 --- a/component/kmscrypto/doc/jose/common_test.go +++ b/component/kmscrypto/doc/jose/common_test.go @@ -14,7 +14,7 @@ import ( "github.com/go-jose/go-jose/v3" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" + "github.com/trustbloc/kms-go/doc/jose/jwk" ) func TestHeaders_GetJWK(t *testing.T) { diff --git a/component/kmscrypto/doc/jose/decrypter.go b/component/kmscrypto/doc/jose/decrypter.go index 71924b7bb..4403be564 100644 --- a/component/kmscrypto/doc/jose/decrypter.go +++ b/component/kmscrypto/doc/jose/decrypter.go @@ -15,13 +15,14 @@ import ( "github.com/google/tink/go/keyset" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/api" - "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/doc/jose/jwk" - resolver "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/kidresolver" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/api" + "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/doc/jose/jwk" + resolver "github.com/trustbloc/kms-go/doc/jose/kidresolver" + cryptoapi "github.com/hyperledger/aries-framework-go/spi/crypto" "github.com/hyperledger/aries-framework-go/spi/kms" ) diff --git a/component/kmscrypto/doc/jose/encrypt_test.go b/component/kmscrypto/doc/jose/encrypt_test.go index 5066492e7..2af16f73e 100644 --- a/component/kmscrypto/doc/jose/encrypt_test.go +++ b/component/kmscrypto/doc/jose/encrypt_test.go @@ -18,9 +18,10 @@ import ( "github.com/google/tink/go/keyset" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto" - "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" + "github.com/trustbloc/kms-go/crypto/tinkcrypto" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/ecdh" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/keyio" + cryptoapi "github.com/hyperledger/aries-framework-go/spi/crypto" ) diff --git a/component/kmscrypto/doc/jose/encrypter.go b/component/kmscrypto/doc/jose/encrypter.go index 8a278de56..370afb51d 100644 --- a/component/kmscrypto/doc/jose/encrypter.go +++ b/component/kmscrypto/doc/jose/encrypter.go @@ -26,14 +26,15 @@ import ( "github.com/google/tink/go/subtle/random" "golang.org/x/crypto/curve25519" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto" - "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" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/api" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh" - 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/doc/jose/jwk" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/util/cryptoutil" + "github.com/trustbloc/kms-go/crypto/tinkcrypto" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead/subtle" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/api" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/ecdh" + ecdhpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" + "github.com/trustbloc/kms-go/doc/jose/jwk" + "github.com/trustbloc/kms-go/util/cryptoutil" + cryptoapi "github.com/hyperledger/aries-framework-go/spi/crypto" ) diff --git a/component/kmscrypto/doc/jose/encrypter_decrypter_test.go b/component/kmscrypto/doc/jose/encrypter_decrypter_test.go index 34d5f5088..f8f13274d 100644 --- a/component/kmscrypto/doc/jose/encrypter_decrypter_test.go +++ b/component/kmscrypto/doc/jose/encrypter_decrypter_test.go @@ -28,16 +28,17 @@ import ( "github.com/google/tink/go/subtle" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto" - "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" - ariesjose "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" - resolver "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/kidresolver" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/jwkkid" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/kmsdidkey" - mockkms "github.com/hyperledger/aries-framework-go/component/kmscrypto/mock/kms" + "github.com/trustbloc/kms-go/crypto/tinkcrypto" + "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" + ariesjose "github.com/trustbloc/kms-go/doc/jose" + "github.com/trustbloc/kms-go/doc/jose/jwk" + resolver "github.com/trustbloc/kms-go/doc/jose/kidresolver" + "github.com/trustbloc/kms-go/doc/util/jwkkid" + "github.com/trustbloc/kms-go/doc/util/kmsdidkey" + mockkms "github.com/trustbloc/kms-go/mock/kms" + mockstorage "github.com/hyperledger/aries-framework-go/component/storageutil/mock/storage" cryptoapi "github.com/hyperledger/aries-framework-go/spi/crypto" "github.com/hyperledger/aries-framework-go/spi/kms" diff --git a/component/kmscrypto/doc/jose/jwk/jwk.go b/component/kmscrypto/doc/jose/jwk/jwk.go index e8904b9e6..c91db6f66 100644 --- a/component/kmscrypto/doc/jose/jwk/jwk.go +++ b/component/kmscrypto/doc/jose/jwk/jwk.go @@ -22,11 +22,9 @@ import ( "github.com/go-jose/go-jose/v3" "golang.org/x/crypto/ed25519" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/util/cryptoutil" - - "github.com/hyperledger/aries-framework-go/spi/kms" - - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" + "github.com/trustbloc/kms-go/crypto/primitive/bbs12381g2pub" + "github.com/trustbloc/kms-go/spi/kms" + "github.com/trustbloc/kms-go/util/cryptoutil" ) const ( diff --git a/component/kmscrypto/doc/jose/jwk/jwk_test.go b/component/kmscrypto/doc/jose/jwk/jwk_test.go deleted file mode 100644 index 1c8640a63..000000000 --- a/component/kmscrypto/doc/jose/jwk/jwk_test.go +++ /dev/null @@ -1,545 +0,0 @@ -/* -Copyright SecureKey Technologies Inc. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ - -package jwk - -import ( - "crypto/ecdsa" - "crypto/elliptic" - "crypto/rand" - "crypto/sha256" - "fmt" - "testing" - - "github.com/btcsuite/btcd/btcec" - "github.com/go-jose/go-jose/v3" - "github.com/go-jose/go-jose/v3/json" - "github.com/stretchr/testify/require" - - "github.com/hyperledger/aries-framework-go/spi/kms" - - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" -) - -func TestDecodePublicKey(t *testing.T) { - t.Run("Test decode public key failure", func(t *testing.T) { - tests := []struct { - name string - jwkJSON string - err string - }{ - { - name: "attempt public key bytes from invalid JSON bytes", - jwkJSON: `}`, - err: "invalid character", - }, - { - name: "attempt public key bytes from invalid curve", - jwkJSON: `{ - "kty": "EC", - "use": "enc", - "crv": "sec12341", - "kid": "sample@sample.id", - "x": "wQehEGTVCu32yp8IwTaBCqPUIYslyd-WoFRsfDKE9II", - "y": "rIJO8RmkExUecJ5i15L9OC7rl7pwmYFR8QQgdM1ERWI", - "alg": "ES256" - }`, - err: "unsupported elliptic curve 'sec12341'", - }, - { - name: "attempt public key bytes from invalid JSON bytes", - jwkJSON: `{ - "kty": "EC", - "use": "enc", - "crv": "secp256k1", - "kid": "sample@sample.id", - "x": "", - "y": "", - "alg": "ES256" - }`, - err: "unable to read JWK: invalid JWK", - }, - { - name: "attempt public key bytes from invalid JSON bytes", - jwkJSON: `{ - "kty": "EC", - "use": "enc", - "crv": "secp256k1", - "kid": "sample@sample.id", - "x": "wQehEGTVCu32yp8IwTaBCqPUIYslyd-WoFRsfDKE9II", - "y": "", - "alg": "ES256" - }`, - err: "unable to read JWK: invalid JWK", - }, - { - name: "attempt public key bytes from invalid JSON bytes", - jwkJSON: `{ - "kty": "EC", - "use": "enc", - "crv": "secp256k1", - "kid": "sample@sample.id", - "x": "x", - "y": "y", - "alg": "ES256" - }`, - err: "unable to read JWK", - }, - { - name: "X is not defined", - jwkJSON: `{ - "kty": "EC", - "use": "enc", - "crv": "secp256k1", - "kid": "sample@sample.id", - "y": "rIJO8RmkExUecJ5i15L9OC7rl7pwmYFR8QQgdM1ERWI", - "alg": "ES256" - }`, - err: "invalid JWK", - }, - { - name: "X is not defined X25519", - jwkJSON: `{ - "kty": "OKP", - "use": "enc", - "crv": "X25519", - "kid": "sample@sample.id" - }`, - err: "invalid JWK", - }, - { - name: "Y is not defined", - jwkJSON: `{ - "kty": "EC", - "use": "enc", - "crv": "secp256k1", - "kid": "sample@sample.id", - "x": "wQehEGTVCu32yp8IwTaBCqPUIYslyd-WoFRsfDKE9II", - "alg": "ES256" - }`, - err: "invalid JWK", - }, - { - name: "D is not defined", - jwkJSON: `{ - "kty": "EC", - "use": "enc", - "crv": "secp256k1", - "kid": "sample@sample.id", - "x": "wQehEGTVCu32yp8IwTaBCqPUIYslyd-WoFRsfDKE9II", - "y": "rIJO8RmkExUecJ5i15L9OC7rl7pwmYFR8QQgdM1ERWI", - "d": "", - "alg": "ES256" - }`, - err: "invalid JWK", - }, - { - name: "Y is not defined", - jwkJSON: `{ - "kty": "EC", - "use": "enc", - "crv": "secp256k1", - "kid": "sample@sample.id", - "x": "wQehEGTVCu32yp8IwTaBCqPUIYslyd-WoFRsfDKE9II", - "y": "rIJO8RmkExUecJ5i15L9OC7rl7pwmYFR8QQgdM1ERWO", - "alg": "ES256" - }`, - err: "unable to read JWK: invalid JWK", - }, - { - name: "attempt public key bytes from invalid JSON bytes", - jwkJSON: `{ - "kty": "EC", - "use": "enc", - "crv": "secp256k1", - "kid": "sample@sample.id", - "x": "{", - "y": "y", - "alg": "ES256" - }`, - err: "unable to read JWK", - }, - { - name: "invalid X25519", - jwkJSON: `{ - "kty": "OKP", - "use": "enc", - "crv": "X25519", - "x": "wQehEGTVCu32yp8IwTaBCqPUIYslyd-WoFRsfDKE9IIrIJO8RmkExUecJ5i15L9OC7rl7pwmYFR8QQgdM1ERWO", - "kid": "sample@sample.id" - }`, - err: "unable to read X25519 JWE: invalid JWK", - }, - } - - t.Parallel() - - for _, test := range tests { - tc := test - t.Run(tc.name, func(t *testing.T) { - var j JWK - err := json.Unmarshal([]byte(tc.jwkJSON), &j) - require.Error(t, err) - require.Contains(t, err.Error(), tc.err) - }) - } - }) -} - -func TestByteBufferUnmarshalFailure(t *testing.T) { - bb := &byteBuffer{} - err := bb.UnmarshalJSON([]byte("{")) - require.Error(t, err) -} - -func TestCurveSize(t *testing.T) { - require.Equal(t, 32, curveSize(btcec.S256())) - require.Equal(t, 32, curveSize(elliptic.P256())) - require.Equal(t, 28, curveSize(elliptic.P224())) - require.Equal(t, 48, curveSize(elliptic.P384())) - require.Equal(t, 66, curveSize(elliptic.P521())) -} - -func TestJWKFromX25519KeyFailure(t *testing.T) { - key := &JWK{ - JSONWebKey: jose.JSONWebKey{ - Key: "abc", // try to create an invalid X25519 key type (string instead of []byte) - }, - } - - _, err := marshalX25519(key) - require.EqualError(t, err, "marshalX25519: invalid key") - - invalidKey := make([]byte, 10) - - n, err := rand.Read(invalidKey) - require.NoError(t, err) - require.Equal(t, 10, n) - - key.Key = invalidKey // try with key larger than X25519 key length - - _, err = marshalX25519(key) - require.EqualError(t, err, "marshalX25519: invalid key") -} - -func TestJWK_PublicKeyBytesValidation(t *testing.T) { - jwk := &JWK{ - JSONWebKey: jose.JSONWebKey{ - Key: "key of invalid type", - KeyID: "pubkey#123", - }, - } - - // unsupported public key type - pkBytes, err := jwk.PublicKeyBytes() - require.Error(t, err) - require.Contains(t, err.Error(), "unsupported public key type in kid 'pubkey#123'") - require.Empty(t, pkBytes) -} - -func TestJWK_BBSKeyValidation(t *testing.T) { - _, privateKey, err := bbs12381g2pub.GenerateKeyPair(sha256.New, nil) - require.NoError(t, err) - - jwkKey := &JWK{ - JSONWebKey: jose.JSONWebKey{ - Key: privateKey, - }, - Kty: ecKty, - Crv: bls12381G2Crv, - } - - t.Run("test MarshalJSON/UnmarshalJSON", func(t *testing.T) { - var mJWK []byte - - mJWK, err = jwkKey.MarshalJSON() - require.NoError(t, err) - - t.Logf("marshaled JWK: %s", mJWK) - - jwk2 := &JWK{} - err = jwk2.UnmarshalJSON(mJWK) - require.NoError(t, err) - require.EqualValues(t, jwkKey, jwk2) - }) - - t.Run("test BBS private key jwk.PublicKeyBytes()", func(t *testing.T) { - var pubKeyBytes []byte - - pubKeyBytes, err = jwkKey.PublicKeyBytes() - require.NoError(t, err) - require.NotEmpty(t, pubKeyBytes) - }) - - t.Run("test UnmarshalJSON of valid BBS private key JWK - with both x and d headers", func(t *testing.T) { - //nolint:lll - goodJWK := `{ - "kty":"EC", - "crv":"BLS12381_G2", - "x":"oUd1c-NsWZy2oCaST4CRW1naLjgYY3OhHgTMie4uzgrB5VuVqx0pdYf4XWWlnEkZERnpMhgo2re4tQtdCguhI4OIGyAXFaML8D6E1ZYO8B0WmysMZUnC5BWWEfOid1lu", - "d":"MhYilAbhICa8T6m0U2gLAgLvPEsF05XN1yYHZgkfAK4" -}` - - jwk4 := &JWK{} - - err = jwk4.UnmarshalJSON([]byte(goodJWK)) - require.NoError(t, err) - }) - - t.Run("test UnmarshalJSON of invalid BBS private key JWK - no x header", func(t *testing.T) { - goodJWK := `{ - "kty":"EC", - "crv":"BLS12381_G2", - "d":"MhYilAbhICa8T6m0U2gLAgLvPEsF05XN1yYHZgkfAK4" -}` - - jwk4 := &JWK{} - - err = jwk4.UnmarshalJSON([]byte(goodJWK)) - require.EqualError(t, err, "unable to read BBS+ JWE: invalid JWK") - }) - - t.Run("test UnmarshalJSON of valid BBS public key JWK", func(t *testing.T) { - //nolint:lll - goodJWK := `{ - "kty":"EC", - "crv":"BLS12381_G2", - "x":"oUd1c-NsWZy2oCaST4CRW1naLjgYY3OhHgTMie4uzgrB5VuVqx0pdYf4XWWlnEkZERnpMhgo2re4tQtdCguhI4OIGyAXFaML8D6E1ZYO8B0WmysMZUnC5BWWEfOid1lu" -}` - - jwk4 := &JWK{} - - err = jwk4.UnmarshalJSON([]byte(goodJWK)) - require.NoError(t, err) - }) - - t.Run("test UnmarshalJSON of invalid BBS public key JWK - x wrong size", func(t *testing.T) { - goodJWK := `{ - "kty":"EC", - "crv":"BLS12381_G2", - "x":"oUd1" -}` - - jwk4 := &JWK{} - - err = jwk4.UnmarshalJSON([]byte(goodJWK)) - require.EqualError(t, err, "unable to read BBS+ JWE: invalid JWK") - }) - - t.Run("test UnmarshalJSON of invalid BBS private key JWK - d wrong size", func(t *testing.T) { - //nolint:lll - goodJWK := `{ - "kty":"EC", - "crv":"BLS12381_G2", - "x":"oUd1c-NsWZy2oCaST4CRW1naLjgYY3OhHgTMie4uzgrB5VuVqx0pdYf4XWWlnEkZERnpMhgo2re4tQtdCguhI4OIGyAXFaML8D6E1ZYO8B0WmysMZUnC5BWWEfOid1lu", - "d":"MhYi" -}` - - jwk4 := &JWK{} - - err = jwk4.UnmarshalJSON([]byte(goodJWK)) - require.EqualError(t, err, "unable to read BBS+ JWE: invalid JWK") - }) - - t.Run("test UnmarshalJSON of invalid BBS public key JWK - x wrong value", func(t *testing.T) { - //nolint:lll - goodJWK := `{ - "kty":"EC", - "crv":"BLS12381_G2", - "x":"pUd1c-NsWZy2oCaST4CRW1naLjgYY3OhHgTMie4uzgrB5VuVqx0pdYf4XWWlnEkZERnpMhko2re4tQtdCguhI4OIGyAXFaML8D6E1ZYO8B0WmysMZUnC5BWWEfOhc6tv" -}` - - jwk4 := &JWK{} - - err = jwk4.UnmarshalJSON([]byte(goodJWK)) - require.EqualError(t, err, "unable to read BBS+ JWE: jwk invalid public key unmarshal: deserialize "+ - "public key: failure [set bytes failed [point is not on curve]]") - }) -} - -func TestJWK_KeyType(t *testing.T) { - t.Run("success: get KeyType from JWK", func(t *testing.T) { - testCases := []struct { - jwk string - keyType kms.KeyType - }{ - { - jwk: `{ - "kty": "OKP", - "use": "enc", - "crv": "Ed25519", - "kid": "sample@sample.id", - "x": "sEHL6KXs8bUz9Ss2qSWWjhhRMHVjrog0lzFENM132R8", - "alg": "EdDSA" - }`, - keyType: kms.ED25519Type, - }, - { - jwk: `{ - "kty": "OKP", - "use": "enc", - "crv": "X25519", - "kid": "sample@sample.id", - "x": "sEHL6KXs8bUz9Ss2qSWWjhhRMHVjrog0lzFENM132R8" - }`, - keyType: kms.X25519ECDHKWType, - }, - { - //nolint:lll - jwk: `{ - "kty": "EC", - "use": "enc", - "crv": "BLS12381_G2", - "kid": "sample@sample.id", - "x": "tKWJu0SOY7onl4tEyOOH11XBriQN2JgzV-UmjgBMSsNkcAx3_l97SVYViSDBouTVBkBfrLh33C5icDD-4UEDxNO3Wn1ijMHvn2N63DU4pkezA3kGN81jGbwbrsMPpiOF" - }`, - keyType: kms.BLS12381G2Type, - }, - { - jwk: `{ - "kty": "EC", - "use": "enc", - "crv": "secp256k1", - "kid": "sample@sample.id", - "x": "YRrvJocKf39GpdTnd-zBFE0msGDqawR-Cmtc6yKoFsM", - "y": "kE-dMH9S3mxnTXo0JFEhraCU_tVYFDfpu9tpP1LfVKQ", - "alg": "ES256K" - }`, - keyType: kms.ECDSASecp256k1TypeIEEEP1363, - }, - { - jwk: `{ - "kty": "EC", - "use": "enc", - "crv": "P-256", - "kid": "sample@sample.id", - "x": "JR7nhI47w7bxrNkp7Xt1nbmozNn-RB2Q-PWi7KHT8J0", - "y": "iXmKtH0caOgB1vV0CQwinwK999qdDvrssKhdbiAz9OI", - "alg": "ES256" - }`, - keyType: kms.ECDSAP256TypeIEEEP1363, - }, - { - jwk: `{ - "kty": "EC", - "kid": "sample@sample.id", - "crv": "P-384", - "x": "SNJT8Q-irydV5yppI-blGNuRTPf8sCYuL_tO92SLrufdlEgDll9cRuBLACrlBz2x", - "y": "zIYfra2_y2hnc35sIwA1jiDx5rKmG3mX6162HkAodTJIpUYxw2rz1qHiwVcaU2tY", - "alg": "ES384" - }`, - keyType: kms.ECDSAP384TypeIEEEP1363, - }, - { - jwk: `{ - "kty": "EC", - "kid": "sample@sample.id", - "crv": "P-521", - "d": "AfcmEHp9Nd_X005hBoKEs8bvMzIH0OMYodQUw8xRWpUGOq31cyXV1dUvX-S8uSaBIbh2w-fy_OaolBmvTe3Il5Rw", - "x": "AMIjmQpOT7oz5e8CJZQVi3cxCdF0gdmnNE8qmi5Y3_1-6gRzHoaXGs_TBcAvNgD8UCYhk3FWA8aLChJ9BjEUi44m", - "y": "AIfNzFdbyI1rfRrcY7orl3wTXT-C_kWhyWdr3K3rSS8WbwXhqg9jb29iEoE8izpCnuoJbC_FsMf2WbI_1iNomfB4", - "alg": "ES512" - }`, - keyType: kms.ECDSAP521TypeIEEEP1363, - }, - { - jwk: `{ - "kty": "RSA", - "e": "AQAB", - "use": "enc", - "kid": "sample@sample.id", - "alg": "RS256", - "n": "1hOl09BUnwY7jFBqoZKa4XDmIuc0YFb4y_5ThiHhLRW68aNG5Vo23n3ugND2GK3PsguZqJ_HrWCGVuVlKTmFg` + - `JWQD9ZnVcYqScgHpQRhxMBi86PIvXR01D_PWXZZjvTRakpvQxUT5bVBdWnaBHQoxDBt0YIVi5a7x-gXB1aDlts4RTMpfS9BPmEjX` + - `4lciozwS6Ow_wTO3C2YGa_Our0ptIxr-x_3sMbPCN8Fe_iaBDezeDAm39xCNjFa1E735ipXA4eUW_6SzFJ5-bM2UKba2WE6xUaEa5G1` + - `MDDHCG5LKKd6Mhy7SSAzPOR2FTKYj89ch2asCPlbjHTu8jS6Iy8" - }`, - keyType: kms.RSAPS256Type, - }, - } - - t.Parallel() - - for _, testCase := range testCases { - t.Run(fmt.Sprintf("KeyType %s", testCase.keyType), func(t *testing.T) { - j := JWK{} - e := j.UnmarshalJSON([]byte(testCase.jwk)) - require.NoError(t, e) - - kt, e := j.KeyType() - require.NoError(t, e) - require.Equal(t, testCase.keyType, kt) - - mJWK, err := j.MarshalJSON() - require.NoError(t, err) - require.NotEmpty(t, mJWK) - - keyBytes, err := j.PublicKeyBytes() - require.NoError(t, err) - require.NotEmpty(t, keyBytes) - }) - } - }) - - t.Run("test ed25519 with []byte key material", func(t *testing.T) { - jwkJSON := `{ - "kty": "OKP", - "use": "enc", - "crv": "Ed25519", - "kid": "sample@sample.id", - "x": "sEHL6KXs8bUz9Ss2qSWWjhhRMHVjrog0lzFENM132R8", - "alg": "EdDSA" - }` - - j := JWK{} - e := j.UnmarshalJSON([]byte(jwkJSON)) - require.NoError(t, e) - - k, err := j.PublicKeyBytes() - require.NoError(t, err) - - j.Key = k - - kt, e := j.KeyType() - require.NoError(t, e) - require.Equal(t, kms.ED25519Type, kt) - }) - - t.Run("test secp256k1 with []byte key material", func(t *testing.T) { - jwkJSON := `{ - "kty": "EC", - "use": "enc", - "crv": "secp256k1", - "kid": "sample@sample.id", - "x": "YRrvJocKf39GpdTnd-zBFE0msGDqawR-Cmtc6yKoFsM", - "y": "kE-dMH9S3mxnTXo0JFEhraCU_tVYFDfpu9tpP1LfVKQ", - "alg": "ES256K" - }` - - j := JWK{} - e := j.UnmarshalJSON([]byte(jwkJSON)) - require.NoError(t, e) - - pkb, err := j.PublicKeyBytes() - require.NoError(t, err) - - j.Key = pkb - - kt, e := j.KeyType() - require.NoError(t, e) - require.Equal(t, kms.ECDSASecp256k1TypeIEEEP1363, kt) - }) - - t.Run("fail to get ecdsa keytype for (unsupported) p-224", func(t *testing.T) { - eckey, err := ecdsa.GenerateKey(elliptic.P224(), rand.Reader) - require.NoError(t, err) - - kt, err := ecdsaPubKeyType(&eckey.PublicKey) - require.Error(t, err) - require.Contains(t, err.Error(), "no keytype recognized for ecdsa jwk") - require.Equal(t, kms.KeyType(""), kt) - }) -} diff --git a/component/kmscrypto/doc/jose/jwk/jwksupport/jwk.go b/component/kmscrypto/doc/jose/jwk/jwksupport/jwk.go index f4de1d379..5ae2beee4 100644 --- a/component/kmscrypto/doc/jose/jwk/jwksupport/jwk.go +++ b/component/kmscrypto/doc/jose/jwk/jwksupport/jwk.go @@ -18,12 +18,11 @@ import ( "github.com/go-jose/go-jose/v3" - "github.com/hyperledger/aries-framework-go/spi/kms" + "github.com/trustbloc/kms-go/spi/kms" - cryptoapi "github.com/hyperledger/aries-framework-go/spi/crypto" - - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" + "github.com/trustbloc/kms-go/crypto/primitive/bbs12381g2pub" + "github.com/trustbloc/kms-go/doc/jose/jwk" + cryptoapi "github.com/trustbloc/kms-go/spi/crypto" ) const ( diff --git a/component/kmscrypto/doc/jose/jwk/jwksupport/jwk_test.go b/component/kmscrypto/doc/jose/jwk/jwksupport/jwk_test.go index 8c9066967..a1eb9c0d0 100644 --- a/component/kmscrypto/doc/jose/jwk/jwksupport/jwk_test.go +++ b/component/kmscrypto/doc/jose/jwk/jwksupport/jwk_test.go @@ -22,14 +22,14 @@ import ( "github.com/go-jose/go-jose/v3" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/util/cryptoutil" + "github.com/trustbloc/kms-go/util/cryptoutil" "github.com/hyperledger/aries-framework-go/spi/kms" cryptoapi "github.com/hyperledger/aries-framework-go/spi/crypto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" + "github.com/trustbloc/kms-go/crypto/primitive/bbs12381g2pub" + "github.com/trustbloc/kms-go/doc/jose/jwk" ) func TestDecodeJWK(t *testing.T) { diff --git a/component/kmscrypto/doc/jose/kidresolver/resolver.go b/component/kmscrypto/doc/jose/kidresolver/resolver.go index 05faba0ae..1095bc832 100644 --- a/component/kmscrypto/doc/jose/kidresolver/resolver.go +++ b/component/kmscrypto/doc/jose/kidresolver/resolver.go @@ -10,7 +10,8 @@ import ( "encoding/json" "fmt" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/kmsdidkey" + "github.com/trustbloc/kms-go/doc/util/kmsdidkey" + cryptoapi "github.com/hyperledger/aries-framework-go/spi/crypto" "github.com/hyperledger/aries-framework-go/spi/storage" ) diff --git a/component/kmscrypto/doc/util/fingerprint/fingerprint.go b/component/kmscrypto/doc/util/fingerprint/fingerprint.go index 92f37785b..fe705b9e2 100644 --- a/component/kmscrypto/doc/util/fingerprint/fingerprint.go +++ b/component/kmscrypto/doc/util/fingerprint/fingerprint.go @@ -16,7 +16,7 @@ import ( "github.com/btcsuite/btcutil/base58" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" + "github.com/trustbloc/kms-go/doc/jose/jwk" ) const ( diff --git a/component/kmscrypto/doc/util/fingerprint/fingerprint_test.go b/component/kmscrypto/doc/util/fingerprint/fingerprint_test.go index e03fae4ff..2614e88bf 100644 --- a/component/kmscrypto/doc/util/fingerprint/fingerprint_test.go +++ b/component/kmscrypto/doc/util/fingerprint/fingerprint_test.go @@ -19,8 +19,8 @@ import ( "github.com/go-jose/go-jose/v3" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk/jwksupport" + "github.com/trustbloc/kms-go/doc/jose/jwk" + "github.com/trustbloc/kms-go/doc/jose/jwk/jwksupport" ) func TestCreateDIDKey(t *testing.T) { diff --git a/component/kmscrypto/doc/util/fingerprint/parse_test.go b/component/kmscrypto/doc/util/fingerprint/parse_test.go index 46b956875..3602931d7 100644 --- a/component/kmscrypto/doc/util/fingerprint/parse_test.go +++ b/component/kmscrypto/doc/util/fingerprint/parse_test.go @@ -11,7 +11,7 @@ import ( "github.com/btcsuite/btcutil/base58" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/fingerprint" + "github.com/trustbloc/kms-go/doc/util/fingerprint" ) func TestCreateDIDKey(t *testing.T) { diff --git a/component/kmscrypto/doc/util/jwkkid/kid_creator.go b/component/kmscrypto/doc/util/jwkkid/kid_creator.go index 6ae162101..f789d5fe0 100644 --- a/component/kmscrypto/doc/util/jwkkid/kid_creator.go +++ b/component/kmscrypto/doc/util/jwkkid/kid_creator.go @@ -21,14 +21,14 @@ import ( "github.com/btcsuite/btcd/btcec" hybrid "github.com/google/tink/go/hybrid/subtle" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/util/cryptoutil" + "github.com/trustbloc/kms-go/util/cryptoutil" "github.com/hyperledger/aries-framework-go/spi/kms" cryptoapi "github.com/hyperledger/aries-framework-go/spi/crypto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk/jwksupport" + "github.com/trustbloc/kms-go/doc/jose/jwk" + "github.com/trustbloc/kms-go/doc/jose/jwk/jwksupport" ) var errInvalidKeyType = errors.New("key type is not supported") diff --git a/component/kmscrypto/doc/util/jwkkid/kid_creator_test.go b/component/kmscrypto/doc/util/jwkkid/kid_creator_test.go index e703356b5..dd1c74e27 100644 --- a/component/kmscrypto/doc/util/jwkkid/kid_creator_test.go +++ b/component/kmscrypto/doc/util/jwkkid/kid_creator_test.go @@ -23,14 +23,14 @@ import ( commonpb "github.com/google/tink/go/proto/common_go_proto" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/util/cryptoutil" + "github.com/trustbloc/kms-go/util/cryptoutil" "github.com/hyperledger/aries-framework-go/spi/kms" cryptoapi "github.com/hyperledger/aries-framework-go/spi/crypto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" - ecdhpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" + "github.com/trustbloc/kms-go/crypto/primitive/bbs12381g2pub" + ecdhpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" ) // TODO: clean up these tests diff --git a/component/kmscrypto/doc/util/kmsdidkey/kmsdidkey.go b/component/kmscrypto/doc/util/kmsdidkey/kmsdidkey.go index 673aab993..cd53c8cbe 100644 --- a/component/kmscrypto/doc/util/kmsdidkey/kmsdidkey.go +++ b/component/kmscrypto/doc/util/kmsdidkey/kmsdidkey.go @@ -15,9 +15,10 @@ import ( "github.com/btcsuite/btcutil/base58" commonpb "github.com/google/tink/go/proto/common_go_proto" - afgocrypto "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/fingerprint" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/jwkkid" + afgocrypto "github.com/trustbloc/kms-go/crypto" + "github.com/trustbloc/kms-go/doc/util/fingerprint" + "github.com/trustbloc/kms-go/doc/util/jwkkid" + cryptoapi "github.com/hyperledger/aries-framework-go/spi/crypto" "github.com/hyperledger/aries-framework-go/spi/kms" ) diff --git a/component/kmscrypto/doc/util/kmsdidkey/kmsdidkey_test.go b/component/kmscrypto/doc/util/kmsdidkey/kmsdidkey_test.go index f8418dc1b..3ff614f5e 100644 --- a/component/kmscrypto/doc/util/kmsdidkey/kmsdidkey_test.go +++ b/component/kmscrypto/doc/util/kmsdidkey/kmsdidkey_test.go @@ -13,9 +13,10 @@ import ( "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms/localkms" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/secretlock/noop" + "github.com/trustbloc/kms-go/kms" + "github.com/trustbloc/kms-go/kms/localkms" + "github.com/trustbloc/kms-go/secretlock/noop" + mockstorage "github.com/hyperledger/aries-framework-go/component/storageutil/mock/storage" "github.com/hyperledger/aries-framework-go/spi/crypto" kmsapi "github.com/hyperledger/aries-framework-go/spi/kms" diff --git a/component/kmscrypto/doc/util/kmssigner/kmssigner_test.go b/component/kmscrypto/doc/util/kmssigner/kmssigner_test.go index 664be6302..e3dc40060 100644 --- a/component/kmscrypto/doc/util/kmssigner/kmssigner_test.go +++ b/component/kmscrypto/doc/util/kmssigner/kmssigner_test.go @@ -12,7 +12,8 @@ import ( "github.com/stretchr/testify/require" - mockcrypto "github.com/hyperledger/aries-framework-go/component/kmscrypto/mock/crypto" + mockcrypto "github.com/trustbloc/kms-go/mock/crypto" + kmsapi "github.com/hyperledger/aries-framework-go/spi/kms" ) diff --git a/component/kmscrypto/go.mod b/component/kmscrypto/go.mod index af380e065..613d32090 100644 --- a/component/kmscrypto/go.mod +++ b/component/kmscrypto/go.mod @@ -21,6 +21,7 @@ require ( github.com/hyperledger/ursa-wrapper-go v0.3.1 github.com/stretchr/testify v1.8.1 github.com/teserakt-io/golang-ed25519 v0.0.0-20210104091850-3888c087a4c8 + github.com/trustbloc/kms-go v0.0.0-20230823163616-c9310a484f40 golang.org/x/crypto v0.1.0 google.golang.org/protobuf v1.28.1 ) diff --git a/component/kmscrypto/go.sum b/component/kmscrypto/go.sum index c3fe51f02..4523ebbf3 100644 --- a/component/kmscrypto/go.sum +++ b/component/kmscrypto/go.sum @@ -74,6 +74,8 @@ github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKs github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/teserakt-io/golang-ed25519 v0.0.0-20210104091850-3888c087a4c8 h1:RBkacARv7qY5laaXGlF4wFB/tk5rnthhPb8oIBGoagY= github.com/teserakt-io/golang-ed25519 v0.0.0-20210104091850-3888c087a4c8/go.mod h1:9PdLyPiZIiW3UopXyRnPYyjUXSpiQNHRLu8fOsR3o8M= +github.com/trustbloc/kms-go v0.0.0-20230823163616-c9310a484f40 h1:ffs36Xhux4VizFvANdq1F2V/dNp1kgR91CiKShDV1RA= +github.com/trustbloc/kms-go v0.0.0-20230823163616-c9310a484f40/go.mod h1:AkTaHo5jhlJR2I4FyJCXaxUA/kEsauBUPBwVnAebeUU= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/component/kmscrypto/kms/localkms/crypto_box.go b/component/kmscrypto/kms/localkms/crypto_box.go index c0aaeed2e..6d511d870 100644 --- a/component/kmscrypto/kms/localkms/crypto_box.go +++ b/component/kmscrypto/kms/localkms/crypto_box.go @@ -20,10 +20,11 @@ import ( tinkpb "github.com/google/tink/go/proto/tink_go_proto" "golang.org/x/crypto/nacl/box" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/jwkkid" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms/localkms/internal/keywrapper" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/secretlock/noop" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/util/cryptoutil" + "github.com/trustbloc/kms-go/doc/util/jwkkid" + "github.com/trustbloc/kms-go/kms/localkms/internal/keywrapper" + "github.com/trustbloc/kms-go/secretlock/noop" + "github.com/trustbloc/kms-go/util/cryptoutil" + "github.com/hyperledger/aries-framework-go/spi/kms" ) diff --git a/component/kmscrypto/kms/localkms/crypto_box_test.go b/component/kmscrypto/kms/localkms/crypto_box_test.go index 22332edfa..d0166d65a 100644 --- a/component/kmscrypto/kms/localkms/crypto_box_test.go +++ b/component/kmscrypto/kms/localkms/crypto_box_test.go @@ -13,8 +13,9 @@ import ( "github.com/btcsuite/btcutil/base58" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/secretlock/noop" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/util/cryptoutil" + "github.com/trustbloc/kms-go/secretlock/noop" + "github.com/trustbloc/kms-go/util/cryptoutil" + "github.com/hyperledger/aries-framework-go/spi/kms" "github.com/hyperledger/aries-framework-go/spi/secretlock" ) diff --git a/component/kmscrypto/kms/localkms/internal/keywrapper/kms_aead_test.go b/component/kmscrypto/kms/localkms/internal/keywrapper/kms_aead_test.go index 5162ffab1..713fd4d9f 100644 --- a/component/kmscrypto/kms/localkms/internal/keywrapper/kms_aead_test.go +++ b/component/kmscrypto/kms/localkms/internal/keywrapper/kms_aead_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/tink/go/tink" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/mock/secretlock" + "github.com/trustbloc/kms-go/mock/secretlock" ) func TestLocalKMS_New_AEAD(t *testing.T) { diff --git a/component/kmscrypto/kms/localkms/keytemplate.go b/component/kmscrypto/kms/localkms/keytemplate.go index 2908ba3fd..f129ed7a0 100644 --- a/component/kmscrypto/kms/localkms/keytemplate.go +++ b/component/kmscrypto/kms/localkms/keytemplate.go @@ -19,9 +19,9 @@ import ( "github.com/hyperledger/aries-framework-go/spi/kms" - "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/secp256k1" + "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/secp256k1" ) // nolint:gocyclo,funlen diff --git a/component/kmscrypto/kms/localkms/keytemplate_factory_ursa.go b/component/kmscrypto/kms/localkms/keytemplate_factory_ursa.go index 098f0cace..bd6a9407f 100644 --- a/component/kmscrypto/kms/localkms/keytemplate_factory_ursa.go +++ b/component/kmscrypto/kms/localkms/keytemplate_factory_ursa.go @@ -14,8 +14,8 @@ import ( "github.com/hyperledger/aries-framework-go/spi/kms" - clbld "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/cl/blinder" - clsgn "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer" + clbld "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/blinder" + clsgn "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/signer" ) // getKeyTemplate returns tink KeyTemplate associated with the provided keyType. diff --git a/component/kmscrypto/kms/localkms/localkms.go b/component/kmscrypto/kms/localkms/localkms.go index cd12f51c8..305a748c4 100644 --- a/component/kmscrypto/kms/localkms/localkms.go +++ b/component/kmscrypto/kms/localkms/localkms.go @@ -23,10 +23,10 @@ import ( cryptoapi "github.com/hyperledger/aries-framework-go/spi/crypto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/jwkkid" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms/localkms/internal/keywrapper" + "github.com/trustbloc/kms-go/crypto/primitive/bbs12381g2pub" + "github.com/trustbloc/kms-go/doc/util/jwkkid" + "github.com/trustbloc/kms-go/kms" + "github.com/trustbloc/kms-go/kms/localkms/internal/keywrapper" ) const ( diff --git a/component/kmscrypto/kms/localkms/localkms_reader_test.go b/component/kmscrypto/kms/localkms/localkms_reader_test.go index 2dd85ac65..01e6e41ce 100644 --- a/component/kmscrypto/kms/localkms/localkms_reader_test.go +++ b/component/kmscrypto/kms/localkms/localkms_reader_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms" + "github.com/trustbloc/kms-go/kms" ) func TestLocalKMSReader(t *testing.T) { diff --git a/component/kmscrypto/kms/localkms/localkms_test.go b/component/kmscrypto/kms/localkms/localkms_test.go index 9bf145642..52cf7b5d4 100644 --- a/component/kmscrypto/kms/localkms/localkms_test.go +++ b/component/kmscrypto/kms/localkms/localkms_test.go @@ -31,14 +31,14 @@ import ( kmsapi "github.com/hyperledger/aries-framework-go/spi/kms" "github.com/hyperledger/aries-framework-go/spi/secretlock" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms/localkms/internal/keywrapper" - mocksecretlock "github.com/hyperledger/aries-framework-go/component/kmscrypto/mock/secretlock" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/secretlock/local" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/secretlock/local/masterlock/hkdf" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/secretlock/noop" + "github.com/trustbloc/kms-go/crypto/primitive/bbs12381g2pub" + "github.com/trustbloc/kms-go/crypto/tinkcrypto" + "github.com/trustbloc/kms-go/kms" + "github.com/trustbloc/kms-go/kms/localkms/internal/keywrapper" + mocksecretlock "github.com/trustbloc/kms-go/mock/secretlock" + "github.com/trustbloc/kms-go/secretlock/local" + "github.com/trustbloc/kms-go/secretlock/local/masterlock/hkdf" + "github.com/trustbloc/kms-go/secretlock/noop" ) const testMasterKeyURI = keywrapper.LocalKeyURIPrefix + "test/key/uri" diff --git a/component/kmscrypto/kms/localkms/localkms_ursa_test.go b/component/kmscrypto/kms/localkms/localkms_ursa_test.go index 32e15ec40..2aae12155 100644 --- a/component/kmscrypto/kms/localkms/localkms_ursa_test.go +++ b/component/kmscrypto/kms/localkms/localkms_ursa_test.go @@ -15,11 +15,11 @@ import ( "github.com/google/tink/go/keyset" "github.com/stretchr/testify/require" - mockstorage "github.com/hyperledger/aries-framework-go/component/kmscrypto/internal/mock/storage" + mockstorage "github.com/trustbloc/kms-go/internal/mock/storage" kmsapi "github.com/hyperledger/aries-framework-go/spi/kms" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms" + "github.com/trustbloc/kms-go/kms" ) func TestLocalKMS_Ursa_Success(t *testing.T) { diff --git a/component/kmscrypto/kms/localkms/localkms_writer.go b/component/kmscrypto/kms/localkms/localkms_writer.go index aa685da44..ce503c5e3 100644 --- a/component/kmscrypto/kms/localkms/localkms_writer.go +++ b/component/kmscrypto/kms/localkms/localkms_writer.go @@ -15,7 +15,7 @@ import ( kmsapi "github.com/hyperledger/aries-framework-go/spi/kms" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms" + "github.com/trustbloc/kms-go/kms" ) const maxKeyIDLen = 50 diff --git a/component/kmscrypto/kms/localkms/localkms_writer_test.go b/component/kmscrypto/kms/localkms/localkms_writer_test.go index d901e3064..62f32bbc6 100644 --- a/component/kmscrypto/kms/localkms/localkms_writer_test.go +++ b/component/kmscrypto/kms/localkms/localkms_writer_test.go @@ -17,7 +17,7 @@ import ( kmsapi "github.com/hyperledger/aries-framework-go/spi/kms" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms" + "github.com/trustbloc/kms-go/kms" ) func TestLocalKMSWriter(t *testing.T) { diff --git a/component/kmscrypto/kms/localkms/privkey_import.go b/component/kmscrypto/kms/localkms/privkey_import.go index c17c19a5f..82f7c2919 100644 --- a/component/kmscrypto/kms/localkms/privkey_import.go +++ b/component/kmscrypto/kms/localkms/privkey_import.go @@ -21,12 +21,12 @@ import ( "github.com/hyperledger/aries-framework-go/spi/kms" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh" - bbspb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/bbs_go_proto" - clpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/cl_go_proto" - ecdhpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" - secp256k1pb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/secp256k1_go_proto" + "github.com/trustbloc/kms-go/crypto/primitive/bbs12381g2pub" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/ecdh" + bbspb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/bbs_go_proto" + clpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/cl_go_proto" + ecdhpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" + secp256k1pb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/secp256k1_go_proto" ) const ( diff --git a/component/kmscrypto/kms/localkms/privkey_import_test.go b/component/kmscrypto/kms/localkms/privkey_import_test.go index 6ca04cc4d..bd5e92a28 100644 --- a/component/kmscrypto/kms/localkms/privkey_import_test.go +++ b/component/kmscrypto/kms/localkms/privkey_import_test.go @@ -23,8 +23,8 @@ import ( "github.com/hyperledger/aries-framework-go/spi/secretlock" - mocksecretlock "github.com/hyperledger/aries-framework-go/component/kmscrypto/mock/secretlock" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/secretlock/noop" + mocksecretlock "github.com/trustbloc/kms-go/mock/secretlock" + "github.com/trustbloc/kms-go/secretlock/noop" ) func TestImportECDSAKeyWithInvalidKey(t *testing.T) { diff --git a/component/kmscrypto/kms/localkms/pubkey_export_import_test.go b/component/kmscrypto/kms/localkms/pubkey_export_import_test.go index 0b0168e0f..f8b714c08 100644 --- a/component/kmscrypto/kms/localkms/pubkey_export_import_test.go +++ b/component/kmscrypto/kms/localkms/pubkey_export_import_test.go @@ -20,7 +20,7 @@ import ( "github.com/hyperledger/aries-framework-go/spi/kms" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/bbs" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/bbs" ) func TestPubKeyExportAndRead(t *testing.T) { diff --git a/component/kmscrypto/kms/localkms/pubkey_reader.go b/component/kmscrypto/kms/localkms/pubkey_reader.go index 4c6085a6a..195993a6a 100644 --- a/component/kmscrypto/kms/localkms/pubkey_reader.go +++ b/component/kmscrypto/kms/localkms/pubkey_reader.go @@ -23,10 +23,10 @@ import ( "github.com/hyperledger/aries-framework-go/spi/kms" - bbspb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/bbs_go_proto" - clpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/cl_go_proto" - secp256k1pb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/secp256k1_go_proto" - secp256k1subtle "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/subtle" + bbspb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/bbs_go_proto" + clpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/cl_go_proto" + secp256k1pb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/secp256k1_go_proto" + secp256k1subtle "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/secp256k1/subtle" ) // PublicKeyBytesToHandle will create and return a key handle for pubKey of type kt diff --git a/component/kmscrypto/kms/localkms/pubkey_writer.go b/component/kmscrypto/kms/localkms/pubkey_writer.go index c2778d189..5e082c53f 100644 --- a/component/kmscrypto/kms/localkms/pubkey_writer.go +++ b/component/kmscrypto/kms/localkms/pubkey_writer.go @@ -23,11 +23,11 @@ import ( "github.com/hyperledger/aries-framework-go/spi/kms" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/keyio" - bbspb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/bbs_go_proto" - clpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/cl_go_proto" - secp256k1pb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/secp256k1_go_proto" - secp256k1subtle "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/subtle" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/keyio" + bbspb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/bbs_go_proto" + clpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/cl_go_proto" + secp256k1pb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/secp256k1_go_proto" + secp256k1subtle "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/secp256k1/subtle" ) const ( diff --git a/component/kmscrypto/kms/webkms/crypto_box.go b/component/kmscrypto/kms/webkms/crypto_box.go index c1b75336f..07d38d6da 100644 --- a/component/kmscrypto/kms/webkms/crypto_box.go +++ b/component/kmscrypto/kms/webkms/crypto_box.go @@ -14,11 +14,11 @@ import ( "golang.org/x/crypto/nacl/box" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/util/cryptoutil" + "github.com/trustbloc/kms-go/util/cryptoutil" "github.com/hyperledger/aries-framework-go/spi/kms" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/jwkkid" + "github.com/trustbloc/kms-go/doc/util/jwkkid" ) // TODO move CryptoBox out of webkms package. diff --git a/component/kmscrypto/kms/webkms/crypto_box_test.go b/component/kmscrypto/kms/webkms/crypto_box_test.go index 3478b1a2c..e4cfec0c7 100644 --- a/component/kmscrypto/kms/webkms/crypto_box_test.go +++ b/component/kmscrypto/kms/webkms/crypto_box_test.go @@ -21,9 +21,9 @@ import ( "github.com/stretchr/testify/require" "golang.org/x/crypto/nacl/box" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/util/cryptoutil" + "github.com/trustbloc/kms-go/util/cryptoutil" - mockkms "github.com/hyperledger/aries-framework-go/component/kmscrypto/mock/kms" + mockkms "github.com/trustbloc/kms-go/mock/kms" ) func TestNewRemoteCryptoBox(t *testing.T) { diff --git a/component/kmscrypto/mock/kms/mock_kms.go b/component/kmscrypto/mock/kms/mock_kms.go index 1de03ef0d..542adae7e 100644 --- a/component/kmscrypto/mock/kms/mock_kms.go +++ b/component/kmscrypto/mock/kms/mock_kms.go @@ -15,7 +15,8 @@ import ( "github.com/google/tink/go/testkeyset" "github.com/google/tink/go/testutil" - kmsservice "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms" + kmsservice "github.com/trustbloc/kms-go/kms" + "github.com/hyperledger/aries-framework-go/spi/kms" "github.com/hyperledger/aries-framework-go/spi/secretlock" "github.com/hyperledger/aries-framework-go/spi/storage" diff --git a/component/kmscrypto/secretlock/local/local_secret_lock.go b/component/kmscrypto/secretlock/local/local_secret_lock.go index 52902f3e8..3f6436168 100644 --- a/component/kmscrypto/secretlock/local/local_secret_lock.go +++ b/component/kmscrypto/secretlock/local/local_secret_lock.go @@ -18,7 +18,7 @@ import ( "github.com/hyperledger/aries-framework-go/component/log" - cipherutil "github.com/hyperledger/aries-framework-go/component/kmscrypto/secretlock/local/internal/cipher" + cipherutil "github.com/trustbloc/kms-go/secretlock/local/internal/cipher" ) // package local provides a local secret lock service. The user must create a master key and store it diff --git a/component/kmscrypto/secretlock/local/local_secret_lock_test.go b/component/kmscrypto/secretlock/local/local_secret_lock_test.go index 947842128..95c1bd66b 100644 --- a/component/kmscrypto/secretlock/local/local_secret_lock_test.go +++ b/component/kmscrypto/secretlock/local/local_secret_lock_test.go @@ -20,8 +20,8 @@ import ( "github.com/hyperledger/aries-framework-go/spi/secretlock" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/secretlock/local/masterlock/hkdf" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/secretlock/local/masterlock/pbkdf2" + "github.com/trustbloc/kms-go/secretlock/local/masterlock/hkdf" + "github.com/trustbloc/kms-go/secretlock/local/masterlock/pbkdf2" ) const ( diff --git a/component/kmscrypto/secretlock/local/masterlock/hkdf/master_secret_lock.go b/component/kmscrypto/secretlock/local/masterlock/hkdf/master_secret_lock.go index d21fbecbb..cc52e941b 100644 --- a/component/kmscrypto/secretlock/local/masterlock/hkdf/master_secret_lock.go +++ b/component/kmscrypto/secretlock/local/masterlock/hkdf/master_secret_lock.go @@ -18,7 +18,7 @@ import ( "github.com/hyperledger/aries-framework-go/spi/secretlock" - cipherutil "github.com/hyperledger/aries-framework-go/component/kmscrypto/secretlock/local/internal/cipher" + cipherutil "github.com/trustbloc/kms-go/secretlock/local/internal/cipher" ) // package hkdf provides an hkdf implementation of secretlock as a masterlock. @@ -84,7 +84,8 @@ func NewMasterLock(passphrase string, h func() hash.Hash, salt []byte) (secretlo } // Encrypt a master key in req -// (keyURI is used for remote locks, it is ignored by this implementation) +// +// (keyURI is used for remote locks, it is ignored by this implementation) func (m *masterLockHKDF) Encrypt(keyURI string, req *secretlock.EncryptRequest) (*secretlock.EncryptResponse, error) { nonce := random.GetRandomBytes(uint32(m.aead.NonceSize())) ct := m.aead.Seal(nil, nonce, []byte(req.Plaintext), []byte(req.AdditionalAuthenticatedData)) diff --git a/component/kmscrypto/secretlock/local/masterlock/pbkdf2/master_secret_lock.go b/component/kmscrypto/secretlock/local/masterlock/pbkdf2/master_secret_lock.go index 058934e8b..a343b026d 100644 --- a/component/kmscrypto/secretlock/local/masterlock/pbkdf2/master_secret_lock.go +++ b/component/kmscrypto/secretlock/local/masterlock/pbkdf2/master_secret_lock.go @@ -18,7 +18,7 @@ import ( "github.com/hyperledger/aries-framework-go/spi/secretlock" - cipherutil "github.com/hyperledger/aries-framework-go/component/kmscrypto/secretlock/local/internal/cipher" + cipherutil "github.com/trustbloc/kms-go/secretlock/local/internal/cipher" ) // package pbkdf2 provides an pbkdf2 implementation of secretlock as a masterlock. @@ -67,7 +67,8 @@ func NewMasterLock(passphrase string, h func() hash.Hash, iterations int, salt [ } // Encrypt a master key in req -// (keyURI is used for remote locks, it is ignored by this implementation) +// +// (keyURI is used for remote locks, it is ignored by this implementation) func (m *masterLockPBKDF2) Encrypt(keyURI string, req *secretlock.EncryptRequest) (*secretlock.EncryptResponse, error) { nonce := random.GetRandomBytes(uint32(m.aead.NonceSize())) ct := m.aead.Seal(nil, nonce, []byte(req.Plaintext), []byte(req.AdditionalAuthenticatedData)) diff --git a/component/kmscrypto/util/cryptoutil/legacy_utils.go b/component/kmscrypto/util/cryptoutil/legacy_utils.go index c2bcb7c52..8b7209e38 100644 --- a/component/kmscrypto/util/cryptoutil/legacy_utils.go +++ b/component/kmscrypto/util/cryptoutil/legacy_utils.go @@ -6,29 +6,11 @@ SPDX-License-Identifier: Apache-2.0 package cryptoutil -import "golang.org/x/crypto/blake2b" +import ( + "github.com/trustbloc/kms-go/util/cryptoutil" +) // Nonce makes a nonce using blake2b, to match the format expected by libsodium. func Nonce(pub1, pub2 []byte) (*[NonceSize]byte, error) { - var nonce [NonceSize]byte - // generate an equivalent nonce to libsodium's (see link above) - nonceWriter, err := blake2b.New(NonceSize, nil) - if err != nil { - return nil, err - } - - _, err = nonceWriter.Write(pub1) - if err != nil { - return nil, err - } - - _, err = nonceWriter.Write(pub2) - if err != nil { - return nil, err - } - - nonceOut := nonceWriter.Sum(nil) - copy(nonce[:], nonceOut) - - return &nonce, nil + return cryptoutil.Nonce(pub1, pub2) } diff --git a/component/kmscrypto/util/cryptoutil/utils.go b/component/kmscrypto/util/cryptoutil/utils.go index dca9760dd..bd884f2fe 100644 --- a/component/kmscrypto/util/cryptoutil/utils.go +++ b/component/kmscrypto/util/cryptoutil/utils.go @@ -7,85 +7,36 @@ SPDX-License-Identifier: Apache-2.0 package cryptoutil import ( - "crypto/ed25519" - "encoding/binary" - "errors" - "fmt" - - "github.com/teserakt-io/golang-ed25519/extra25519" + "github.com/trustbloc/kms-go/util/cryptoutil" chacha "golang.org/x/crypto/chacha20poly1305" - "golang.org/x/crypto/curve25519" ) // DeriveECDHX25519 does X25519 ECDH using fromPrivKey and toPubKey. func DeriveECDHX25519(fromPrivKey, toPubKey *[chacha.KeySize]byte) ([]byte, error) { - if fromPrivKey == nil || toPubKey == nil { - return nil, errors.New("deriveECDHX25519: invalid key") - } - - // do ScalarMult of the sender's private key with the recipient key to get a derived Z point (ECDH) - z, err := curve25519.X25519(fromPrivKey[:], toPubKey[:]) - if err != nil { - return nil, fmt.Errorf("deriveECDHX25519: %w", err) - } - - return z, nil + return cryptoutil.DeriveECDHX25519(fromPrivKey, toPubKey) } // LengthPrefix array with a bigEndian uint32 value of array's length. func LengthPrefix(array []byte) []byte { - const prefixLen = 4 - - arrInfo := make([]byte, prefixLen+len(array)) - binary.BigEndian.PutUint32(arrInfo, uint32(len(array))) - copy(arrInfo[prefixLen:], array) - - return arrInfo + return cryptoutil.LengthPrefix(array) } // Curve25519KeySize number of bytes in a Curve25519 public or private key. -const Curve25519KeySize = 32 +const Curve25519KeySize = cryptoutil.Curve25519KeySize // NonceSize size of a nonce used by Box encryption (Xchacha20Poly1305). -const NonceSize = 24 +const NonceSize = cryptoutil.NonceSize // PublicEd25519toCurve25519 takes an Ed25519 public key and provides the corresponding Curve25519 public key // This function wraps PublicKeyToCurve25519 from Adam Langley's ed25519 repo: https://github.com/agl/ed25519 now // moved to https://github.com/teserakt-io/golang-ed25519 func PublicEd25519toCurve25519(pub []byte) ([]byte, error) { - if len(pub) == 0 { - return nil, errors.New("public key is nil") - } - - if len(pub) != ed25519.PublicKeySize { - return nil, fmt.Errorf("%d-byte key size is invalid", len(pub)) - } - - pkOut := new([Curve25519KeySize]byte) - pKIn := new([Curve25519KeySize]byte) - copy(pKIn[:], pub) - - success := extra25519.PublicKeyToCurve25519(pkOut, pKIn) - if !success { - return nil, errors.New("error converting public key") - } - - return pkOut[:], nil + return cryptoutil.PublicEd25519toCurve25519(pub) } // SecretEd25519toCurve25519 converts a secret key from Ed25519 to curve25519 format // This function wraps PrivateKeyToCurve25519 from Adam Langley's ed25519 repo: https://github.com/agl/ed25519 now // moved to https://github.com/teserakt-io/golang-ed25519 func SecretEd25519toCurve25519(priv []byte) ([]byte, error) { - if len(priv) == 0 { - return nil, errors.New("private key is nil") - } - - sKIn := new([ed25519.PrivateKeySize]byte) - copy(sKIn[:], priv) - - sKOut := new([Curve25519KeySize]byte) - extra25519.PrivateKeyToCurve25519(sKOut, sKIn) - - return sKOut[:], nil + return cryptoutil.SecretEd25519toCurve25519(priv) } diff --git a/component/kmscrypto/util/cryptoutil/utils_test.go b/component/kmscrypto/util/cryptoutil/utils_test.go deleted file mode 100644 index 98d89a011..000000000 --- a/component/kmscrypto/util/cryptoutil/utils_test.go +++ /dev/null @@ -1,231 +0,0 @@ -/* -Copyright SecureKey Technologies Inc. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ - -package cryptoutil - -import ( - "encoding/base64" - "testing" - - "github.com/btcsuite/btcutil/base58" - "github.com/stretchr/testify/require" - chacha "golang.org/x/crypto/chacha20poly1305" -) - -func TestDeriveKEK_Util(t *testing.T) { - z, err := DeriveECDHX25519(nil, nil) - require.EqualError(t, err, "deriveECDHX25519: invalid key") - require.Empty(t, z) - - validChachaKey, err := base64.RawURLEncoding.DecodeString("c8CSJr_27PN9xWCpzXNmepRndD6neQcnO9DS0YWjhNs") - require.NoError(t, err) - - chachaKey := new([chacha.KeySize]byte) - copy(chachaKey[:], validChachaKey) - z, err = DeriveECDHX25519(chachaKey, nil) - require.EqualError(t, err, "deriveECDHX25519: invalid key") - require.Empty(t, z) - - validChachaKey2, err := base64.RawURLEncoding.DecodeString("AAjrHjiFLw6kf6CZ5zqH1ooG3y2aQhuqxmUvqJnIvDI") - require.NoError(t, err) - - chachaKey2 := new([chacha.KeySize]byte) - copy(chachaKey2[:], validChachaKey2) - z, err = DeriveECDHX25519(chachaKey, chachaKey2) - require.NoError(t, err) - require.NotEmpty(t, z) - - // lowOrderPoint from golang.org/x/crypto/curve25519. - // https://github.com/golang/crypto/blob/f4817d981/curve25519/vectors_test.go#L10 - lowOrderPoint := []byte{ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - } - chachaKey2 = new([chacha.KeySize]byte) - copy(chachaKey2[:], lowOrderPoint) - // test error from curve25519.X25519() call in DeriveECDHX25519() - _, err = DeriveECDHX25519(chachaKey, chachaKey2) - require.EqualError(t, err, "deriveECDHX25519: bad input point: low order point") -} - -func TestNonceGeneration(t *testing.T) { - t.Run("Verify nonce against libsodium generated data", func(t *testing.T) { - data := [][]string{ - { - "6Gy2UWZCvYcTnpNvQX6ZNhz8FEofrhVxLCEPrjNTTZui", "9mGybrrDfGPdnGXA4BXbzJXnbg2w27bZ1ok6whbJrhF9", - "EWqT43jjhcy4wJHamH2RFthdLAQhits8F", - }, - { - "GJBA64X9GReJrUttG4xQ1dLm726Sn3XQE5hAQeiCZtBV", "kRU8Ef7NTmhijeqKyWzZaZmVAq5UhnpfMfzsBYgBGrV", - "Kr7Wi5EGyTVNQy44oeFcBJtJJ7dVvXEAL", - }, - { - "CYx2Jtgti3Rc45ZCgHMWxSCVYgivwcy2PKcXDpadJz5M", "2gWhujzcfRtpeZhiXeXoARqzCzBESdKUG5DoAzLCzhSY", - "MZ53sJMYDDtA9JUTFSqmXmD7s7m6hVW2m", - }, - { - "At8qPKFRTPzTBjvEUxWzQ3Sc7B3Ywk5G2tEmrzcMWo8C", "2GBiu2FEtSpxDJ4C8bdCUfTfsqW8eb39M985uB85NbC8", - "6UU5xChzZFsBHgzFMDga8jnLwSqcS46Ln", - }, - { - "7rRY74rDVcjghFP9y8fR15xxmZaHBuZnFrYTXwnmwrnE", "CCs3kZHuXSM7mcH5yrXp5bCzMqDsBztqcHsRvgmJBN7D", - "MPEnkeoVe8X67yBK9k2AZdXHw4e2udx2X", - }, - } - - for _, datum := range data { - pub1 := base58.Decode(datum[0]) - pub2 := base58.Decode(datum[1]) - - correctNonce := base58.Decode(datum[2]) - testNonce, err := Nonce(pub1, pub2) - - require.NoError(t, err) - require.ElementsMatch(t, correctNonce, testNonce[:]) - } - }) -} - -func TestKeyConversion(t *testing.T) { - t.Run("Test public key conversion", func(t *testing.T) { - // Test data generated using GoKillers/libsodium - edPubs := []string{ - "GV28sQUKYSWdkYtu7h46ACGvjbpL7BUv8TZJr5Lukxra", - "6a58vqYauxsAU2J1dGXNxTDcC6nPyntxM2bh8YWJBwTW", - "9UKEhZgwcpbvrfxAyy7hzFzYJvtf48EvmjAfcFUZYLNk", - "5aa4euy5AGiS9JqDeCTgWqUmFmd64ADKergicwoG2jFU", - "BF3niopmPgYV6xRmTJMMR88ZMnHeJXoCYiQ4Q9qCMpHU", - "AdHgkKSDMD3YLYzua8yczqFTeLgYdD6W3LR5wjogEUk9", - "EFnybhqg65JqfankLNKeQb228dkNcVF1c7vzdtvNaz6J", - "2HbU7ZiZ398b4SvU6b9GVGE4W3UEjYcTStgvNpPb2oUc", - "2r4M2aL4YDE2Qy6MzLWb3it93Mt84oSGrPNJ9V6VaAF4", - "CTsYpNjdhK68mjkE4wNrnTVW2qERFNoPXWBnUW9E9bhz", - "B7PGAJGqfei7cKFvaaF53uPDVmWBkVyLe5UqmrL3GVmF", - "CJZRRZyhpz29qf8uBfmUWrHa8G3XwEmtYdwiNyT42XeK", - "3q99EhPvy4ma62BGztcyabGHtX7sZjBtnfkJyE7JJmF8", - "8HTpnbCjbFxX8Nwx131eHwJU7dsVaupuPKDtsaeF9phe", - "89JQa4hvQU3Pk7oY8eBYrZp49ZkpVaZWLHSsxjmq9W1b", - "EVQM6epVv9ZGkAnPJBX7ns8zS3Nf5EKd9iSpbv5aqCRn", - "CiNPtf1mfdkEYRGCXiCurCNMjydZjuedbPG9kVgy4UyN", - "DKS6yB7oGMExmAFKiEAYufDevQuAHCq9UtaKJFmSzJ3k", - "8UwSjbTo3FwMC4CxqqLJBWik67ubBtE8RRC7FvxjA7xU", - "Ati3h5YVzWUjdrT956dqYh5NXZaDYqRXoHpp5Htcjxoj", - } - - curvePubs := []string{ - "8sKzfbhmTnCURJYwTsBvNbXyjNMzKy7kyZNMJe8PspLD", - "BMKZw7RcyieQHihYMvSGVZ8UFogHjoorWndJnz9L25Hm", - "D8X75d5pGTiHFYR7m2iqMjQehjd3v8MFejAGP2Mcirzu", - "3JMxHyQEwnrHhKgemRvCtjp3Z2T9UGVTMXfBKWpNQe3B", - "3gYHgo7UKQg2CV7RT67yYSRkN7X5UZhL8CTJZefU5i5x", - "BA1dA5CZuSWPjyGsW94mT2kgUVRBUppiGPkd4M2RdD69", - "7S8cYe1gd1jWy4DUp3nBVW5TmYXKnGcTMLk3xnhiEp1b", - "G215pJNTMDWafrDGHenjbAkpWoM3w9dfY5tAbWEx8pyR", - "37rPhyJfRcZk6v3Lq9kmZJMBUjyvfroniBXMiZdh7PVq", - "5FmcvFtPrdxD5GJc5P9SpVzvhSNyJDdQGPnrLnzCV64z", - "73GaEVd6oXEgqPKYmvbFg2jccMG5VLmq65Bn7gS56BRQ", - "A6W67iKzaohB4LDNa4XsAaHQbbgzdLtmaNPq6TfciRaS", - "AuANoekPVzVrNn3dbkmvMhRA926Z4rtH96jnksJ26MyK", - "FD3XcmwNmoZQ1bKfLDyk151kqsh7xVXH5W7GHt9ZJRLJ", - "5CpahvkR9BTzCtry63UeXgdWJBFdNBXd42trefE6K4jf", - "3u8zsCK3uipjMrXjpXTWj9me74wLR45YxvN7qmE3aRFb", - "5u3af9JJQQGSo42wgzeBBfhctoPUYTRXUGCMU64DpqpH", - "6b2Hc6mxnZTBW9fkNEiDyGNKnt7XuQcbDVzMGoqJfR5Y", - "DScPyc8TY6pEYWFZxQyhUvUoZEHbEJKxeE23wUS9A6hj", - "CWY4n7zi6KysyvsVHXtBAW9cQ9esFerxLZfTedfom3mF", - } - - for i, edKeyString := range edPubs { - edKey := base58.Decode(edKeyString) - - curveKey := base58.Decode(curvePubs[i]) - - convert, err := PublicEd25519toCurve25519(edKey) - require.NoError(t, err) - require.ElementsMatch(t, curveKey, convert) - } - }) - - t.Run("Test private key conversion", func(t *testing.T) { - // Test data generated using GoKillers/libsodium - edPrivs := []string{ - "DH43p5VzoVzDkgkQzgzybE9Z2hK8KevuS9x56A6AEKscHBS3ZXaf6hU4kP6VPM421REUoxCssVeif9XCVaGhURS", - "42LHpaJQCLs1JNANNqvbD5of5MDgsYEtZ4DXRJCouADyc6BGryHSv5BzHvvtFQu21XtMNP3nz5XRWVk2t8BBPS2b", - "3KsjZqADnZhKy7gb6FmsaWGYAyyawHvoW4RccUfYYTNjG9y1RN8z6FjTQMEhW3rh93Xs4aEGdbbzs9zi63ovzHQm", - "37uWqrXwpWK19P7EMNw7kXjMucvPSDuJbwjdZrFynebuFJL165w6hH4ergNWVZyB39atHhBjyK1U6WLMPrUL5FB8", - "2bXak57U5YKF8j2Ked6JoTPJr1SBs7Fap99vL5EjPS69fqsE1gSmG1KLY3tE58CWaRRDf422dtTaJjpYw1tc3xoj", - "4kR1WSRU3jzDU4EZgZGaf22a9SkoQcWWdYLRAyVDXMBhDGNc4wnREVtKb4rzZ9q6jP7ANCcsqVS7C4DkQ6AKkbAH", - "3PRatPTTQ5d7Dj5eaLaRvnbE5J28M5s1PSaZ2THmZuvXRo9Piq6dnuXcdxr39ezceCHoHmGRpPwBfKK8dWb7BVi9", - "5WTFGmXkxJc2p9XTXMwjrqCkTn1SJMCBAGQ3yDKEm9TVQF3nWwLWRneFrXzDzgBYcUo1Mxj3Ym46BYgqQWgLGSTW", - "2x4qYudE5J2rA9JQFHTHevn4nYaVJtT3f7RCzqWjZ3726tCUHbgzg74QBSzhGbWVpfQhtaRZ8RsMkcnMjGqNzrj5", - "2QAb1BPVidRV9dxb1BsZ137vXP1fQb2BbCBWo5fb5Tpj8vV1fU2vVake8JSiMBmU8XfcR8yxDmBezzbGQCKeEUds", - "5e5yq8BzzZ9MYJxkrFX4DDR6RxvwiFP1TqtimpjeQdRF16Cfq1aqVEnKbh6eRAJd7PZXuq9hMYtwLyqCeMSaaTT4", - "2tHVLALEobsefPsLprDJb7FPZ5Cj9F6zMU6hiVp9LSu2XP5AqCXxvKB18uwo4PHK8DNaAdkQ78diMtb5NBw3p9km", - "5YCxw8E9kkt46DKRv5SkJ28ZH3DoMJhSHxpPoRQhPNaP3Ve4pJyaBoKotFvpLwuwi2MwjfDMZbkfBFvQKqudrp8Q", - "277X3QJjmJVXgULzUJ87bYg76tTfnVbufhRCBJJNqBUP1hqPqueXLCKNfDrdp5atdKp18tLkSKT54yt4ef7ZL393", - "4k7nC7YKkhmTArmKYXBqQWYXAX4wzhNkaWT5RUTbczaj54iAXdUvcoXUjBgK5J5cWbLp7q55sCnv3SwNSKBbPraP", - "KKP9gymE9GvMn83LGqth7QuD7Vd4vbzsyLqCYgnnLPJdY8VuzciC4cdCvRpHvmGXXFUxyzNe7V97QBD3AxMXyPY", - "5oST3U3ffd8iamT7QgadQvyPGh58nr9r4CCiMW45ucV8qupDcmMAUFTLiPCKKYX9tPV69qfe2wQLC9x53tzxBrzd", - "38LdKpmjmed3AwDbKhCfjopoKTibn1WLVBsrGgnbRaw9mcXqRyoemmQgcnqR2au3DhB9hQFVVdbtqBeRJxyqQgwU", - "2e3votxseb2bhdKHAx2uzgQWVExkz7eAHLF1KTQYiSpVzv6s9PkSu6nUBa1EqJFoJvPKiE1PxUMPvLm7Wc4mFWQ", - "2Dt3qPTHyVPE4EpN5c62zTX1DQnJtQgbwXrkAHo6fKJYYgjnEA7Ggqie4ZfCukWG8sTvBLCoWbhQSJtV5PzFqLp9", - } - - curvePrivs := []string{ - "3im72Q16HHqfgqziCKR7dKkZF59ZHEGxqc5nfhFqF223", - "5sa8TDuj2Ha41Khou9yQ8kAVz6bxjwW1idv5QCbWMEcT", - "6yCAYLdEcyVadtqCbG3ffMx2PqhE1gXfH3enPMwjbLYD", - "HB3tAasj3hJQVa12EN9a4Ph7GrRyNPDQH1qMKBgZ8s2s", - "ZyB9Vd461HHHBKzbXFERBMeauPN7smc8MvBRxjvBLyR", - "9eSnTQusUh1aYdVhfzHUy1F4QLyHh4UpM3yV37vqoE4J", - "9fhmCLQhwFSffe7J7iD8QUBtJ15szDGnaynD9A91EAby", - "5KNPvL9JF7fpAEuuvGYRPRFa1KG68MFU5EWyW4wN5twb", - "81SrqWepV72qmWrCDtyay6y2bb9SLXYDat7oCYBAb5s8", - "G5besqGYbhA78K5hjV7umf1PyyhXV8HJhUhk6PypeWZw", - "84QJE1CBi4h8xBhQMqwFwUuCYGLXFB31NBirfD3ENduJ", - "3ic7MKSCj6YnfsGXwr2VACXC3CKhK5HxX81p17mWH4t6", - "9gF459xtS64bFcDpaCZc5Utqm5SkUUEauKQxekRJZHbs", - "4qF59e48Hq6nq7tKkJQcUHia2hD3iXVpjX91bW2sp1qs", - "DSDoiSRmL41WQ4Q8RNWoPfeXSQGn4vwQB4ii9zt7VTpq", - "BpaTEPTgUMr1XSjVAqMj2j8Q6ZvSEsmbruGfypu9XPDh", - "Ajds6dh1M1MTetjLHzrYRXYZmepVUoJnTz9Q8VhhDBPg", - "25ctY6ghvZV5RqTCdZySZVEfE6MLu4jEmFoTURDsQxDT", - "1akW9fT6rNkbVPCrP4SpLXUhYYrKK69gnjZHnFk6adf", - "18BWLZh74cem5mKbPZ7nqbBQ8zgqigg1BppVDEhMV3d", - } - - for i, edKeyString := range edPrivs { - edKey := base58.Decode(edKeyString) - curveKey := base58.Decode(curvePrivs[i]) - - convert, err := SecretEd25519toCurve25519(edKey) - require.NoError(t, err) - - require.ElementsMatch(t, curveKey, convert) - } - }) - - t.Run("Fail on converting nil Pub key", func(t *testing.T) { - _, err := PublicEd25519toCurve25519(nil) - require.EqualError(t, err, "public key is nil") - }) - - t.Run("Fail on converting Pub key of incorrect length", func(t *testing.T) { - _, err := PublicEd25519toCurve25519([]byte{1, 2, 3, 4, 5}) - require.EqualError(t, err, "5-byte key size is invalid") - }) - - t.Run("Fail on converting nil Priv key", func(t *testing.T) { - _, err := SecretEd25519toCurve25519(nil) - require.EqualError(t, err, "private key is nil") - }) - - t.Run("Fail: invalid pubkey, cannot convert to curve25519", func(t *testing.T) { - edKeyBytes := base58.Decode("6ZAQ7QpmR9EqhJdwx1jQsjq6nnpehwVqUbhVxiEiYEV7") - _, err := PublicEd25519toCurve25519(edKeyBytes) - require.EqualError(t, err, "error converting public key") - }) -} diff --git a/component/models/dataintegrity/integration_test.go b/component/models/dataintegrity/integration_test.go index 969f1d661..bdf262e55 100644 --- a/component/models/dataintegrity/integration_test.go +++ b/component/models/dataintegrity/integration_test.go @@ -15,11 +15,12 @@ import ( "github.com/stretchr/testify/require" "github.com/tidwall/sjson" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/jwkkid" - "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/util/jwkkid" + "github.com/trustbloc/kms-go/kms/localkms" + mockkms "github.com/trustbloc/kms-go/mock/kms" + "github.com/trustbloc/kms-go/secretlock/noop" + "github.com/hyperledger/aries-framework-go/component/models/dataintegrity/models" "github.com/hyperledger/aries-framework-go/component/models/dataintegrity/suite/ecdsa2019" "github.com/hyperledger/aries-framework-go/component/models/did" diff --git a/component/models/dataintegrity/suite/ecdsa2019/ecdsa2019.go b/component/models/dataintegrity/suite/ecdsa2019/ecdsa2019.go index 35187d516..246abf08d 100644 --- a/component/models/dataintegrity/suite/ecdsa2019/ecdsa2019.go +++ b/component/models/dataintegrity/suite/ecdsa2019/ecdsa2019.go @@ -19,8 +19,9 @@ import ( "github.com/multiformats/go-multibase" "github.com/piprate/json-gold/ld" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms/localkms" + "github.com/trustbloc/kms-go/doc/jose/jwk" + "github.com/trustbloc/kms-go/kms/localkms" + "github.com/hyperledger/aries-framework-go/component/models/dataintegrity/models" "github.com/hyperledger/aries-framework-go/component/models/dataintegrity/suite" "github.com/hyperledger/aries-framework-go/component/models/ld/processor" diff --git a/component/models/dataintegrity/suite/ecdsa2019/ecdsa2019_test.go b/component/models/dataintegrity/suite/ecdsa2019/ecdsa2019_test.go index 1b827d405..74a6c20c0 100644 --- a/component/models/dataintegrity/suite/ecdsa2019/ecdsa2019_test.go +++ b/component/models/dataintegrity/suite/ecdsa2019/ecdsa2019_test.go @@ -18,10 +18,11 @@ import ( "github.com/multiformats/go-multibase" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk/jwksupport" - mockcrypto "github.com/hyperledger/aries-framework-go/component/kmscrypto/mock/crypto" - mockkms "github.com/hyperledger/aries-framework-go/component/kmscrypto/mock/kms" + "github.com/trustbloc/kms-go/doc/jose/jwk" + "github.com/trustbloc/kms-go/doc/jose/jwk/jwksupport" + mockcrypto "github.com/trustbloc/kms-go/mock/crypto" + mockkms "github.com/trustbloc/kms-go/mock/kms" + "github.com/hyperledger/aries-framework-go/component/models/dataintegrity/models" "github.com/hyperledger/aries-framework-go/component/models/dataintegrity/suite" "github.com/hyperledger/aries-framework-go/component/models/did" diff --git a/component/models/dataintegrity/suite/ecdsa2019/integration_test.go b/component/models/dataintegrity/suite/ecdsa2019/integration_test.go index 3bd35ccd3..dfd7476d0 100644 --- a/component/models/dataintegrity/suite/ecdsa2019/integration_test.go +++ b/component/models/dataintegrity/suite/ecdsa2019/integration_test.go @@ -12,11 +12,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/util/jwkkid" - "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/util/jwkkid" + "github.com/trustbloc/kms-go/kms/localkms" + mockkms "github.com/trustbloc/kms-go/mock/kms" + "github.com/trustbloc/kms-go/secretlock/noop" + "github.com/hyperledger/aries-framework-go/component/models/dataintegrity/models" "github.com/hyperledger/aries-framework-go/component/models/did" "github.com/hyperledger/aries-framework-go/component/models/ld/documentloader" diff --git a/component/models/did/doc.go b/component/models/did/doc.go index 3882c2a56..87af7987e 100644 --- a/component/models/did/doc.go +++ b/component/models/did/doc.go @@ -21,7 +21,8 @@ import ( "github.com/multiformats/go-multibase" "github.com/xeipuuv/gojsonschema" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" + "github.com/trustbloc/kms-go/doc/jose/jwk" + "github.com/hyperledger/aries-framework-go/component/log" "github.com/hyperledger/aries-framework-go/component/models/did/endpoint" "github.com/hyperledger/aries-framework-go/component/models/ld/processor" diff --git a/component/models/did/doc_test.go b/component/models/did/doc_test.go index eec05674e..29ef7511e 100644 --- a/component/models/did/doc_test.go +++ b/component/models/did/doc_test.go @@ -23,7 +23,8 @@ import ( gojose "github.com/go-jose/go-jose/v3" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" + "github.com/trustbloc/kms-go/doc/jose/jwk" + "github.com/hyperledger/aries-framework-go/component/models/did/endpoint" "github.com/hyperledger/aries-framework-go/component/models/ld/testutil" "github.com/hyperledger/aries-framework-go/component/models/signature/signer" diff --git a/component/models/jose/diddocresolver/resolver.go b/component/models/jose/diddocresolver/resolver.go index 53581274a..d68dab0d9 100644 --- a/component/models/jose/diddocresolver/resolver.go +++ b/component/models/jose/diddocresolver/resolver.go @@ -13,7 +13,8 @@ import ( "fmt" "strings" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/jwkkid" + "github.com/trustbloc/kms-go/doc/util/jwkkid" + "github.com/hyperledger/aries-framework-go/component/models/did" "github.com/hyperledger/aries-framework-go/spi/crypto" "github.com/hyperledger/aries-framework-go/spi/kms" diff --git a/component/models/jwt/didsignjwt/signjwt.go b/component/models/jwt/didsignjwt/signjwt.go index 096686650..4ad5a49aa 100644 --- a/component/models/jwt/didsignjwt/signjwt.go +++ b/component/models/jwt/didsignjwt/signjwt.go @@ -11,9 +11,10 @@ import ( "fmt" "strings" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/jwkkid" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/kmssigner" + "github.com/trustbloc/kms-go/doc/jose" + "github.com/trustbloc/kms-go/doc/util/jwkkid" + "github.com/trustbloc/kms-go/doc/util/kmssigner" + "github.com/hyperledger/aries-framework-go/component/models/did" "github.com/hyperledger/aries-framework-go/component/models/did/util/vmparse" "github.com/hyperledger/aries-framework-go/component/models/jwt" diff --git a/component/models/jwt/jwt.go b/component/models/jwt/jwt.go index 30e4e82df..50b5400e5 100644 --- a/component/models/jwt/jwt.go +++ b/component/models/jwt/jwt.go @@ -17,7 +17,7 @@ import ( "github.com/go-jose/go-jose/v3/json" "github.com/go-jose/go-jose/v3/jwt" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/trustbloc/kms-go/doc/jose" ) const ( diff --git a/component/models/jwt/jwt_support.go b/component/models/jwt/jwt_support.go index 3410c2905..8ad83f891 100644 --- a/component/models/jwt/jwt_support.go +++ b/component/models/jwt/jwt_support.go @@ -14,7 +14,7 @@ import ( "crypto/rsa" "errors" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/trustbloc/kms-go/doc/jose" ) // JoseED25519Signer is a Jose compliant signer. diff --git a/component/models/jwt/jwt_test.go b/component/models/jwt/jwt_test.go index db472bcb8..a0e0b3cae 100644 --- a/component/models/jwt/jwt_test.go +++ b/component/models/jwt/jwt_test.go @@ -21,7 +21,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/trustbloc/kms-go/doc/jose" ) type CustomClaim struct { diff --git a/component/models/jwt/verifier.go b/component/models/jwt/verifier.go index f02805965..45ffc5202 100644 --- a/component/models/jwt/verifier.go +++ b/component/models/jwt/verifier.go @@ -16,7 +16,8 @@ import ( "golang.org/x/crypto/ed25519" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/trustbloc/kms-go/doc/jose" + "github.com/hyperledger/aries-framework-go/component/models/signature/verifier" kmsapi "github.com/hyperledger/aries-framework-go/spi/kms" ) diff --git a/component/models/jwt/verifier_test.go b/component/models/jwt/verifier_test.go index beb486471..f8a85cbd3 100644 --- a/component/models/jwt/verifier_test.go +++ b/component/models/jwt/verifier_test.go @@ -23,8 +23,9 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" + "github.com/trustbloc/kms-go/doc/jose" + "github.com/trustbloc/kms-go/doc/jose/jwk" + "github.com/hyperledger/aries-framework-go/component/models/signature/verifier" "github.com/hyperledger/aries-framework-go/spi/kms" ) diff --git a/component/models/presexch/definition.go b/component/models/presexch/definition.go index 5e932d559..984fa4a87 100644 --- a/component/models/presexch/definition.go +++ b/component/models/presexch/definition.go @@ -24,7 +24,8 @@ import ( "github.com/hyperledger/aries-framework-go/component/models/presexch/internal/requirementlogic" - "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" "github.com/hyperledger/aries-framework-go/component/models/jwt" "github.com/hyperledger/aries-framework-go/component/models/sdjwt/common" diff --git a/component/models/presexch/definition_test.go b/component/models/presexch/definition_test.go index 7a6a51196..b6bf79753 100644 --- a/component/models/presexch/definition_test.go +++ b/component/models/presexch/definition_test.go @@ -23,12 +23,13 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/fingerprint" - "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/primitive/bbs12381g2pub" + "github.com/trustbloc/kms-go/crypto/tinkcrypto" + "github.com/trustbloc/kms-go/doc/util/fingerprint" + "github.com/trustbloc/kms-go/kms/localkms" + mockkms "github.com/trustbloc/kms-go/mock/kms" + "github.com/trustbloc/kms-go/secretlock/noop" + "github.com/hyperledger/aries-framework-go/component/storageutil/mock/storage" "github.com/hyperledger/aries-framework-go/spi/kms" diff --git a/component/models/presexch/example_v2_test.go b/component/models/presexch/example_v2_test.go index bb6e91080..6bb54b3ff 100644 --- a/component/models/presexch/example_v2_test.go +++ b/component/models/presexch/example_v2_test.go @@ -17,7 +17,8 @@ import ( "github.com/piprate/json-gold/ld" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" + "github.com/trustbloc/kms-go/crypto/primitive/bbs12381g2pub" + ldprocessor "github.com/hyperledger/aries-framework-go/component/models/ld/processor" ldtestutil "github.com/hyperledger/aries-framework-go/component/models/ld/testutil" . "github.com/hyperledger/aries-framework-go/component/models/presexch" diff --git a/component/models/presexch/match_submission_requirements_test.go b/component/models/presexch/match_submission_requirements_test.go index b381a3443..6a7fcd310 100644 --- a/component/models/presexch/match_submission_requirements_test.go +++ b/component/models/presexch/match_submission_requirements_test.go @@ -17,7 +17,8 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" + "github.com/trustbloc/kms-go/crypto/primitive/bbs12381g2pub" + ldprocessor "github.com/hyperledger/aries-framework-go/component/models/ld/processor" "github.com/hyperledger/aries-framework-go/component/models/presexch" "github.com/hyperledger/aries-framework-go/component/models/signature/suite" diff --git a/component/models/sdjwt/common/common_test.go b/component/models/sdjwt/common/common_test.go index 74e917486..c16af946b 100644 --- a/component/models/sdjwt/common/common_test.go +++ b/component/models/sdjwt/common/common_test.go @@ -18,7 +18,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/trustbloc/kms-go/doc/jose" afjwt "github.com/hyperledger/aries-framework-go/component/models/jwt" utils "github.com/hyperledger/aries-framework-go/component/models/util/maphelpers" diff --git a/component/models/sdjwt/common/verification.go b/component/models/sdjwt/common/verification.go index 88919f651..cf77e948e 100644 --- a/component/models/sdjwt/common/verification.go +++ b/component/models/sdjwt/common/verification.go @@ -19,7 +19,7 @@ import ( "github.com/go-jose/go-jose/v3/jwt" "github.com/mitchellh/mapstructure" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/trustbloc/kms-go/doc/jose" afgjwt "github.com/hyperledger/aries-framework-go/component/models/jwt" utils "github.com/hyperledger/aries-framework-go/component/models/util/maphelpers" @@ -352,7 +352,7 @@ func getDisclosureClaim(disclosure string, hash crypto.Hash) (*DisclosureClaim, } switch len(disclosureArr) { - case disclosureElementsAmountForArrayDigest: //array element + case disclosureElementsAmountForArrayDigest: // array element enrichWithArrayElement(claim, disclosureArr) case disclosureElementsAmountForSDDigest: if err = enrichWithSDElement(claim, disclosureArr); err != nil { diff --git a/component/models/sdjwt/common/verification_test.go b/component/models/sdjwt/common/verification_test.go index f0818c865..b622dbf74 100644 --- a/component/models/sdjwt/common/verification_test.go +++ b/component/models/sdjwt/common/verification_test.go @@ -17,7 +17,8 @@ import ( "github.com/go-jose/go-jose/v3/jwt" "github.com/stretchr/testify/require" - afjose "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + afjose "github.com/trustbloc/kms-go/doc/jose" + afjwt "github.com/hyperledger/aries-framework-go/component/models/jwt" ) diff --git a/component/models/sdjwt/example_test.go b/component/models/sdjwt/example_test.go index 9bf0b93b0..9277e59bb 100644 --- a/component/models/sdjwt/example_test.go +++ b/component/models/sdjwt/example_test.go @@ -15,8 +15,9 @@ import ( "github.com/go-jose/go-jose/v3/jwt" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk/jwksupport" + "github.com/trustbloc/kms-go/doc/jose/jwk" + "github.com/trustbloc/kms-go/doc/jose/jwk/jwksupport" + afjwt "github.com/hyperledger/aries-framework-go/component/models/jwt" "github.com/hyperledger/aries-framework-go/component/models/sdjwt/holder" "github.com/hyperledger/aries-framework-go/component/models/sdjwt/issuer" diff --git a/component/models/sdjwt/holder/example_test.go b/component/models/sdjwt/holder/example_test.go index f9c737941..419c4a126 100644 --- a/component/models/sdjwt/holder/example_test.go +++ b/component/models/sdjwt/holder/example_test.go @@ -17,8 +17,9 @@ import ( "github.com/go-jose/go-jose/v3/jwt" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk/jwksupport" + "github.com/trustbloc/kms-go/doc/jose/jwk" + "github.com/trustbloc/kms-go/doc/jose/jwk/jwksupport" + afjwt "github.com/hyperledger/aries-framework-go/component/models/jwt" "github.com/hyperledger/aries-framework-go/component/models/sdjwt/common" "github.com/hyperledger/aries-framework-go/component/models/sdjwt/issuer" diff --git a/component/models/sdjwt/holder/holder.go b/component/models/sdjwt/holder/holder.go index 1cc414aec..494d45f9f 100644 --- a/component/models/sdjwt/holder/holder.go +++ b/component/models/sdjwt/holder/holder.go @@ -14,7 +14,7 @@ import ( "github.com/go-jose/go-jose/v3/jwt" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/trustbloc/kms-go/doc/jose" afgjwt "github.com/hyperledger/aries-framework-go/component/models/jwt" "github.com/hyperledger/aries-framework-go/component/models/sdjwt/common" diff --git a/component/models/sdjwt/holder/holder_test.go b/component/models/sdjwt/holder/holder_test.go index 58fde7d5a..adc5e5e8f 100644 --- a/component/models/sdjwt/holder/holder_test.go +++ b/component/models/sdjwt/holder/holder_test.go @@ -20,7 +20,8 @@ import ( "github.com/go-jose/go-jose/v3/jwt" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/trustbloc/kms-go/doc/jose" + afjwt "github.com/hyperledger/aries-framework-go/component/models/jwt" "github.com/hyperledger/aries-framework-go/component/models/sdjwt/common" "github.com/hyperledger/aries-framework-go/component/models/sdjwt/issuer" diff --git a/component/models/sdjwt/integration_test.go b/component/models/sdjwt/integration_test.go index b31460461..624f00dfa 100644 --- a/component/models/sdjwt/integration_test.go +++ b/component/models/sdjwt/integration_test.go @@ -19,7 +19,7 @@ import ( "github.com/go-jose/go-jose/v3/jwt" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk/jwksupport" + "github.com/trustbloc/kms-go/doc/jose/jwk/jwksupport" afjwt "github.com/hyperledger/aries-framework-go/component/models/jwt" "github.com/hyperledger/aries-framework-go/component/models/sdjwt/common" @@ -376,7 +376,7 @@ func TestSDJWTFlow(t *testing.T) { token, err := issuer.NewFromVC(vc, nil, signer, issuer.WithHolderPublicKey(holderPublicJWK), issuer.WithStructuredClaims(true), - //issuer.WithNonSelectivelyDisclosableClaims([]string{"id", "degree.type"}), + // issuer.WithNonSelectivelyDisclosableClaims([]string{"id", "degree.type"}), issuer.WithSDJWTVersion(common.SDJWTVersionV5), ) r.NoError(err) diff --git a/component/models/sdjwt/issuer/issuer.go b/component/models/sdjwt/issuer/issuer.go index e36b4e1ce..3c4e180ad 100644 --- a/component/models/sdjwt/issuer/issuer.go +++ b/component/models/sdjwt/issuer/issuer.go @@ -53,8 +53,8 @@ import ( "github.com/go-jose/go-jose/v3/jwt" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" + "github.com/trustbloc/kms-go/doc/jose" + "github.com/trustbloc/kms-go/doc/jose/jwk" afgjwt "github.com/hyperledger/aries-framework-go/component/models/jwt" "github.com/hyperledger/aries-framework-go/component/models/sdjwt/common" diff --git a/component/models/sdjwt/issuer/issuer_test.go b/component/models/sdjwt/issuer/issuer_test.go index 99fe7d051..ebac59af1 100644 --- a/component/models/sdjwt/issuer/issuer_test.go +++ b/component/models/sdjwt/issuer/issuer_test.go @@ -24,9 +24,9 @@ import ( "github.com/go-jose/go-jose/v3/jwt" "github.com/stretchr/testify/require" - afjose "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk/jwksupport" + afjose "github.com/trustbloc/kms-go/doc/jose" + "github.com/trustbloc/kms-go/doc/jose/jwk" + "github.com/trustbloc/kms-go/doc/jose/jwk/jwksupport" afjwt "github.com/hyperledger/aries-framework-go/component/models/jwt" "github.com/hyperledger/aries-framework-go/component/models/sdjwt/common" diff --git a/component/models/sdjwt/verifier/verifier.go b/component/models/sdjwt/verifier/verifier.go index 00ba97ecd..771b77f92 100644 --- a/component/models/sdjwt/verifier/verifier.go +++ b/component/models/sdjwt/verifier/verifier.go @@ -16,8 +16,9 @@ import ( "fmt" "time" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" + "github.com/trustbloc/kms-go/doc/jose" + "github.com/trustbloc/kms-go/doc/jose/jwk" + afgjwt "github.com/hyperledger/aries-framework-go/component/models/jwt" "github.com/hyperledger/aries-framework-go/component/models/sdjwt/common" "github.com/hyperledger/aries-framework-go/component/models/signature/verifier" diff --git a/component/models/sdjwt/verifier/verifier_test.go b/component/models/sdjwt/verifier/verifier_test.go index 42ff36d43..4d54fb768 100644 --- a/component/models/sdjwt/verifier/verifier_test.go +++ b/component/models/sdjwt/verifier/verifier_test.go @@ -22,8 +22,9 @@ import ( "github.com/go-jose/go-jose/v3/jwt" "github.com/stretchr/testify/require" - afjose "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk/jwksupport" + afjose "github.com/trustbloc/kms-go/doc/jose" + "github.com/trustbloc/kms-go/doc/jose/jwk/jwksupport" + afjwt "github.com/hyperledger/aries-framework-go/component/models/jwt" "github.com/hyperledger/aries-framework-go/component/models/sdjwt/common" "github.com/hyperledger/aries-framework-go/component/models/sdjwt/holder" diff --git a/component/models/signature/api/api.go b/component/models/signature/api/api.go index ddba2f73d..b807dfed5 100644 --- a/component/models/signature/api/api.go +++ b/component/models/signature/api/api.go @@ -7,7 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package api import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" + "github.com/trustbloc/kms-go/doc/jose/jwk" + "github.com/hyperledger/aries-framework-go/component/models/ld/processor" ) diff --git a/component/models/signature/signer/signer_test.go b/component/models/signature/signer/signer_test.go index 8734eb5c5..0e1c0b24c 100644 --- a/component/models/signature/signer/signer_test.go +++ b/component/models/signature/signer/signer_test.go @@ -12,10 +12,11 @@ import ( "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto" - "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/kms/localkms" + mockkms "github.com/trustbloc/kms-go/mock/kms" + "github.com/trustbloc/kms-go/secretlock/noop" + "github.com/hyperledger/aries-framework-go/component/models/ld/proof" "github.com/hyperledger/aries-framework-go/component/models/ld/testutil" "github.com/hyperledger/aries-framework-go/component/models/signature/suite" diff --git a/component/models/signature/suite/bbsblssignature2020/public_key_verifier_test.go b/component/models/signature/suite/bbsblssignature2020/public_key_verifier_test.go index 37c9d98da..02b71920a 100644 --- a/component/models/signature/suite/bbsblssignature2020/public_key_verifier_test.go +++ b/component/models/signature/suite/bbsblssignature2020/public_key_verifier_test.go @@ -12,7 +12,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" + "github.com/trustbloc/kms-go/doc/jose/jwk" + sigverifier "github.com/hyperledger/aries-framework-go/component/models/signature/verifier" ) diff --git a/component/models/signature/suite/bbsblssignatureproof2020/public_key_verifier_test.go b/component/models/signature/suite/bbsblssignatureproof2020/public_key_verifier_test.go index 56bd47839..6e4c780b2 100644 --- a/component/models/signature/suite/bbsblssignatureproof2020/public_key_verifier_test.go +++ b/component/models/signature/suite/bbsblssignatureproof2020/public_key_verifier_test.go @@ -12,7 +12,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" + "github.com/trustbloc/kms-go/doc/jose/jwk" + "github.com/hyperledger/aries-framework-go/component/models/signature/suite/bbsblssignatureproof2020" "github.com/hyperledger/aries-framework-go/component/models/signature/verifier" ) diff --git a/component/models/signature/suite/bbsblssignatureproof2020/signer.go b/component/models/signature/suite/bbsblssignatureproof2020/signer.go index 061a60d86..a30a16de5 100644 --- a/component/models/signature/suite/bbsblssignatureproof2020/signer.go +++ b/component/models/signature/suite/bbsblssignatureproof2020/signer.go @@ -12,7 +12,8 @@ import ( "fmt" "strings" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" + "github.com/trustbloc/kms-go/crypto/primitive/bbs12381g2pub" + "github.com/hyperledger/aries-framework-go/component/models/ld/processor" "github.com/hyperledger/aries-framework-go/component/models/ld/proof" sigverifier "github.com/hyperledger/aries-framework-go/component/models/signature/verifier" diff --git a/component/models/signature/suite/ecdsasecp256k1signature2019/public_key_verifier_test.go b/component/models/signature/suite/ecdsasecp256k1signature2019/public_key_verifier_test.go index 908546ac7..6c46d5b1a 100644 --- a/component/models/signature/suite/ecdsasecp256k1signature2019/public_key_verifier_test.go +++ b/component/models/signature/suite/ecdsasecp256k1signature2019/public_key_verifier_test.go @@ -12,11 +12,12 @@ import ( gojose "github.com/go-jose/go-jose/v3" "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/jwk" - "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/jwk" + "github.com/trustbloc/kms-go/kms/localkms" + mockkms "github.com/trustbloc/kms-go/mock/kms" + "github.com/trustbloc/kms-go/secretlock/noop" + signature "github.com/hyperledger/aries-framework-go/component/models/signature/util" "github.com/hyperledger/aries-framework-go/component/models/signature/verifier" "github.com/hyperledger/aries-framework-go/component/storageutil/mock/storage" diff --git a/component/models/signature/suite/ed25519signature2018/public_key_verifier_test.go b/component/models/signature/suite/ed25519signature2018/public_key_verifier_test.go index f952e8e19..3a5907817 100644 --- a/component/models/signature/suite/ed25519signature2018/public_key_verifier_test.go +++ b/component/models/signature/suite/ed25519signature2018/public_key_verifier_test.go @@ -11,10 +11,11 @@ import ( "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto" - "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/kms/localkms" + mockkms "github.com/trustbloc/kms-go/mock/kms" + "github.com/trustbloc/kms-go/secretlock/noop" + signature "github.com/hyperledger/aries-framework-go/component/models/signature/util" "github.com/hyperledger/aries-framework-go/component/models/signature/verifier" "github.com/hyperledger/aries-framework-go/component/storageutil/mock/storage" diff --git a/component/models/signature/suite/ed25519signature2018/suite_crypto_test.go b/component/models/signature/suite/ed25519signature2018/suite_crypto_test.go index 39480a505..9fe36f91b 100644 --- a/component/models/signature/suite/ed25519signature2018/suite_crypto_test.go +++ b/component/models/signature/suite/ed25519signature2018/suite_crypto_test.go @@ -13,10 +13,11 @@ import ( "github.com/google/tink/go/keyset" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto" - "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/kms/localkms" + mockkms "github.com/trustbloc/kms-go/mock/kms" + "github.com/trustbloc/kms-go/secretlock/noop" + "github.com/hyperledger/aries-framework-go/component/models/signature/suite" sigverifier "github.com/hyperledger/aries-framework-go/component/models/signature/verifier" "github.com/hyperledger/aries-framework-go/component/storageutil/mock/storage" diff --git a/component/models/signature/suite/ed25519signature2020/public_key_verifier_test.go b/component/models/signature/suite/ed25519signature2020/public_key_verifier_test.go index 2e92e59cf..fce862a29 100644 --- a/component/models/signature/suite/ed25519signature2020/public_key_verifier_test.go +++ b/component/models/signature/suite/ed25519signature2020/public_key_verifier_test.go @@ -11,10 +11,11 @@ import ( "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto" - "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/kms/localkms" + mockkms "github.com/trustbloc/kms-go/mock/kms" + "github.com/trustbloc/kms-go/secretlock/noop" + signature "github.com/hyperledger/aries-framework-go/component/models/signature/util" "github.com/hyperledger/aries-framework-go/component/models/signature/verifier" "github.com/hyperledger/aries-framework-go/component/storageutil/mock/storage" diff --git a/component/models/signature/suite/ed25519signature2020/suite_crypto_test.go b/component/models/signature/suite/ed25519signature2020/suite_crypto_test.go index 7dbaf71d7..5e3823778 100644 --- a/component/models/signature/suite/ed25519signature2020/suite_crypto_test.go +++ b/component/models/signature/suite/ed25519signature2020/suite_crypto_test.go @@ -13,10 +13,11 @@ import ( "github.com/google/tink/go/keyset" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto" - "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/kms/localkms" + mockkms "github.com/trustbloc/kms-go/mock/kms" + "github.com/trustbloc/kms-go/secretlock/noop" + "github.com/hyperledger/aries-framework-go/component/models/signature/suite" sigverifier "github.com/hyperledger/aries-framework-go/component/models/signature/verifier" "github.com/hyperledger/aries-framework-go/component/storageutil/mock/storage" diff --git a/component/models/signature/suite/jsonwebsignature2020/public_key_verifier_test.go b/component/models/signature/suite/jsonwebsignature2020/public_key_verifier_test.go index 30469db06..ced3db7a1 100644 --- a/component/models/signature/suite/jsonwebsignature2020/public_key_verifier_test.go +++ b/component/models/signature/suite/jsonwebsignature2020/public_key_verifier_test.go @@ -15,8 +15,9 @@ import ( gojose "github.com/go-jose/go-jose/v3" "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/jwk" + "github.com/trustbloc/kms-go/crypto/tinkcrypto" + "github.com/trustbloc/kms-go/doc/jose/jwk" + signature "github.com/hyperledger/aries-framework-go/component/models/signature/util" sigverifier "github.com/hyperledger/aries-framework-go/component/models/signature/verifier" kmsapi "github.com/hyperledger/aries-framework-go/spi/kms" diff --git a/component/models/signature/suite/jsonwebsignature2020/suite_crypto_test.go b/component/models/signature/suite/jsonwebsignature2020/suite_crypto_test.go index 456fd7b63..8cd737c82 100644 --- a/component/models/signature/suite/jsonwebsignature2020/suite_crypto_test.go +++ b/component/models/signature/suite/jsonwebsignature2020/suite_crypto_test.go @@ -13,10 +13,11 @@ import ( "github.com/google/tink/go/keyset" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto" - "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/kms/localkms" + mockkms "github.com/trustbloc/kms-go/mock/kms" + "github.com/trustbloc/kms-go/secretlock/noop" + sigverifier "github.com/hyperledger/aries-framework-go/component/models/signature/verifier" "github.com/hyperledger/aries-framework-go/component/storageutil/mock/storage" kmsapi "github.com/hyperledger/aries-framework-go/spi/kms" diff --git a/component/models/signature/suite/suite_crypto_test.go b/component/models/signature/suite/suite_crypto_test.go index 1c86f9821..7528b1ea9 100644 --- a/component/models/signature/suite/suite_crypto_test.go +++ b/component/models/signature/suite/suite_crypto_test.go @@ -12,7 +12,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/mock/crypto" + "github.com/trustbloc/kms-go/mock/crypto" + "github.com/hyperledger/aries-framework-go/component/models/signature/api" ) diff --git a/component/models/signature/util/internal/signer/crypto_signer_test.go b/component/models/signature/util/internal/signer/crypto_signer_test.go index 9187738e0..22fb15004 100644 --- a/component/models/signature/util/internal/signer/crypto_signer_test.go +++ b/component/models/signature/util/internal/signer/crypto_signer_test.go @@ -17,10 +17,11 @@ import ( "github.com/google/tink/go/keyset" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto" - "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/kms/localkms" + mockkms "github.com/trustbloc/kms-go/mock/kms" + "github.com/trustbloc/kms-go/secretlock/noop" + "github.com/hyperledger/aries-framework-go/component/storageutil/mock/storage" kmsapi "github.com/hyperledger/aries-framework-go/spi/kms" ) diff --git a/component/models/signature/util/signer.go b/component/models/signature/util/signer.go index 338ad8c24..fc16b8a66 100644 --- a/component/models/signature/util/signer.go +++ b/component/models/signature/util/signer.go @@ -12,7 +12,8 @@ import ( "crypto/rsa" "errors" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" + "github.com/trustbloc/kms-go/doc/jose/jwk" + cryptoapi "github.com/hyperledger/aries-framework-go/spi/crypto" kmsapi "github.com/hyperledger/aries-framework-go/spi/kms" diff --git a/component/models/signature/util/signer_test.go b/component/models/signature/util/signer_test.go index a1744a8a5..a171eae6b 100644 --- a/component/models/signature/util/signer_test.go +++ b/component/models/signature/util/signer_test.go @@ -19,11 +19,12 @@ import ( "github.com/go-jose/go-jose/v3" "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/jwk" - "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/jwk" + "github.com/trustbloc/kms-go/kms/localkms" + mockkms "github.com/trustbloc/kms-go/mock/kms" + "github.com/trustbloc/kms-go/secretlock/noop" + "github.com/hyperledger/aries-framework-go/component/storageutil/mock/storage" kmsapi "github.com/hyperledger/aries-framework-go/spi/kms" diff --git a/component/models/signature/verifier/public_key_verifier.go b/component/models/signature/verifier/public_key_verifier.go index ea9a5fbea..2aee84394 100644 --- a/component/models/signature/verifier/public_key_verifier.go +++ b/component/models/signature/verifier/public_key_verifier.go @@ -22,8 +22,8 @@ import ( "github.com/btcsuite/btcd/btcec" gojose "github.com/go-jose/go-jose/v3" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" + "github.com/trustbloc/kms-go/crypto/primitive/bbs12381g2pub" + "github.com/trustbloc/kms-go/doc/jose/jwk" ) // PublicKeyVerifier makes signature verification using the public key diff --git a/component/models/signature/verifier/public_key_verifier_test.go b/component/models/signature/verifier/public_key_verifier_test.go index 1c586d7a8..9aca528e6 100644 --- a/component/models/signature/verifier/public_key_verifier_test.go +++ b/component/models/signature/verifier/public_key_verifier_test.go @@ -19,11 +19,12 @@ import ( gojose "github.com/go-jose/go-jose/v3" "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/jwk" - "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/jwk" + "github.com/trustbloc/kms-go/kms/localkms" + mockkms "github.com/trustbloc/kms-go/mock/kms" + "github.com/trustbloc/kms-go/secretlock/noop" + "github.com/hyperledger/aries-framework-go/component/models/signature/util" mockstore "github.com/hyperledger/aries-framework-go/component/storageutil/mock/storage" kmsapi "github.com/hyperledger/aries-framework-go/spi/kms" diff --git a/component/models/verifiable/credential.go b/component/models/verifiable/credential.go index f988af64a..b91dbc3d9 100644 --- a/component/models/verifiable/credential.go +++ b/component/models/verifiable/credential.go @@ -18,13 +18,14 @@ import ( "strings" "time" - "github.com/hyperledger/aries-framework-go/component/models/dataintegrity" jsonld "github.com/piprate/json-gold/ld" "github.com/xeipuuv/gojsonschema" + "github.com/hyperledger/aries-framework-go/component/models/dataintegrity" + "github.com/hyperledger/aries-framework-go/component/log" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/trustbloc/kms-go/doc/jose" "github.com/hyperledger/aries-framework-go/component/models/jwt" docjsonld "github.com/hyperledger/aries-framework-go/component/models/ld/validator" diff --git a/component/models/verifiable/credential_bbs_test.go b/component/models/verifiable/credential_bbs_test.go index fa5347f85..6d8b3621b 100644 --- a/component/models/verifiable/credential_bbs_test.go +++ b/component/models/verifiable/credential_bbs_test.go @@ -13,7 +13,8 @@ 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" + jsonld "github.com/hyperledger/aries-framework-go/component/models/ld/processor" "github.com/hyperledger/aries-framework-go/component/models/signature/suite" "github.com/hyperledger/aries-framework-go/component/models/signature/suite/bbsblssignature2020" diff --git a/component/models/verifiable/credential_jws.go b/component/models/verifiable/credential_jws.go index a935e566f..f07cf7621 100644 --- a/component/models/verifiable/credential_jws.go +++ b/component/models/verifiable/credential_jws.go @@ -6,7 +6,7 @@ SPDX-License-Identifier: Apache-2.0 package verifiable import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/trustbloc/kms-go/doc/jose" ) // MarshalJWS serializes JWT into signed form (JWS). diff --git a/component/models/verifiable/credential_jws_test.go b/component/models/verifiable/credential_jws_test.go index 4c8f28cab..8011864dc 100644 --- a/component/models/verifiable/credential_jws_test.go +++ b/component/models/verifiable/credential_jws_test.go @@ -15,7 +15,8 @@ import ( "github.com/go-jose/go-jose/v3/jwt" "github.com/stretchr/testify/require" - ariesjose "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + ariesjose "github.com/trustbloc/kms-go/doc/jose" + "github.com/hyperledger/aries-framework-go/component/models/signature/verifier" "github.com/hyperledger/aries-framework-go/spi/kms" ) diff --git a/component/models/verifiable/credential_jwt.go b/component/models/verifiable/credential_jwt.go index d49f1bd0e..3884d5b2e 100644 --- a/component/models/verifiable/credential_jwt.go +++ b/component/models/verifiable/credential_jwt.go @@ -13,9 +13,9 @@ import ( josejwt "github.com/go-jose/go-jose/v3/jwt" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" "github.com/hyperledger/aries-framework-go/component/models/jwt" jsonutil "github.com/hyperledger/aries-framework-go/component/models/util/json" + "github.com/trustbloc/kms-go/doc/jose" ) const ( diff --git a/component/models/verifiable/credential_jwt_test.go b/component/models/verifiable/credential_jwt_test.go index dafa29322..7d092553b 100644 --- a/component/models/verifiable/credential_jwt_test.go +++ b/component/models/verifiable/credential_jwt_test.go @@ -14,7 +14,8 @@ import ( josejwt "github.com/go-jose/go-jose/v3/jwt" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/trustbloc/kms-go/doc/jose" + "github.com/hyperledger/aries-framework-go/component/models/jwt" ) diff --git a/component/models/verifiable/credential_jwt_unsecured.go b/component/models/verifiable/credential_jwt_unsecured.go index 0ed2aeb4e..230c01c5e 100644 --- a/component/models/verifiable/credential_jwt_unsecured.go +++ b/component/models/verifiable/credential_jwt_unsecured.go @@ -8,7 +8,7 @@ package verifiable import ( "fmt" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/trustbloc/kms-go/doc/jose" ) // MarshalUnsecuredJWT serialized JWT into unsecured JWT. diff --git a/component/models/verifiable/credential_jwt_unsecured_test.go b/component/models/verifiable/credential_jwt_unsecured_test.go index bf2e12d35..ad141382f 100644 --- a/component/models/verifiable/credential_jwt_unsecured_test.go +++ b/component/models/verifiable/credential_jwt_unsecured_test.go @@ -12,7 +12,7 @@ import ( "github.com/go-jose/go-jose/v3/jwt" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/trustbloc/kms-go/doc/jose" ) func TestCredentialJWTClaimsMarshallingToUnsecuredJWT(t *testing.T) { diff --git a/component/models/verifiable/credential_ldp_test.go b/component/models/verifiable/credential_ldp_test.go index fa537967c..80c9c00ca 100644 --- a/component/models/verifiable/credential_ldp_test.go +++ b/component/models/verifiable/credential_ldp_test.go @@ -19,11 +19,12 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk/jwksupport" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms/localkms" + "github.com/trustbloc/kms-go/crypto/primitive/bbs12381g2pub" + "github.com/trustbloc/kms-go/crypto/tinkcrypto" + "github.com/trustbloc/kms-go/doc/jose/jwk" + "github.com/trustbloc/kms-go/doc/jose/jwk/jwksupport" + "github.com/trustbloc/kms-go/kms/localkms" + ldcontext "github.com/hyperledger/aries-framework-go/component/models/ld/context" jsonldsig "github.com/hyperledger/aries-framework-go/component/models/ld/processor" "github.com/hyperledger/aries-framework-go/component/models/signature/suite" diff --git a/component/models/verifiable/credential_sdjwt.go b/component/models/verifiable/credential_sdjwt.go index 49fffa796..4a0e2a154 100644 --- a/component/models/verifiable/credential_sdjwt.go +++ b/component/models/verifiable/credential_sdjwt.go @@ -11,7 +11,7 @@ import ( "encoding/json" "fmt" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/trustbloc/kms-go/doc/jose" "github.com/hyperledger/aries-framework-go/component/models/sdjwt/common" "github.com/hyperledger/aries-framework-go/component/models/sdjwt/holder" diff --git a/component/models/verifiable/credential_sdjwt_test.go b/component/models/verifiable/credential_sdjwt_test.go index aca6ed345..2c2444bf9 100644 --- a/component/models/verifiable/credential_sdjwt_test.go +++ b/component/models/verifiable/credential_sdjwt_test.go @@ -18,7 +18,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/trustbloc/kms-go/doc/jose" + "github.com/hyperledger/aries-framework-go/spi/kms" afgojwt "github.com/hyperledger/aries-framework-go/component/models/jwt" diff --git a/component/models/verifiable/credential_test.go b/component/models/verifiable/credential_test.go index 48f4437eb..9eda4d3fa 100644 --- a/component/models/verifiable/credential_test.go +++ b/component/models/verifiable/credential_test.go @@ -20,7 +20,8 @@ import ( "github.com/xeipuuv/gojsonschema" "golang.org/x/exp/slices" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/trustbloc/kms-go/doc/jose" + "github.com/hyperledger/aries-framework-go/spi/kms" jsonld "github.com/hyperledger/aries-framework-go/component/models/ld/processor" diff --git a/component/models/verifiable/data_integrity_proof_test.go b/component/models/verifiable/data_integrity_proof_test.go index 24b4e08e1..663d2a36f 100644 --- a/component/models/verifiable/data_integrity_proof_test.go +++ b/component/models/verifiable/data_integrity_proof_test.go @@ -12,8 +12,9 @@ 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/util/jwkkid" + "github.com/trustbloc/kms-go/crypto/tinkcrypto" + "github.com/trustbloc/kms-go/doc/util/jwkkid" + "github.com/hyperledger/aries-framework-go/component/models/dataintegrity" "github.com/hyperledger/aries-framework-go/component/models/dataintegrity/suite/ecdsa2019" "github.com/hyperledger/aries-framework-go/component/models/did" diff --git a/component/models/verifiable/example_credential_test.go b/component/models/verifiable/example_credential_test.go index b9c73cf5a..8a26440ab 100644 --- a/component/models/verifiable/example_credential_test.go +++ b/component/models/verifiable/example_credential_test.go @@ -14,7 +14,8 @@ import ( "fmt" "time" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk/jwksupport" + "github.com/trustbloc/kms-go/doc/jose/jwk/jwksupport" + "github.com/hyperledger/aries-framework-go/component/log" jsonld "github.com/hyperledger/aries-framework-go/component/models/ld/processor" "github.com/hyperledger/aries-framework-go/component/models/signature/suite" diff --git a/component/models/verifiable/example_support_test.go b/component/models/verifiable/example_support_test.go index c5751615e..2f6ec4366 100644 --- a/component/models/verifiable/example_support_test.go +++ b/component/models/verifiable/example_support_test.go @@ -11,7 +11,8 @@ import ( "encoding/json" "strings" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" + "github.com/trustbloc/kms-go/crypto/primitive/bbs12381g2pub" + lddocloader "github.com/hyperledger/aries-framework-go/component/models/ld/documentloader" ldtestutil "github.com/hyperledger/aries-framework-go/component/models/ld/testutil" diff --git a/component/models/verifiable/jws.go b/component/models/verifiable/jws.go index 52b20ec59..429e39996 100644 --- a/component/models/verifiable/jws.go +++ b/component/models/verifiable/jws.go @@ -9,7 +9,8 @@ import ( "encoding/json" "fmt" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/trustbloc/kms-go/doc/jose" + "github.com/hyperledger/aries-framework-go/component/models/jwt" ) diff --git a/component/models/verifiable/jwt_unsecured.go b/component/models/verifiable/jwt_unsecured.go index c9c3c5624..a903e04c6 100644 --- a/component/models/verifiable/jwt_unsecured.go +++ b/component/models/verifiable/jwt_unsecured.go @@ -8,7 +8,8 @@ package verifiable import ( "fmt" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/trustbloc/kms-go/doc/jose" + "github.com/hyperledger/aries-framework-go/component/models/jwt" ) diff --git a/component/models/verifiable/jwt_unsecured_test.go b/component/models/verifiable/jwt_unsecured_test.go index 96950fb6c..277ff2369 100644 --- a/component/models/verifiable/jwt_unsecured_test.go +++ b/component/models/verifiable/jwt_unsecured_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/trustbloc/kms-go/doc/jose" ) func TestUnsecuredJWT(t *testing.T) { diff --git a/component/models/verifiable/linked_data_proof_test.go b/component/models/verifiable/linked_data_proof_test.go index 810e26353..556180f53 100644 --- a/component/models/verifiable/linked_data_proof_test.go +++ b/component/models/verifiable/linked_data_proof_test.go @@ -14,7 +14,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk/jwksupport" + "github.com/trustbloc/kms-go/doc/jose/jwk/jwksupport" + ldprocessor "github.com/hyperledger/aries-framework-go/component/models/ld/processor" "github.com/hyperledger/aries-framework-go/component/models/signature/suite" "github.com/hyperledger/aries-framework-go/component/models/signature/suite/ecdsasecp256k1signature2019" diff --git a/component/models/verifiable/presentation.go b/component/models/verifiable/presentation.go index d39503100..10804e1f3 100644 --- a/component/models/verifiable/presentation.go +++ b/component/models/verifiable/presentation.go @@ -15,7 +15,8 @@ import ( "github.com/hyperledger/aries-framework-go/component/models/dataintegrity" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/trustbloc/kms-go/doc/jose" + "github.com/hyperledger/aries-framework-go/component/models/jwt" docjsonld "github.com/hyperledger/aries-framework-go/component/models/ld/validator" "github.com/hyperledger/aries-framework-go/component/models/signature/verifier" diff --git a/component/models/verifiable/presentation_jwt_unsecured_test.go b/component/models/verifiable/presentation_jwt_unsecured_test.go index 4eb3f050e..0fc330374 100644 --- a/component/models/verifiable/presentation_jwt_unsecured_test.go +++ b/component/models/verifiable/presentation_jwt_unsecured_test.go @@ -11,7 +11,7 @@ import ( "github.com/go-jose/go-jose/v3/jwt" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/trustbloc/kms-go/doc/jose" ) func TestJWTPresClaims_MarshalUnsecuredJWT(t *testing.T) { diff --git a/component/models/verifiable/support_test.go b/component/models/verifiable/support_test.go index 93765d9c5..44455bebb 100644 --- a/component/models/verifiable/support_test.go +++ b/component/models/verifiable/support_test.go @@ -13,10 +13,11 @@ import ( "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto" - "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/kms/localkms" + mockkms "github.com/trustbloc/kms-go/mock/kms" + "github.com/trustbloc/kms-go/secretlock/noop" + ldcontext "github.com/hyperledger/aries-framework-go/component/models/ld/context" lddocloader "github.com/hyperledger/aries-framework-go/component/models/ld/documentloader" jsonldsig "github.com/hyperledger/aries-framework-go/component/models/ld/processor" diff --git a/component/vdr/httpbinding/resolver_interop.go b/component/vdr/httpbinding/resolver_interop.go index 9908a969e..41d8eef18 100644 --- a/component/vdr/httpbinding/resolver_interop.go +++ b/component/vdr/httpbinding/resolver_interop.go @@ -12,7 +12,8 @@ package httpbinding import ( "strings" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/fingerprint" + "github.com/trustbloc/kms-go/doc/util/fingerprint" + diddoc "github.com/hyperledger/aries-framework-go/component/models/did" ) diff --git a/component/vdr/key/creator.go b/component/vdr/key/creator.go index ccd96b93e..684dfd775 100644 --- a/component/vdr/key/creator.go +++ b/component/vdr/key/creator.go @@ -10,8 +10,9 @@ import ( "fmt" "time" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/fingerprint" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/util/cryptoutil" + "github.com/trustbloc/kms-go/doc/util/fingerprint" + "github.com/trustbloc/kms-go/util/cryptoutil" + "github.com/hyperledger/aries-framework-go/component/models/did" vdrspi "github.com/hyperledger/aries-framework-go/spi/vdr" ) diff --git a/component/vdr/key/creator_test.go b/component/vdr/key/creator_test.go index 5267d3c71..f02c41786 100644 --- a/component/vdr/key/creator_test.go +++ b/component/vdr/key/creator_test.go @@ -16,7 +16,8 @@ import ( "github.com/btcsuite/btcutil/base58" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk/jwksupport" + "github.com/trustbloc/kms-go/doc/jose/jwk/jwksupport" + "github.com/hyperledger/aries-framework-go/component/models/did" ) diff --git a/component/vdr/key/resolver.go b/component/vdr/key/resolver.go index d197851f4..2a0098434 100644 --- a/component/vdr/key/resolver.go +++ b/component/vdr/key/resolver.go @@ -12,10 +12,10 @@ import ( "fmt" "regexp" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk/jwksupport" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/fingerprint" "github.com/hyperledger/aries-framework-go/component/models/did" vdrspi "github.com/hyperledger/aries-framework-go/spi/vdr" + "github.com/trustbloc/kms-go/doc/jose/jwk/jwksupport" + "github.com/trustbloc/kms-go/doc/util/fingerprint" ) // Read expands did:key value to a DID document. diff --git a/component/vdr/key/resolver_test.go b/component/vdr/key/resolver_test.go index bf67148c0..bfe74792e 100644 --- a/component/vdr/key/resolver_test.go +++ b/component/vdr/key/resolver_test.go @@ -14,7 +14,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/fingerprint" + "github.com/trustbloc/kms-go/doc/util/fingerprint" ) func TestReadInvalid(t *testing.T) { diff --git a/component/vdr/peer/creator.go b/component/vdr/peer/creator.go index 35b996822..ec49b7532 100644 --- a/component/vdr/peer/creator.go +++ b/component/vdr/peer/creator.go @@ -14,7 +14,8 @@ import ( "github.com/btcsuite/btcutil/base58" "github.com/google/uuid" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/fingerprint" + "github.com/trustbloc/kms-go/doc/util/fingerprint" + "github.com/hyperledger/aries-framework-go/component/models/did" "github.com/hyperledger/aries-framework-go/component/models/did/endpoint" vdrapi "github.com/hyperledger/aries-framework-go/component/vdr/api" diff --git a/component/vdr/peer/creator_test.go b/component/vdr/peer/creator_test.go index fa29715a0..f79b6cea5 100644 --- a/component/vdr/peer/creator_test.go +++ b/component/vdr/peer/creator_test.go @@ -16,11 +16,12 @@ import ( "github.com/btcsuite/btcutil/base58" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/fingerprint" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/jwkkid" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms/localkms" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/secretlock/noop" + "github.com/trustbloc/kms-go/doc/util/fingerprint" + "github.com/trustbloc/kms-go/doc/util/jwkkid" + "github.com/trustbloc/kms-go/kms" + "github.com/trustbloc/kms-go/kms/localkms" + "github.com/trustbloc/kms-go/secretlock/noop" + "github.com/hyperledger/aries-framework-go/component/models/did" "github.com/hyperledger/aries-framework-go/component/models/did/endpoint" "github.com/hyperledger/aries-framework-go/component/storageutil/mock/storage" diff --git a/go.mod b/go.mod index 2fc734a4c..76122b857 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,6 @@ require ( github.com/google/uuid v1.3.0 github.com/gorilla/mux v1.7.3 github.com/hyperledger/aries-framework-go/component/didconfig v0.0.0-20230622211121-852ce35730b4 - github.com/hyperledger/aries-framework-go/component/kmscrypto v0.0.0-20230622082138-3ffab1691857 github.com/hyperledger/aries-framework-go/component/log v0.0.0-20230427134832-0c9969493bd3 github.com/hyperledger/aries-framework-go/component/models v0.0.0-20230622171716-43af8054a539 github.com/hyperledger/aries-framework-go/component/storage/edv v0.0.0-20221025204933-b807371b6f1e @@ -36,6 +35,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/rs/cors v1.7.0 github.com/stretchr/testify v1.8.1 + github.com/trustbloc/kms-go v0.0.0-20230823163616-c9310a484f40 golang.org/x/crypto v0.1.0 nhooyr.io/websocket v1.8.3 ) @@ -48,6 +48,7 @@ require ( github.com/consensys/gnark-crypto v0.9.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/golang/snappy v0.0.4 // indirect + github.com/hyperledger/aries-framework-go/component/kmscrypto v0.0.0-20230622082138-3ffab1691857 // indirect github.com/hyperledger/fabric-amcl v0.0.0-20230602173724-9e02669dceb2 // indirect github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a // indirect github.com/kawamuray/jsonpath v0.0.0-20201211160320-7483bafabd7e // indirect @@ -82,3 +83,5 @@ require ( ) replace github.com/hyperledger/aries-framework-go/component/models => ./component/models +replace github.com/hyperledger/aries-framework-go/component/kmscrypto => ./component/kmscrypto +replace github.com/hyperledger/aries-framework-go/spi => ./spi diff --git a/go.sum b/go.sum index 2d5fc36dd..dff24a43e 100644 --- a/go.sum +++ b/go.sum @@ -165,6 +165,8 @@ github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/sjson v1.1.4 h1:bTSsPLdAYF5QNLSwYsKfBKKTnlGbIuhqL3CpRsjzGhg= github.com/tidwall/sjson v1.1.4/go.mod h1:wXpKXu8CtDjKAZ+3DrKY5ROCorDFahq8l0tey/Lx1fg= +github.com/trustbloc/kms-go v0.0.0-20230823163616-c9310a484f40 h1:ffs36Xhux4VizFvANdq1F2V/dNp1kgR91CiKShDV1RA= +github.com/trustbloc/kms-go v0.0.0-20230823163616-c9310a484f40/go.mod h1:AkTaHo5jhlJR2I4FyJCXaxUA/kEsauBUPBwVnAebeUU= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= diff --git a/pkg/crypto/crypto.go b/pkg/crypto/crypto.go index 9a0bfc7fe..eec31263d 100644 --- a/pkg/crypto/crypto.go +++ b/pkg/crypto/crypto.go @@ -15,7 +15,8 @@ package crypto import ( "crypto/ecdsa" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto" + "github.com/trustbloc/kms-go/crypto" + cryptoapi "github.com/hyperledger/aries-framework-go/spi/crypto" ) diff --git a/pkg/crypto/primitive/bbs12381g2pub/bbs.go b/pkg/crypto/primitive/bbs12381g2pub/bbs.go index 4e40eed75..fa0327d59 100644 --- a/pkg/crypto/primitive/bbs12381g2pub/bbs.go +++ b/pkg/crypto/primitive/bbs12381g2pub/bbs.go @@ -12,7 +12,7 @@ SPDX-License-Identifier: Apache-2.0 package bbs12381g2pub import ( - bbs "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" + bbs "github.com/trustbloc/kms-go/crypto/primitive/bbs12381g2pub" ) // BBSG2Pub defines BBS+ signature scheme where public key is a point in the field of G2. diff --git a/pkg/crypto/primitive/bbs12381g2pub/keys.go b/pkg/crypto/primitive/bbs12381g2pub/keys.go index f93f5ef4a..fa5fa8ff9 100644 --- a/pkg/crypto/primitive/bbs12381g2pub/keys.go +++ b/pkg/crypto/primitive/bbs12381g2pub/keys.go @@ -9,7 +9,7 @@ package bbs12381g2pub import ( "hash" - bbs "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" + bbs "github.com/trustbloc/kms-go/crypto/primitive/bbs12381g2pub" ) // PublicKey defines BLS Public Key. diff --git a/pkg/crypto/primitive/bbs12381g2pub/proof_of_knowledge.go b/pkg/crypto/primitive/bbs12381g2pub/proof_of_knowledge.go index f95bc86e0..4bea4e111 100644 --- a/pkg/crypto/primitive/bbs12381g2pub/proof_of_knowledge.go +++ b/pkg/crypto/primitive/bbs12381g2pub/proof_of_knowledge.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package bbs12381g2pub import ( - bbs "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" + bbs "github.com/trustbloc/kms-go/crypto/primitive/bbs12381g2pub" ) // PoKOfSignature is Proof of Knowledge of a Signature that is used by the prover to construct PoKOfSignatureProof. diff --git a/pkg/crypto/primitive/bbs12381g2pub/signature.go b/pkg/crypto/primitive/bbs12381g2pub/signature.go index 05458741e..d074370b2 100644 --- a/pkg/crypto/primitive/bbs12381g2pub/signature.go +++ b/pkg/crypto/primitive/bbs12381g2pub/signature.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package bbs12381g2pub import ( - bbs "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" + bbs "github.com/trustbloc/kms-go/crypto/primitive/bbs12381g2pub" ) // Signature defines BLS signature. diff --git a/pkg/crypto/primitive/bbs12381g2pub/signature_message.go b/pkg/crypto/primitive/bbs12381g2pub/signature_message.go index e5f55a0ef..67acb4ba9 100644 --- a/pkg/crypto/primitive/bbs12381g2pub/signature_message.go +++ b/pkg/crypto/primitive/bbs12381g2pub/signature_message.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package bbs12381g2pub import ( - bbs "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" + bbs "github.com/trustbloc/kms-go/crypto/primitive/bbs12381g2pub" ) // SignatureMessage defines a message to be used for a signature check. diff --git a/pkg/crypto/primitive/bbs12381g2pub/signature_proof.go b/pkg/crypto/primitive/bbs12381g2pub/signature_proof.go index d9c79c83f..d3dfca39d 100644 --- a/pkg/crypto/primitive/bbs12381g2pub/signature_proof.go +++ b/pkg/crypto/primitive/bbs12381g2pub/signature_proof.go @@ -8,7 +8,7 @@ package bbs12381g2pub import ( ml "github.com/IBM/mathlib" - bbs "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" + bbs "github.com/trustbloc/kms-go/crypto/primitive/bbs12381g2pub" ) // PoKOfSignatureProof defines BLS signature proof. diff --git a/pkg/crypto/tinkcrypto/primitive/aead/aead.go b/pkg/crypto/tinkcrypto/primitive/aead/aead.go index 1c35c4112..0ead7a228 100644 --- a/pkg/crypto/tinkcrypto/primitive/aead/aead.go +++ b/pkg/crypto/tinkcrypto/primitive/aead/aead.go @@ -11,5 +11,5 @@ package aead import ( // import to initialize. - _ "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead" + _ "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead" ) diff --git a/pkg/crypto/tinkcrypto/primitive/aead/aead_key_templates.go b/pkg/crypto/tinkcrypto/primitive/aead/aead_key_templates.go index 10bde0c01..bcceb300f 100644 --- a/pkg/crypto/tinkcrypto/primitive/aead/aead_key_templates.go +++ b/pkg/crypto/tinkcrypto/primitive/aead/aead_key_templates.go @@ -9,7 +9,7 @@ package aead import ( tinkpb "github.com/google/tink/go/proto/tink_go_proto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead" ) // This file contains pre-generated KeyTemplates for AEAD keys. One can use these templates to generate new Keysets. diff --git a/pkg/crypto/tinkcrypto/primitive/aead/subtle/aes_cbc.go b/pkg/crypto/tinkcrypto/primitive/aead/subtle/aes_cbc.go index 21134cee8..b6b53e8e2 100644 --- a/pkg/crypto/tinkcrypto/primitive/aead/subtle/aes_cbc.go +++ b/pkg/crypto/tinkcrypto/primitive/aead/subtle/aes_cbc.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package subtle import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead/subtle" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead/subtle" ) const ( diff --git a/pkg/crypto/tinkcrypto/primitive/aead/subtle/gojose_aes_cbc_hmac.go b/pkg/crypto/tinkcrypto/primitive/aead/subtle/gojose_aes_cbc_hmac.go index 3a0a198e6..4bbc960a0 100644 --- a/pkg/crypto/tinkcrypto/primitive/aead/subtle/gojose_aes_cbc_hmac.go +++ b/pkg/crypto/tinkcrypto/primitive/aead/subtle/gojose_aes_cbc_hmac.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package subtle import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead/subtle" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead/subtle" ) // AESCBCHMAC is an implementation of AEAD interface. diff --git a/pkg/crypto/tinkcrypto/primitive/aead/subtle/subtle.go b/pkg/crypto/tinkcrypto/primitive/aead/subtle/subtle.go index 6dca76b96..76b9a2422 100644 --- a/pkg/crypto/tinkcrypto/primitive/aead/subtle/subtle.go +++ b/pkg/crypto/tinkcrypto/primitive/aead/subtle/subtle.go @@ -8,7 +8,7 @@ SPDX-License-Identifier: Apache-2.0 package subtle import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/aead/subtle" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/aead/subtle" ) const ( diff --git a/pkg/crypto/tinkcrypto/primitive/bbs/api/signer.go b/pkg/crypto/tinkcrypto/primitive/bbs/api/signer.go index f91d5abc1..d4800cc8b 100644 --- a/pkg/crypto/tinkcrypto/primitive/bbs/api/signer.go +++ b/pkg/crypto/tinkcrypto/primitive/bbs/api/signer.go @@ -6,7 +6,7 @@ SPDX-License-Identifier: Apache-2.0 package api -import "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/api" +import "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/bbs/api" // Signer is the signing interface primitive for BBS+ signatures used by Tink. type Signer = api.Signer diff --git a/pkg/crypto/tinkcrypto/primitive/bbs/api/verifier.go b/pkg/crypto/tinkcrypto/primitive/bbs/api/verifier.go index 97709aecf..9099ee7cc 100644 --- a/pkg/crypto/tinkcrypto/primitive/bbs/api/verifier.go +++ b/pkg/crypto/tinkcrypto/primitive/bbs/api/verifier.go @@ -6,7 +6,7 @@ SPDX-License-Identifier: Apache-2.0 package api -import "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/api" +import "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/bbs/api" // Verifier is the verification interface primitive for BBS+ signatures/proofs used by Tink. type Verifier = api.Verifier diff --git a/pkg/crypto/tinkcrypto/primitive/bbs/bbs.go b/pkg/crypto/tinkcrypto/primitive/bbs/bbs.go index 0d50d4f6d..2e4ef7b1d 100644 --- a/pkg/crypto/tinkcrypto/primitive/bbs/bbs.go +++ b/pkg/crypto/tinkcrypto/primitive/bbs/bbs.go @@ -90,5 +90,5 @@ package bbs import ( // import to initialize. - _ "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/bbs" + _ "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/bbs" ) diff --git a/pkg/crypto/tinkcrypto/primitive/bbs/bbs_key_template.go b/pkg/crypto/tinkcrypto/primitive/bbs/bbs_key_template.go index 5faf0b7d7..e27a9c05f 100644 --- a/pkg/crypto/tinkcrypto/primitive/bbs/bbs_key_template.go +++ b/pkg/crypto/tinkcrypto/primitive/bbs/bbs_key_template.go @@ -9,7 +9,7 @@ package bbs import ( tinkpb "github.com/google/tink/go/proto/tink_go_proto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/bbs" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/bbs" ) // BLS12381G2KeyTemplate creates a Tink key template for BBS+ on BLS12-381 curve with G2 group. diff --git a/pkg/crypto/tinkcrypto/primitive/bbs/bbs_signer_factory.go b/pkg/crypto/tinkcrypto/primitive/bbs/bbs_signer_factory.go index 6752c6644..27d3afb83 100644 --- a/pkg/crypto/tinkcrypto/primitive/bbs/bbs_signer_factory.go +++ b/pkg/crypto/tinkcrypto/primitive/bbs/bbs_signer_factory.go @@ -10,7 +10,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/bbs" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/bbs" bbsapi "github.com/hyperledger/aries-framework-go/pkg/crypto/tinkcrypto/primitive/bbs/api" ) diff --git a/pkg/crypto/tinkcrypto/primitive/bbs/bbs_verifier_factory.go b/pkg/crypto/tinkcrypto/primitive/bbs/bbs_verifier_factory.go index 8e8eea87f..f3f5c2821 100644 --- a/pkg/crypto/tinkcrypto/primitive/bbs/bbs_verifier_factory.go +++ b/pkg/crypto/tinkcrypto/primitive/bbs/bbs_verifier_factory.go @@ -10,7 +10,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/bbs" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/bbs" bbsapi "github.com/hyperledger/aries-framework-go/pkg/crypto/tinkcrypto/primitive/bbs/api" ) diff --git a/pkg/crypto/tinkcrypto/primitive/bbs/subtle/bls12381g2_signer.go b/pkg/crypto/tinkcrypto/primitive/bbs/subtle/bls12381g2_signer.go index 64d39f252..c6744b86c 100644 --- a/pkg/crypto/tinkcrypto/primitive/bbs/subtle/bls12381g2_signer.go +++ b/pkg/crypto/tinkcrypto/primitive/bbs/subtle/bls12381g2_signer.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package subtle import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/subtle" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/bbs/subtle" ) // BLS12381G2Signer is the BBS+ signer for BLS12-381 curve for keys on a G2 group. diff --git a/pkg/crypto/tinkcrypto/primitive/bbs/subtle/bls12381g2_verifier.go b/pkg/crypto/tinkcrypto/primitive/bbs/subtle/bls12381g2_verifier.go index 5f29ffa99..69b21d42a 100644 --- a/pkg/crypto/tinkcrypto/primitive/bbs/subtle/bls12381g2_verifier.go +++ b/pkg/crypto/tinkcrypto/primitive/bbs/subtle/bls12381g2_verifier.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package subtle import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/bbs/subtle" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/bbs/subtle" ) // BLS12381G2Verifier is the BBS+ signature/proof verifier for keys on BLS12-381 curve with a point in the G2 group. diff --git a/pkg/crypto/tinkcrypto/primitive/cl/api/blinder.go b/pkg/crypto/tinkcrypto/primitive/cl/api/blinder.go index 10dc8da34..ec7588127 100644 --- a/pkg/crypto/tinkcrypto/primitive/cl/api/blinder.go +++ b/pkg/crypto/tinkcrypto/primitive/cl/api/blinder.go @@ -10,7 +10,7 @@ SPDX-License-Identifier: Apache-2.0 package api import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/cl/api" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/api" ) // Blinder is the blinding interface primitive for CL Anoncreds used by Tink. diff --git a/pkg/crypto/tinkcrypto/primitive/cl/api/signer.go b/pkg/crypto/tinkcrypto/primitive/cl/api/signer.go index ae644385e..d7d55b54e 100644 --- a/pkg/crypto/tinkcrypto/primitive/cl/api/signer.go +++ b/pkg/crypto/tinkcrypto/primitive/cl/api/signer.go @@ -9,7 +9,7 @@ SPDX-License-Identifier: Apache-2.0 package api -import "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/cl/api" +import "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/api" // Signer is the signing interface primitive for CL Anoncreds used by Tink. type Signer = api.Signer diff --git a/pkg/crypto/tinkcrypto/primitive/cl/blinder/cl_blinder_factory.go b/pkg/crypto/tinkcrypto/primitive/cl/blinder/cl_blinder_factory.go index db0f57964..67bf09c55 100644 --- a/pkg/crypto/tinkcrypto/primitive/cl/blinder/cl_blinder_factory.go +++ b/pkg/crypto/tinkcrypto/primitive/cl/blinder/cl_blinder_factory.go @@ -13,7 +13,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/cl/blinder" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/blinder" clapi "github.com/hyperledger/aries-framework-go/pkg/crypto/tinkcrypto/primitive/cl/api" ) diff --git a/pkg/crypto/tinkcrypto/primitive/cl/blinder/cl_blinder_key_template.go b/pkg/crypto/tinkcrypto/primitive/cl/blinder/cl_blinder_key_template.go index 488e3dfec..554a07d98 100644 --- a/pkg/crypto/tinkcrypto/primitive/cl/blinder/cl_blinder_key_template.go +++ b/pkg/crypto/tinkcrypto/primitive/cl/blinder/cl_blinder_key_template.go @@ -12,7 +12,7 @@ package blinder import ( tinkpb "github.com/google/tink/go/proto/tink_go_proto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/cl/blinder" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/blinder" ) // MasterSecretKeyTemplate is for creating CL Master Secret key template. diff --git a/pkg/crypto/tinkcrypto/primitive/cl/blinder/init.go b/pkg/crypto/tinkcrypto/primitive/cl/blinder/init.go index d2b031816..e8e3c382b 100644 --- a/pkg/crypto/tinkcrypto/primitive/cl/blinder/init.go +++ b/pkg/crypto/tinkcrypto/primitive/cl/blinder/init.go @@ -11,5 +11,5 @@ package blinder import ( // import to initialize - _ "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/cl/blinder" + _ "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/blinder" ) diff --git a/pkg/crypto/tinkcrypto/primitive/cl/signer/cl_signer_factory.go b/pkg/crypto/tinkcrypto/primitive/cl/signer/cl_signer_factory.go index ac3fcb1d4..782410836 100644 --- a/pkg/crypto/tinkcrypto/primitive/cl/signer/cl_signer_factory.go +++ b/pkg/crypto/tinkcrypto/primitive/cl/signer/cl_signer_factory.go @@ -13,9 +13,9 @@ 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/cl/signer" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/signer" - clapi "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/cl/api" + clapi "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/api" ) // NewSigner returns a CL Signer primitive from the given keyset handle. diff --git a/pkg/crypto/tinkcrypto/primitive/cl/signer/cl_signer_key_template.go b/pkg/crypto/tinkcrypto/primitive/cl/signer/cl_signer_key_template.go index 17a2658ad..fbe875a2d 100644 --- a/pkg/crypto/tinkcrypto/primitive/cl/signer/cl_signer_key_template.go +++ b/pkg/crypto/tinkcrypto/primitive/cl/signer/cl_signer_key_template.go @@ -12,7 +12,7 @@ package signer import ( tinkpb "github.com/google/tink/go/proto/tink_go_proto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/signer" ) // CredDefKeyTemplate is for creating CL Cred Def key template. diff --git a/pkg/crypto/tinkcrypto/primitive/cl/signer/cl_signer_pubkey_helper.go b/pkg/crypto/tinkcrypto/primitive/cl/signer/cl_signer_pubkey_helper.go index 991cec3ef..b34ddabd8 100644 --- a/pkg/crypto/tinkcrypto/primitive/cl/signer/cl_signer_pubkey_helper.go +++ b/pkg/crypto/tinkcrypto/primitive/cl/signer/cl_signer_pubkey_helper.go @@ -12,7 +12,7 @@ package signer import ( "github.com/google/tink/go/keyset" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/signer" ) // ExportCredDefPubKey will export corresponding pubKey in bytes. diff --git a/pkg/crypto/tinkcrypto/primitive/cl/signer/init.go b/pkg/crypto/tinkcrypto/primitive/cl/signer/init.go index b24283824..a04862905 100644 --- a/pkg/crypto/tinkcrypto/primitive/cl/signer/init.go +++ b/pkg/crypto/tinkcrypto/primitive/cl/signer/init.go @@ -11,5 +11,5 @@ package signer import ( // import to initialize - _ "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/cl/signer" + _ "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/signer" ) diff --git a/pkg/crypto/tinkcrypto/primitive/cl/subtle/cl_blinder.go b/pkg/crypto/tinkcrypto/primitive/cl/subtle/cl_blinder.go index 81a24aba5..97aa0acd4 100644 --- a/pkg/crypto/tinkcrypto/primitive/cl/subtle/cl_blinder.go +++ b/pkg/crypto/tinkcrypto/primitive/cl/subtle/cl_blinder.go @@ -10,7 +10,7 @@ SPDX-License-Identifier: Apache-2.0 package subtle import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/cl/subtle" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/subtle" ) // CLBlinder is used for blinding CL MasterSecret with arbitrary values. diff --git a/pkg/crypto/tinkcrypto/primitive/cl/subtle/cl_signer.go b/pkg/crypto/tinkcrypto/primitive/cl/subtle/cl_signer.go index ecd6a1d87..abd87744b 100644 --- a/pkg/crypto/tinkcrypto/primitive/cl/subtle/cl_signer.go +++ b/pkg/crypto/tinkcrypto/primitive/cl/subtle/cl_signer.go @@ -10,7 +10,7 @@ SPDX-License-Identifier: Apache-2.0 package subtle import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/cl/subtle" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/cl/subtle" ) // CLSigner is used for CL signature using the provided CredDef key. diff --git a/pkg/crypto/tinkcrypto/primitive/composite/api/composite_decrypt.go b/pkg/crypto/tinkcrypto/primitive/composite/api/composite_decrypt.go index 0ee13c5e5..f30d4ac68 100644 --- a/pkg/crypto/tinkcrypto/primitive/composite/api/composite_decrypt.go +++ b/pkg/crypto/tinkcrypto/primitive/composite/api/composite_decrypt.go @@ -6,7 +6,7 @@ SPDX-License-Identifier: Apache-2.0 package api -import "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/api" +import "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/api" // CompositeDecrypt will decrypt a `ciphertext` representing a composite encryption with a protected cek for the // recipient caller of this interface. In order to get the plaintext embedded, this type is configured with the diff --git a/pkg/crypto/tinkcrypto/primitive/composite/api/composite_encrypt.go b/pkg/crypto/tinkcrypto/primitive/composite/api/composite_encrypt.go index 790524ad8..80f4e8fd5 100644 --- a/pkg/crypto/tinkcrypto/primitive/composite/api/composite_encrypt.go +++ b/pkg/crypto/tinkcrypto/primitive/composite/api/composite_encrypt.go @@ -6,7 +6,7 @@ SPDX-License-Identifier: Apache-2.0 package api -import "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/api" +import "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/api" // package api provides the composite primitive interfaces. These will be mainly used as the crypto primitives for // building protected JWE messages. diff --git a/pkg/crypto/tinkcrypto/primitive/composite/composite.go b/pkg/crypto/tinkcrypto/primitive/composite/composite.go index d76a9eb0d..3b1dcbd14 100644 --- a/pkg/crypto/tinkcrypto/primitive/composite/composite.go +++ b/pkg/crypto/tinkcrypto/primitive/composite/composite.go @@ -10,7 +10,7 @@ package composite import ( tinkpb "github.com/google/tink/go/proto/tink_go_proto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite" ) // EncryptedData represents the Encryption's output data as a result of ECDHEncrypt.Encrypt(pt, aad) call diff --git a/pkg/crypto/tinkcrypto/primitive/composite/ecdh/ecdh.go b/pkg/crypto/tinkcrypto/primitive/composite/ecdh/ecdh.go index bdaf0f66c..1803cf550 100644 --- a/pkg/crypto/tinkcrypto/primitive/composite/ecdh/ecdh.go +++ b/pkg/crypto/tinkcrypto/primitive/composite/ecdh/ecdh.go @@ -97,5 +97,5 @@ package ecdh import ( // import to initialize. - _ "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite" + _ "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite" ) diff --git a/pkg/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_decrypt_factory.go b/pkg/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_decrypt_factory.go index 7a75c464d..ae39b7824 100644 --- a/pkg/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_decrypt_factory.go +++ b/pkg/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_decrypt_factory.go @@ -10,8 +10,8 @@ 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/composite/api" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/api" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/ecdh" ) // NewECDHDecrypt returns an CompositeDecrypt primitive from the given keyset handle. diff --git a/pkg/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_encrypt_factory.go b/pkg/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_encrypt_factory.go index 95e377c67..002478f59 100644 --- a/pkg/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_encrypt_factory.go +++ b/pkg/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_encrypt_factory.go @@ -10,8 +10,8 @@ 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/composite/api" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/api" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/ecdh" ) // NewECDHEncrypt returns an CompositeEncrypt primitive from the given keyset handle. diff --git a/pkg/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_key_template.go b/pkg/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_key_template.go index 0f53e5c63..97062b21c 100644 --- a/pkg/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_key_template.go +++ b/pkg/crypto/tinkcrypto/primitive/composite/ecdh/ecdh_key_template.go @@ -9,7 +9,7 @@ package ecdh import ( tinkpb "github.com/google/tink/go/proto/tink_go_proto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/ecdh" ) // AEADAlg represents the AEAD implementation algorithm used by ECDH. diff --git a/pkg/crypto/tinkcrypto/primitive/composite/ecdh/subtle/ecdh_aes_aead_composite_decrypt.go b/pkg/crypto/tinkcrypto/primitive/composite/ecdh/subtle/ecdh_aes_aead_composite_decrypt.go index 9b0004f81..94bdc48bb 100644 --- a/pkg/crypto/tinkcrypto/primitive/composite/ecdh/subtle/ecdh_aes_aead_composite_decrypt.go +++ b/pkg/crypto/tinkcrypto/primitive/composite/ecdh/subtle/ecdh_aes_aead_composite_decrypt.go @@ -7,7 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package subtle import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/subtle" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/ecdh/subtle" + "github.com/hyperledger/aries-framework-go/pkg/crypto/tinkcrypto/primitive/composite" ) diff --git a/pkg/crypto/tinkcrypto/primitive/composite/ecdh/subtle/ecdh_aes_aead_composite_encrypt.go b/pkg/crypto/tinkcrypto/primitive/composite/ecdh/subtle/ecdh_aes_aead_composite_encrypt.go index 1e6ca1e6d..ecac4edb7 100644 --- a/pkg/crypto/tinkcrypto/primitive/composite/ecdh/subtle/ecdh_aes_aead_composite_encrypt.go +++ b/pkg/crypto/tinkcrypto/primitive/composite/ecdh/subtle/ecdh_aes_aead_composite_encrypt.go @@ -7,7 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package subtle import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/ecdh/subtle" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/ecdh/subtle" + "github.com/hyperledger/aries-framework-go/pkg/crypto/tinkcrypto/primitive/composite" ) diff --git a/pkg/crypto/tinkcrypto/primitive/composite/keyio/composite_key_export.go b/pkg/crypto/tinkcrypto/primitive/composite/keyio/composite_key_export.go index fc2c01ca4..03f2c1094 100644 --- a/pkg/crypto/tinkcrypto/primitive/composite/keyio/composite_key_export.go +++ b/pkg/crypto/tinkcrypto/primitive/composite/keyio/composite_key_export.go @@ -11,7 +11,7 @@ import ( "github.com/google/tink/go/keyset" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/composite/keyio" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/composite/keyio" cryptoapi "github.com/hyperledger/aries-framework-go/pkg/crypto" "github.com/hyperledger/aries-framework-go/pkg/crypto/tinkcrypto/primitive/composite/ecdh" diff --git a/pkg/crypto/tinkcrypto/primitive/secp256k1/secp256k1.go b/pkg/crypto/tinkcrypto/primitive/secp256k1/secp256k1.go index f58002f97..083b32409 100644 --- a/pkg/crypto/tinkcrypto/primitive/secp256k1/secp256k1.go +++ b/pkg/crypto/tinkcrypto/primitive/secp256k1/secp256k1.go @@ -12,7 +12,7 @@ import ( tinkpb "github.com/google/tink/go/proto/tink_go_proto" "github.com/google/tink/go/tink" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1" + "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/secp256k1" ) // This file contains pre-generated KeyTemplates for Signer and Verifier. diff --git a/pkg/crypto/tinkcrypto/primitive/secp256k1/subtle/subtle.go b/pkg/crypto/tinkcrypto/primitive/secp256k1/subtle/subtle.go index 58d06be1f..3067d5f89 100644 --- a/pkg/crypto/tinkcrypto/primitive/secp256k1/subtle/subtle.go +++ b/pkg/crypto/tinkcrypto/primitive/secp256k1/subtle/subtle.go @@ -12,7 +12,7 @@ import ( "crypto/elliptic" "math/big" - secp256k1subtle "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/secp256k1/subtle" + secp256k1subtle "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/secp256k1/subtle" ) // Secp256k1Signature is a struct holding the r and s values of an secp256k1 signature. diff --git a/pkg/crypto/tinkcrypto/tinkcrypto.go b/pkg/crypto/tinkcrypto/tinkcrypto.go index 7397bad3c..80ffb5d31 100644 --- a/pkg/crypto/tinkcrypto/tinkcrypto.go +++ b/pkg/crypto/tinkcrypto/tinkcrypto.go @@ -11,7 +11,7 @@ SPDX-License-Identifier: Apache-2.0 package tinkcrypto import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto" + "github.com/trustbloc/kms-go/crypto/tinkcrypto" ) const ( diff --git a/pkg/crypto/webkms/webkms.go b/pkg/crypto/webkms/webkms.go index fbf4d1340..52dd4884f 100644 --- a/pkg/crypto/webkms/webkms.go +++ b/pkg/crypto/webkms/webkms.go @@ -7,9 +7,9 @@ SPDX-License-Identifier: Apache-2.0 package webkms import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/webkms" + "github.com/trustbloc/kms-go/crypto/webkms" - webkmsimpl "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms/webkms" + webkmsimpl "github.com/trustbloc/kms-go/kms/webkms" ) // HTTPClient interface for the http client. diff --git a/pkg/didcomm/packer/anoncrypt/pack_test.go b/pkg/didcomm/packer/anoncrypt/pack_test.go index 5b964603b..d66834585 100644 --- a/pkg/didcomm/packer/anoncrypt/pack_test.go +++ b/pkg/didcomm/packer/anoncrypt/pack_test.go @@ -26,7 +26,7 @@ import ( tinkpb "github.com/google/tink/go/proto/tink_go_proto" "github.com/stretchr/testify/require" - ecdhpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" + ecdhpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" "github.com/hyperledger/aries-framework-go/pkg/common/log" cryptoapi "github.com/hyperledger/aries-framework-go/pkg/crypto" diff --git a/pkg/didcomm/packer/authcrypt/pack_test.go b/pkg/didcomm/packer/authcrypt/pack_test.go index bf4e926cb..cebc2b387 100644 --- a/pkg/didcomm/packer/authcrypt/pack_test.go +++ b/pkg/didcomm/packer/authcrypt/pack_test.go @@ -26,7 +26,7 @@ import ( tinkpb "github.com/google/tink/go/proto/tink_go_proto" "github.com/stretchr/testify/require" - ecdhpb "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" + ecdhpb "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto" "github.com/hyperledger/aries-framework-go/pkg/common/log" cryptoapi "github.com/hyperledger/aries-framework-go/pkg/crypto" diff --git a/pkg/doc/did/did.go b/pkg/doc/did/did.go index 49f0a21cd..0187b7fb6 100644 --- a/pkg/doc/did/did.go +++ b/pkg/doc/did/did.go @@ -10,7 +10,8 @@ import ( "github.com/multiformats/go-multibase" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" + "github.com/trustbloc/kms-go/doc/jose/jwk" + didmodel "github.com/hyperledger/aries-framework-go/component/models/did" ) diff --git a/pkg/doc/jose/common.go b/pkg/doc/jose/common.go index 7a4a4afd5..4b901c438 100644 --- a/pkg/doc/jose/common.go +++ b/pkg/doc/jose/common.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package jose import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/trustbloc/kms-go/doc/jose" ) // IANA registered JOSE headers (https://tools.ietf.org/html/rfc7515#section-4.1) diff --git a/pkg/doc/jose/decrypter.go b/pkg/doc/jose/decrypter.go index 1e3df97f5..8c7dea3e5 100644 --- a/pkg/doc/jose/decrypter.go +++ b/pkg/doc/jose/decrypter.go @@ -7,8 +7,9 @@ SPDX-License-Identifier: Apache-2.0 package jose import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" - resolver "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/kidresolver" + "github.com/trustbloc/kms-go/doc/jose" + resolver "github.com/trustbloc/kms-go/doc/jose/kidresolver" + cryptoapi "github.com/hyperledger/aries-framework-go/spi/crypto" "github.com/hyperledger/aries-framework-go/spi/kms" ) diff --git a/pkg/doc/jose/encrypter.go b/pkg/doc/jose/encrypter.go index 77fbe45da..9997a31bb 100644 --- a/pkg/doc/jose/encrypter.go +++ b/pkg/doc/jose/encrypter.go @@ -9,7 +9,8 @@ package jose import ( "github.com/google/tink/go/keyset" - jose2 "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + jose2 "github.com/trustbloc/kms-go/doc/jose" + cryptoapi "github.com/hyperledger/aries-framework-go/spi/crypto" ) diff --git a/pkg/doc/jose/jwe.go b/pkg/doc/jose/jwe.go index 820915485..a8619b004 100644 --- a/pkg/doc/jose/jwe.go +++ b/pkg/doc/jose/jwe.go @@ -9,7 +9,7 @@ SPDX-License-Identifier: Apache-2.0 package jose import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/trustbloc/kms-go/doc/jose" ) // JSONWebEncryption represents a JWE as defined in https://tools.ietf.org/html/rfc7516. diff --git a/pkg/doc/jose/jwk/jwk.go b/pkg/doc/jose/jwk/jwk.go index 7cc39c104..09a69a0ec 100644 --- a/pkg/doc/jose/jwk/jwk.go +++ b/pkg/doc/jose/jwk/jwk.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package jwk import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" + "github.com/trustbloc/kms-go/doc/jose/jwk" ) // JWK (JSON Web Key) is a JSON data structure that represents a cryptographic key. diff --git a/pkg/doc/jose/jwk/jwksupport/jwk.go b/pkg/doc/jose/jwk/jwksupport/jwk.go index aa8b38d15..a25940523 100644 --- a/pkg/doc/jose/jwk/jwksupport/jwk.go +++ b/pkg/doc/jose/jwk/jwksupport/jwk.go @@ -7,8 +7,9 @@ SPDX-License-Identifier: Apache-2.0 package jwksupport import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk/jwksupport" + "github.com/trustbloc/kms-go/doc/jose/jwk" + "github.com/trustbloc/kms-go/doc/jose/jwk/jwksupport" + "github.com/hyperledger/aries-framework-go/spi/crypto" "github.com/hyperledger/aries-framework-go/spi/kms" ) diff --git a/pkg/doc/jose/jws.go b/pkg/doc/jose/jws.go index 257657dee..5b7627cc0 100644 --- a/pkg/doc/jose/jws.go +++ b/pkg/doc/jose/jws.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package jose import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/trustbloc/kms-go/doc/jose" ) // JSONWebSignature defines JSON Web Signature (https://tools.ietf.org/html/rfc7515) diff --git a/pkg/doc/jose/kid/resolver/resolver.go b/pkg/doc/jose/kid/resolver/resolver.go index 66af14601..d5038bc68 100644 --- a/pkg/doc/jose/kid/resolver/resolver.go +++ b/pkg/doc/jose/kid/resolver/resolver.go @@ -7,7 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package resolver import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/kidresolver" + "github.com/trustbloc/kms-go/doc/jose/kidresolver" + "github.com/hyperledger/aries-framework-go/component/models/jose/diddocresolver" ) diff --git a/pkg/doc/jose/kid/resolver/resolver_test.go b/pkg/doc/jose/kid/resolver/resolver_test.go index 24d04756d..50ac5d7e1 100644 --- a/pkg/doc/jose/kid/resolver/resolver_test.go +++ b/pkg/doc/jose/kid/resolver/resolver_test.go @@ -22,9 +22,10 @@ import ( commonpb "github.com/google/tink/go/proto/common_go_proto" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk/jwksupport" + "github.com/trustbloc/kms-go/crypto/primitive/bbs12381g2pub" + "github.com/trustbloc/kms-go/doc/jose/jwk" + "github.com/trustbloc/kms-go/doc/jose/jwk/jwksupport" + "github.com/hyperledger/aries-framework-go/component/models/did" mockstorage "github.com/hyperledger/aries-framework-go/component/storageutil/mock/storage" cryptoapi "github.com/hyperledger/aries-framework-go/spi/crypto" diff --git a/pkg/doc/jwt/jwt.go b/pkg/doc/jwt/jwt.go index 0e8b37058..17c163eaa 100644 --- a/pkg/doc/jwt/jwt.go +++ b/pkg/doc/jwt/jwt.go @@ -7,7 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package jwt import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/trustbloc/kms-go/doc/jose" + "github.com/hyperledger/aries-framework-go/component/models/jwt" ) diff --git a/pkg/doc/presexch/api_test.go b/pkg/doc/presexch/api_test.go index 02e03d52a..fef9377b1 100644 --- a/pkg/doc/presexch/api_test.go +++ b/pkg/doc/presexch/api_test.go @@ -16,11 +16,12 @@ import ( jsonld "github.com/piprate/json-gold/ld" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/fingerprint" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms/localkms" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/secretlock/noop" + "github.com/trustbloc/kms-go/crypto/tinkcrypto" + "github.com/trustbloc/kms-go/doc/util/fingerprint" + "github.com/trustbloc/kms-go/kms" + "github.com/trustbloc/kms-go/kms/localkms" + "github.com/trustbloc/kms-go/secretlock/noop" + "github.com/hyperledger/aries-framework-go/component/models/did" ldcontext "github.com/hyperledger/aries-framework-go/component/models/ld/context" ldprocessor "github.com/hyperledger/aries-framework-go/component/models/ld/processor" diff --git a/pkg/doc/sdjwt/holder/holder.go b/pkg/doc/sdjwt/holder/holder.go index 5e3c752da..6e14a8fa8 100644 --- a/pkg/doc/sdjwt/holder/holder.go +++ b/pkg/doc/sdjwt/holder/holder.go @@ -10,7 +10,8 @@ package holder import ( "time" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/trustbloc/kms-go/doc/jose" + "github.com/hyperledger/aries-framework-go/component/models/sdjwt/holder" ) diff --git a/pkg/doc/sdjwt/issuer/issuer.go b/pkg/doc/sdjwt/issuer/issuer.go index 9cd62449d..62646bbd3 100644 --- a/pkg/doc/sdjwt/issuer/issuer.go +++ b/pkg/doc/sdjwt/issuer/issuer.go @@ -45,8 +45,9 @@ import ( "github.com/go-jose/go-jose/v3/jwt" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" + "github.com/trustbloc/kms-go/doc/jose" + "github.com/trustbloc/kms-go/doc/jose/jwk" + "github.com/hyperledger/aries-framework-go/component/models/sdjwt/common" "github.com/hyperledger/aries-framework-go/component/models/sdjwt/issuer" ) diff --git a/pkg/doc/sdjwt/verifier/verifier.go b/pkg/doc/sdjwt/verifier/verifier.go index 9a1f0b180..5b5d6ce3b 100644 --- a/pkg/doc/sdjwt/verifier/verifier.go +++ b/pkg/doc/sdjwt/verifier/verifier.go @@ -13,7 +13,8 @@ package verifier import ( "time" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/trustbloc/kms-go/doc/jose" + "github.com/hyperledger/aries-framework-go/component/models/sdjwt/verifier" ) diff --git a/pkg/doc/util/didsignjwt/didsignjwt_test.go b/pkg/doc/util/didsignjwt/didsignjwt_test.go index 3e08979cb..fa71c1ae4 100644 --- a/pkg/doc/util/didsignjwt/didsignjwt_test.go +++ b/pkg/doc/util/didsignjwt/didsignjwt_test.go @@ -13,10 +13,11 @@ import ( "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms/localkms" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/secretlock/noop" + "github.com/trustbloc/kms-go/crypto/tinkcrypto" + "github.com/trustbloc/kms-go/kms" + "github.com/trustbloc/kms-go/kms/localkms" + "github.com/trustbloc/kms-go/secretlock/noop" + "github.com/hyperledger/aries-framework-go/component/models/did" mockstorage "github.com/hyperledger/aries-framework-go/component/storageutil/mock/storage" vdrapi "github.com/hyperledger/aries-framework-go/component/vdr/api" diff --git a/pkg/doc/util/jwkkid/kid_creator.go b/pkg/doc/util/jwkkid/kid_creator.go index b568913ef..4c27b9cdd 100644 --- a/pkg/doc/util/jwkkid/kid_creator.go +++ b/pkg/doc/util/jwkkid/kid_creator.go @@ -7,8 +7,9 @@ SPDX-License-Identifier: Apache-2.0 package jwkkid import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/jwkkid" + "github.com/trustbloc/kms-go/doc/jose/jwk" + "github.com/trustbloc/kms-go/doc/util/jwkkid" + "github.com/hyperledger/aries-framework-go/spi/kms" ) diff --git a/pkg/doc/util/kmsdidkey/kmsdidkey.go b/pkg/doc/util/kmsdidkey/kmsdidkey.go index 095205972..6875a5576 100644 --- a/pkg/doc/util/kmsdidkey/kmsdidkey.go +++ b/pkg/doc/util/kmsdidkey/kmsdidkey.go @@ -8,7 +8,8 @@ SPDX-License-Identifier: Apache-2.0 package kmsdidkey import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/kmsdidkey" + "github.com/trustbloc/kms-go/doc/util/kmsdidkey" + cryptoapi "github.com/hyperledger/aries-framework-go/spi/crypto" "github.com/hyperledger/aries-framework-go/spi/kms" ) diff --git a/pkg/doc/util/signature/signature.go b/pkg/doc/util/signature/signature.go index 198b3177b..9eac503ab 100644 --- a/pkg/doc/util/signature/signature.go +++ b/pkg/doc/util/signature/signature.go @@ -10,7 +10,8 @@ import ( "crypto/ed25519" "crypto/elliptic" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" + "github.com/trustbloc/kms-go/doc/jose/jwk" + "github.com/hyperledger/aries-framework-go/component/models/signature/util" cryptoapi "github.com/hyperledger/aries-framework-go/spi/crypto" kmsapi "github.com/hyperledger/aries-framework-go/spi/kms" diff --git a/pkg/doc/verifiable/verifiable.go b/pkg/doc/verifiable/verifiable.go index df6e0cc31..36817772e 100644 --- a/pkg/doc/verifiable/verifiable.go +++ b/pkg/doc/verifiable/verifiable.go @@ -19,7 +19,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/spi/kms" "github.com/hyperledger/aries-framework-go/spi/vdr" diff --git a/pkg/internal/cryptoutil/utils.go b/pkg/internal/cryptoutil/utils.go index b61260cac..5ecc91499 100644 --- a/pkg/internal/cryptoutil/utils.go +++ b/pkg/internal/cryptoutil/utils.go @@ -9,7 +9,7 @@ package cryptoutil import ( chacha "golang.org/x/crypto/chacha20poly1305" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/util/cryptoutil" + "github.com/trustbloc/kms-go/util/cryptoutil" ) // DeriveECDHX25519 does X25519 ECDH using fromPrivKey and toPubKey. diff --git a/pkg/internal/kmssigner/wrapper.go b/pkg/internal/kmssigner/wrapper.go index 79cf293f3..cf2f278b6 100644 --- a/pkg/internal/kmssigner/wrapper.go +++ b/pkg/internal/kmssigner/wrapper.go @@ -7,7 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package kmssigner import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/kmssigner" + "github.com/trustbloc/kms-go/doc/util/kmssigner" + "github.com/hyperledger/aries-framework-go/spi/kms" ) diff --git a/pkg/kms/api.go b/pkg/kms/api.go index c9cf5ab8f..219bf9ada 100644 --- a/pkg/kms/api.go +++ b/pkg/kms/api.go @@ -7,7 +7,8 @@ package kms import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms" + "github.com/trustbloc/kms-go/kms" + kmsapi "github.com/hyperledger/aries-framework-go/spi/kms" ) diff --git a/pkg/kms/ariesProviderWrapper.go b/pkg/kms/ariesProviderWrapper.go index 72dcd0d0e..dcbda5062 100644 --- a/pkg/kms/ariesProviderWrapper.go +++ b/pkg/kms/ariesProviderWrapper.go @@ -7,7 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package kms import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms" + "github.com/trustbloc/kms-go/kms" + "github.com/hyperledger/aries-framework-go/spi/storage" ) diff --git a/pkg/kms/localkms/crypto_box.go b/pkg/kms/localkms/crypto_box.go index 4b16b2611..1bdeb47b9 100644 --- a/pkg/kms/localkms/crypto_box.go +++ b/pkg/kms/localkms/crypto_box.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package localkms import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms/localkms" + "github.com/trustbloc/kms-go/kms/localkms" "github.com/hyperledger/aries-framework-go/pkg/kms" ) diff --git a/pkg/kms/localkms/localkms.go b/pkg/kms/localkms/localkms.go index 32d3fbdfc..33fdab1ed 100644 --- a/pkg/kms/localkms/localkms.go +++ b/pkg/kms/localkms/localkms.go @@ -7,7 +7,8 @@ package localkms import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms/localkms" + "github.com/trustbloc/kms-go/kms/localkms" + "github.com/hyperledger/aries-framework-go/spi/kms" ) diff --git a/pkg/kms/webkms/crypto_box.go b/pkg/kms/webkms/crypto_box.go index 6dbc1fd4e..c10de4d82 100644 --- a/pkg/kms/webkms/crypto_box.go +++ b/pkg/kms/webkms/crypto_box.go @@ -7,7 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package webkms import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms/webkms" + "github.com/trustbloc/kms-go/kms/webkms" + "github.com/hyperledger/aries-framework-go/pkg/kms" ) diff --git a/pkg/kms/webkms/headers_opts.go b/pkg/kms/webkms/headers_opts.go index 7931265e6..a44f2541f 100644 --- a/pkg/kms/webkms/headers_opts.go +++ b/pkg/kms/webkms/headers_opts.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package webkms import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms/webkms" + "github.com/trustbloc/kms-go/kms/webkms" ) // Opts represents option. diff --git a/pkg/kms/webkms/remotekms.go b/pkg/kms/webkms/remotekms.go index dbd9c45f8..15fe82b57 100644 --- a/pkg/kms/webkms/remotekms.go +++ b/pkg/kms/webkms/remotekms.go @@ -9,7 +9,7 @@ package webkms import ( "net/http" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms/webkms" + "github.com/trustbloc/kms-go/kms/webkms" ) const ( diff --git a/pkg/mock/crypto/crypto.go b/pkg/mock/crypto/crypto.go index e60cc14db..515f0fbf1 100644 --- a/pkg/mock/crypto/crypto.go +++ b/pkg/mock/crypto/crypto.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package crypto import ( - mockcrypto "github.com/hyperledger/aries-framework-go/component/kmscrypto/mock/crypto" + mockcrypto "github.com/trustbloc/kms-go/mock/crypto" ) // SignFunc mocks Crypto's Sign() function, it's useful for executing custom signing with the help of SignKey. diff --git a/pkg/mock/kms/kms.go b/pkg/mock/kms/kms.go index 73d738d61..87981f02f 100644 --- a/pkg/mock/kms/kms.go +++ b/pkg/mock/kms/kms.go @@ -9,7 +9,8 @@ package kms import ( "github.com/google/tink/go/keyset" - mockkms "github.com/hyperledger/aries-framework-go/component/kmscrypto/mock/kms" + mockkms "github.com/trustbloc/kms-go/mock/kms" + "github.com/hyperledger/aries-framework-go/spi/secretlock" "github.com/hyperledger/aries-framework-go/spi/storage" ) diff --git a/pkg/mock/secretlock/secretlock.go b/pkg/mock/secretlock/secretlock.go index 175ea6ab0..f5f794505 100644 --- a/pkg/mock/secretlock/secretlock.go +++ b/pkg/mock/secretlock/secretlock.go @@ -6,7 +6,7 @@ SPDX-License-Identifier: Apache-2.0 package secretlock -import "github.com/hyperledger/aries-framework-go/component/kmscrypto/mock/secretlock" +import "github.com/trustbloc/kms-go/mock/secretlock" // MockSecretLock mocking a Secret Lock service. type MockSecretLock = secretlock.MockSecretLock diff --git a/pkg/secretlock/local/local.go b/pkg/secretlock/local/local.go index d860fde8f..a081cf462 100644 --- a/pkg/secretlock/local/local.go +++ b/pkg/secretlock/local/local.go @@ -37,7 +37,8 @@ package local import ( "io" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/secretlock/local" + "github.com/trustbloc/kms-go/secretlock/local" + "github.com/hyperledger/aries-framework-go/pkg/secretlock" ) diff --git a/pkg/secretlock/local/local_secret_masterkey_reader.go b/pkg/secretlock/local/local_secret_masterkey_reader.go index 4e49fcb3c..f8b2c2877 100644 --- a/pkg/secretlock/local/local_secret_masterkey_reader.go +++ b/pkg/secretlock/local/local_secret_masterkey_reader.go @@ -8,7 +8,7 @@ package local import ( "io" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/secretlock/local" + "github.com/trustbloc/kms-go/secretlock/local" ) // MasterKeyFromPath creates a new instance of a local secret lock Reader to read a master key stored in `path`. diff --git a/pkg/secretlock/local/masterlock/hkdf/hkdf.go b/pkg/secretlock/local/masterlock/hkdf/hkdf.go index 214506b7e..a841513d9 100644 --- a/pkg/secretlock/local/masterlock/hkdf/hkdf.go +++ b/pkg/secretlock/local/masterlock/hkdf/hkdf.go @@ -22,7 +22,7 @@ package hkdf import ( "hash" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/secretlock/local/masterlock/hkdf" + "github.com/trustbloc/kms-go/secretlock/local/masterlock/hkdf" "github.com/hyperledger/aries-framework-go/pkg/secretlock" ) diff --git a/pkg/secretlock/local/masterlock/pbkdf2/pbkdf2.go b/pkg/secretlock/local/masterlock/pbkdf2/pbkdf2.go index a1d7148b8..80da5476e 100644 --- a/pkg/secretlock/local/masterlock/pbkdf2/pbkdf2.go +++ b/pkg/secretlock/local/masterlock/pbkdf2/pbkdf2.go @@ -13,7 +13,7 @@ package pbkdf2 import ( "hash" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/secretlock/local/masterlock/pbkdf2" + "github.com/trustbloc/kms-go/secretlock/local/masterlock/pbkdf2" "github.com/hyperledger/aries-framework-go/pkg/secretlock" ) diff --git a/pkg/secretlock/noop/noop.go b/pkg/secretlock/noop/noop.go index 8862c4f75..54b64cfbc 100644 --- a/pkg/secretlock/noop/noop.go +++ b/pkg/secretlock/noop/noop.go @@ -11,7 +11,7 @@ SPDX-License-Identifier: Apache-2.0 package noop import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/secretlock/noop" + "github.com/trustbloc/kms-go/secretlock/noop" ) // NoLock is a secret lock service that does no key wrapping (keys are not encrypted). diff --git a/pkg/vdr/fingerprint/didfp/parse.go b/pkg/vdr/fingerprint/didfp/parse.go index df6b0dcd8..dbabe303c 100644 --- a/pkg/vdr/fingerprint/didfp/parse.go +++ b/pkg/vdr/fingerprint/didfp/parse.go @@ -6,7 +6,7 @@ SPDX-License-Identifier: Apache-2.0 package didfp import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/fingerprint" + "github.com/trustbloc/kms-go/doc/util/fingerprint" ) // MethodIDFromDIDKey parses the did:key DID and returns it's specific Method ID. diff --git a/pkg/vdr/fingerprint/fingerprint.go b/pkg/vdr/fingerprint/fingerprint.go index 83b6d59cf..4f3b90e35 100644 --- a/pkg/vdr/fingerprint/fingerprint.go +++ b/pkg/vdr/fingerprint/fingerprint.go @@ -7,8 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package fingerprint import ( - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/fingerprint" + "github.com/trustbloc/kms-go/doc/jose/jwk" + "github.com/trustbloc/kms-go/doc/util/fingerprint" ) const ( diff --git a/pkg/vdr/verifiable_compat_test.go b/pkg/vdr/verifiable_compat_test.go index 911fc8349..6a166455b 100644 --- a/pkg/vdr/verifiable_compat_test.go +++ b/pkg/vdr/verifiable_compat_test.go @@ -16,7 +16,8 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/kmsdidkey" + "github.com/trustbloc/kms-go/doc/util/kmsdidkey" + "github.com/hyperledger/aries-framework-go/component/models/did" "github.com/hyperledger/aries-framework-go/component/models/did/endpoint" ldtestutil "github.com/hyperledger/aries-framework-go/component/models/ld/testutil" diff --git a/proto/tink/aes_cbc.proto b/proto/tink/aes_cbc.proto index 04b82df87..06cfd2a6e 100644 --- a/proto/tink/aes_cbc.proto +++ b/proto/tink/aes_cbc.proto @@ -10,7 +10,7 @@ package google.crypto.tink; option java_package = "com.google.crypto.tink.proto"; option java_multiple_files = true; -option go_package = "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/aes_cbc_go_proto"; +option go_package = "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/aes_cbc_go_proto"; message AesCbcKeyFormat { uint32 key_size = 1; diff --git a/proto/tink/aes_cbc_hmac_aead.proto b/proto/tink/aes_cbc_hmac_aead.proto index a534b9200..d632f78cc 100644 --- a/proto/tink/aes_cbc_hmac_aead.proto +++ b/proto/tink/aes_cbc_hmac_aead.proto @@ -13,7 +13,7 @@ import "proto/hmac.proto"; option java_package = "com.google.crypto.tink.proto"; option java_multiple_files = true; -option go_package = "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/aes_cbc_hmac_aead_go_proto"; +option go_package = "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/aes_cbc_hmac_aead_go_proto"; message AesCbcHmacAeadKeyFormat { AesCbcKeyFormat aes_cbc_key_format = 1; diff --git a/proto/tink/bbs.proto b/proto/tink/bbs.proto index 2de9c008b..9a138cbcf 100644 --- a/proto/tink/bbs.proto +++ b/proto/tink/bbs.proto @@ -13,7 +13,7 @@ import "proto/common.proto"; option java_package = "com.google.crypto.tink.proto"; option java_multiple_files = true; option objc_class_prefix = "TINKPB"; -option go_package = "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/bbs_go_proto"; +option go_package = "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/bbs_go_proto"; // Protos keys for BBS+ signatures/proofs. // diff --git a/proto/tink/cl.proto b/proto/tink/cl.proto index 6667fb423..cca41ba3a 100644 --- a/proto/tink/cl.proto +++ b/proto/tink/cl.proto @@ -13,7 +13,7 @@ import "proto/common.proto"; option java_package = "com.google.crypto.tink.proto"; option java_multiple_files = true; option objc_class_prefix = "TINKPB"; -option go_package = "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/cl_go_proto"; +option go_package = "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/cl_go_proto"; // Protos CL Credential Definition keys diff --git a/proto/tink/ecdh_aead.proto b/proto/tink/ecdh_aead.proto index 35932f5a4..8634b37fb 100644 --- a/proto/tink/ecdh_aead.proto +++ b/proto/tink/ecdh_aead.proto @@ -14,7 +14,7 @@ import "proto/tink.proto"; option java_package = "com.google.crypto.tink.proto"; option java_multiple_files = true; option objc_class_prefix = "TINKPB"; -option go_package = "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto"; +option go_package = "github.com/trustbloc/kms-go/crypto/tinkcrypto/primitive/proto/ecdh_aead_go_proto"; // Protos keys for (external ECDH) KW and AEAD encryption. // diff --git a/spi/crypto/crypto.go b/spi/crypto/crypto.go index d959ec615..0534e359d 100644 --- a/spi/crypto/crypto.go +++ b/spi/crypto/crypto.go @@ -13,118 +13,16 @@ SPDX-License-Identifier: Apache-2.0 // primitives or via webkms for remote KMS BBS+ signing. package crypto +import "github.com/trustbloc/kms-go/spi/crypto" + // Crypto interface provides all crypto operations needed in the Aries framework. -type Crypto interface { - // Encrypt will encrypt msg and aad using a matching AEAD primitive in kh key handle of a public key - // returns: - // cipherText in []byte - // nonce in []byte - // error in case of errors during encryption - Encrypt(msg, aad []byte, kh interface{}) ([]byte, []byte, error) - // Decrypt will decrypt cipher with aad and given nonce using a matching AEAD primitive in kh key handle of a - // private key - // returns: - // plainText in []byte - // error in case of errors - Decrypt(cipher, aad, nonce []byte, kh interface{}) ([]byte, error) - // Sign will sign msg using a matching signature primitive in kh key handle of a private key - // returns: - // signature in []byte - // error in case of errors - Sign(msg []byte, kh interface{}) ([]byte, error) - // Verify will verify a signature for the given msg using a matching signature primitive in kh key handle of - // a public key - // returns: - // error in case of errors or nil if signature verification was successful - Verify(signature, msg []byte, kh interface{}) error - // ComputeMAC computes message authentication code (MAC) for code data - // using a matching MAC primitive in kh key handle - ComputeMAC(data []byte, kh interface{}) ([]byte, error) - // VerifyMAC determines if mac is a correct authentication code (MAC) for data - // using a matching MAC primitive in kh key handle and returns nil if so, otherwise it returns an error. - VerifyMAC(mac, data []byte, kh interface{}) error - // WrapKey will execute key wrapping of cek using apu, apv and recipient public key 'recPubKey'. - // 'opts' allows setting the optional sender key handle using WithSender() option and the an authentication tag - // using WithTag() option. These allow ECDH-1PU key unwrapping (aka Authcrypt). - // The absence of these options uses ECDH-ES key wrapping (aka Anoncrypt). Another option that can - // be used is WithXC20PKW() to instruct the WrapKey to use XC20P key wrapping instead of the default A256GCM. - // returns: - // RecipientWrappedKey containing the wrapped cek value - // error in case of errors - WrapKey(cek, apu, apv []byte, recPubKey *PublicKey, - opts ...WrapKeyOpts) (*RecipientWrappedKey, error) - // UnwrapKey unwraps a key in recWK using recipient private key kh. - // 'opts' allows setting the optional sender key handle using WithSender() option and the an authentication tag - // using WithTag() option. These allow ECDH-1PU key unwrapping (aka Authcrypt). - // The absence of these options uses ECDH-ES key unwrapping (aka Anoncrypt). There is no need to - // use WithXC20PKW() for UnwrapKey since the function will use the wrapping algorithm based on recWK.Alg. - // returns: - // unwrapped key in raw bytes - // error in case of errors - UnwrapKey(recWK *RecipientWrappedKey, kh interface{}, opts ...WrapKeyOpts) ([]byte, error) - // SignMulti will create a signature of messages using a matching signing primitive found in kh key handle of a - // private key. - // returns: - // signature in []byte - // error in case of errors - SignMulti(messages [][]byte, kh interface{}) ([]byte, error) - // VerifyMulti will verify a signature of messages using a matching signing primitive found in kh key handle of a - // public key. - // returns: - // error in case of errors or nil if signature verification was successful - VerifyMulti(messages [][]byte, signature []byte, kh interface{}) error - // VerifyProof will verify a signature proof (generated e.g. by Verifier's DeriveProof() call) for revealedMessages - // using a matching signing primitive found in kh key handle of a public key. - // returns: - // error in case of errors or nil if signature proof verification was successful - VerifyProof(revealedMessages [][]byte, proof, nonce []byte, kh interface{}) error - // DeriveProof will create a signature proof for a list of revealed messages using BBS signature (can be built using - // a Signer's SignMulti() call) and a matching signing primitive found in kh key handle of a public key. - // returns: - // signature proof in []byte - // error in case of errors - DeriveProof(messages [][]byte, bbsSignature, nonce []byte, revealedIndexes []int, kh interface{}) ([]byte, error) - // Blind will blind provided values and add blinded data realted to the key in kh - // returns: - // blinded values in []byte - // error in case of errors - Blind(kh interface{}, values ...map[string]interface{}) ([][]byte, error) - // GetCorrectnessProof will return correctness proof for a public key handle - // returns: - // correctness proof in []byte - // error in case of errors - GetCorrectnessProof(kh interface{}) ([]byte, error) - // SignWithSecrets will generate a signature and related correctness proof - // for the provided values using secrets and related DID - // returns: - // signature in []byte - // correctness proof in []byte - // error in case of errors - SignWithSecrets(kh interface{}, values map[string]interface{}, - secrets []byte, correctnessProof []byte, nonces [][]byte, did string) ([]byte, []byte, error) -} +type Crypto = crypto.Crypto // RecipientWrappedKey contains recipient key material required to unwrap CEK. -type RecipientWrappedKey struct { - KID string `json:"kid,omitempty"` - EncryptedCEK []byte `json:"encryptedcek,omitempty"` - EPK PublicKey `json:"epk,omitempty"` - Alg string `json:"alg,omitempty"` - APU []byte `json:"apu,omitempty"` - APV []byte `json:"apv,omitempty"` -} +type RecipientWrappedKey = crypto.RecipientWrappedKey // PublicKey mainly to exchange EPK in RecipientWrappedKey. -type PublicKey struct { - KID string `json:"kid,omitempty"` - X []byte `json:"x,omitempty"` - Y []byte `json:"y,omitempty"` - Curve string `json:"curve,omitempty"` - Type string `json:"type,omitempty"` -} +type PublicKey = crypto.PublicKey // PrivateKey mainly used to exchange ephemeral private key in JWE encrypter. -type PrivateKey struct { - PublicKey PublicKey `json:"pubKey,omitempty"` - D []byte `json:"d,omitempty"` -} +type PrivateKey = crypto.PrivateKey diff --git a/spi/go.mod b/spi/go.mod index 2fbcf11c8..4a15fea3a 100644 --- a/spi/go.mod +++ b/spi/go.mod @@ -5,3 +5,5 @@ module github.com/hyperledger/aries-framework-go/spi go 1.20 + +require github.com/trustbloc/kms-go v0.0.0-20230823163616-c9310a484f40 diff --git a/spi/go.sum b/spi/go.sum new file mode 100644 index 000000000..7450ab3eb --- /dev/null +++ b/spi/go.sum @@ -0,0 +1,2 @@ +github.com/trustbloc/kms-go v0.0.0-20230823163616-c9310a484f40 h1:ffs36Xhux4VizFvANdq1F2V/dNp1kgR91CiKShDV1RA= +github.com/trustbloc/kms-go v0.0.0-20230823163616-c9310a484f40/go.mod h1:AkTaHo5jhlJR2I4FyJCXaxUA/kEsauBUPBwVnAebeUU= diff --git a/spi/kms/kms.go b/spi/kms/kms.go index 4ad0edec8..f68238b16 100644 --- a/spi/kms/kms.go +++ b/spi/kms/kms.go @@ -9,83 +9,17 @@ package kms import ( - "github.com/hyperledger/aries-framework-go/spi/secretlock" + "github.com/trustbloc/kms-go/spi/kms" ) // KeyManager manages keys and their storage for the aries framework. -type KeyManager interface { - // Create a new key/keyset/key handle for the type kt - // Some key types may require additional attributes described in `opts` - // Returns: - // - keyID of the handle - // - handle instance (to private key) - // - error if failure - Create(kt KeyType, opts ...KeyOpts) (string, interface{}, error) - // Get key handle for the given keyID - // Returns: - // - handle instance (to private key) - // - error if failure - Get(keyID string) (interface{}, error) - // Rotate a key referenced by keyID and return a new handle of a keyset including old key and - // new key with type kt. It also returns the updated keyID as the first return value - // Some key types may require additional attributes described in `opts` - // Returns: - // - new KeyID - // - handle instance (to private key) - // - error if failure - Rotate(kt KeyType, keyID string, opts ...KeyOpts) (string, interface{}, error) - // ExportPubKeyBytes will fetch a key referenced by id then gets its public key in raw bytes and returns it. - // The key must be an asymmetric key. - // Returns: - // - marshalled public key []byte - // - error if it fails to export the public key bytes - ExportPubKeyBytes(keyID string) ([]byte, KeyType, error) - // CreateAndExportPubKeyBytes will create a key of type kt and export its public key in raw bytes and returns it. - // The key must be an asymmetric key. - // Some key types may require additional attributes described in `opts` - // Returns: - // - keyID of the new handle created. - // - marshalled public key []byte - // - error if it fails to export the public key bytes - CreateAndExportPubKeyBytes(kt KeyType, opts ...KeyOpts) (string, []byte, error) - // PubKeyBytesToHandle transforms pubKey raw bytes into a key handle of keyType. This function is only a utility to - // provide a public key handle for Tink/Crypto primitive execution, it does not persist the key handle. - // Some key types may require additional attributes described in `opts` - // Returns: - // - handle instance to the public key of type keyType - // - error if keyType is not supported, the key does not match keyType or unmarshal fails - PubKeyBytesToHandle(pubKey []byte, kt KeyType, opts ...KeyOpts) (interface{}, error) - // ImportPrivateKey will import privKey into the KMS storage for the given keyType then returns the new key id and - // the newly persisted Handle. - // 'privKey' possible types are: *ecdsa.PrivateKey and ed25519.PrivateKey - // 'kt' possible types are signing key types only (ECDSA keys or Ed25519) - // 'opts' allows setting the keysetID of the imported key using WithKeyID() option. If the ID is already used, - // then an error is returned. - // Returns: - // - keyID of the handle - // - handle instance (to private key) - // - error if import failure (key empty, invalid, doesn't match keyType, unsupported keyType or storing key failed) - ImportPrivateKey(privKey interface{}, kt KeyType, opts ...PrivateKeyOpts) (string, interface{}, error) -} +type KeyManager = kms.KeyManager // Store defines the storage capability required by a KeyManager Provider. -type Store interface { - // Put stores the given key under the given keysetID. - Put(keysetID string, key []byte) error - // Get retrieves the key stored under the given keysetID. If no key is found, the returned error is expected - // to wrap ErrKeyNotFound. KMS implementations may check to see if the error wraps that error type for certain - // operations. - Get(keysetID string) (key []byte, err error) - // Delete deletes the key stored under the given keysetID. A KeyManager will assume that attempting to delete - // a non-existent key will not return an error. - Delete(keysetID string) error -} +type Store = kms.Store // Provider for KeyManager builder/constructor. -type Provider interface { - StorageProvider() Store - SecretLock() secretlock.Service -} +type Provider = kms.Provider // Creator method to create new key management service. type Creator func(provider Provider) (KeyManager, error) @@ -142,7 +76,7 @@ const ( ) // KeyType represents a key type supported by the KMS. -type KeyType string +type KeyType = kms.KeyType const ( // AES128GCMType key type value. diff --git a/spi/secretlock/secretlock.go b/spi/secretlock/secretlock.go index f28478dc6..ab4b9f370 100644 --- a/spi/secretlock/secretlock.go +++ b/spi/secretlock/secretlock.go @@ -6,33 +6,20 @@ SPDX-License-Identifier: Apache-2.0 // Package secretlock provides the API for secret lock services, used to secure keys used by Aries KMS implementations. package secretlock +import "github.com/trustbloc/kms-go/spi/secretlock" + // Service provides crypto service used internally by the KMS // it is responsible for wrapping/unwrapping keys stored by the KMS using a master key. -type Service interface { - // Encrypt req for master key in keyURI - Encrypt(keyURI string, req *EncryptRequest) (*EncryptResponse, error) - // Decrypt req for master key in keyURI - Decrypt(keyURI string, req *DecryptRequest) (*DecryptResponse, error) -} +type Service = secretlock.Service // EncryptRequest for encrypting remote kms requests. -type EncryptRequest struct { - Plaintext string - AdditionalAuthenticatedData string -} +type EncryptRequest = secretlock.EncryptRequest // DecryptRequest for decrypting remote kms requests. -type DecryptRequest struct { - Ciphertext string - AdditionalAuthenticatedData string -} +type DecryptRequest = secretlock.DecryptRequest // EncryptResponse for receiving encryption response from remote kms requests. -type EncryptResponse struct { - Ciphertext string -} +type EncryptResponse = secretlock.EncryptResponse // DecryptResponse for receiving decryption response from remote kms requests. -type DecryptResponse struct { - Plaintext string -} +type DecryptResponse = secretlock.DecryptResponse diff --git a/test/bdd/features/aries_mediator_didcommv2_controller.feature b/test/bdd/features/aries_mediator_didcommv2_controller.feature new file mode 100644 index 000000000..81c6b27ad --- /dev/null +++ b/test/bdd/features/aries_mediator_didcommv2_controller.feature @@ -0,0 +1,61 @@ +# +# Copyright SecureKey Technologies Inc. All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# + +@aries_router_didcommv2_controller +Feature: DIDComm V2 Transport between two Agents through DIDComm Routers [REST Binding] + + # https://wiki.hyperledger.org/display/ARIES/DIDComm+MediatorRouter + Scenario: Decentralized Identifier(DID) Exchange between two Edge Agents(without Inbound) through Routers + # DID Exchange between Carl and his Router + Given "Carl" agent is running with controller "https://localhost:10081" and "all" as the transport return route option + And "Carl-Router" agent is running on "https://localhost:10091,wss://localhost:10092" with controller "https://localhost:10093" + + # dummy agent with same name, to wait for public DID + And "Carl-Router" agent is running on "localhost" port "random" with http-binding did resolver url "${SIDETREE_URL}" which accepts did method "sidetree" + And "Carl-Router" creates "sidetree" did through controller + And "Carl-Router" waits for public did to become available in sidetree for up to 10 seconds + + When "Carl-Router" creates an out-of-band-v2 invitation (controller) + And the OOBv2 invitation from "Carl-Router" is accepted by "Carl" (controller) + + #And "Carl-Router,Carl" retrieves connection record through controller and validates that connection state is "completed" + And "Carl" retrieves connection record through controller and validates that connection state is "completed" + And "Carl" saves the connectionID to variable "carl-router-connID" + + # DID Exchange between Dave and his Router + Given "Dave" agent is running with controller "https://localhost:10041" and "all" as the transport return route option + And "Dave-Router" agent is running on "https://localhost:10051,wss://localhost:10052" with controller "https://localhost:10053" + + # dummy agent with same name, to create public DID + And "Dave-Router" agent is running on "localhost" port "random" with http-binding did resolver url "${SIDETREE_URL}" which accepts did method "sidetree" + And "Dave-Router" creates "sidetree" did through controller + And "Dave-Router" waits for public did to become available in sidetree for up to 10 seconds + + When "Dave-Router" creates an out-of-band-v2 invitation (controller) + And the OOBv2 invitation from "Dave-Router" is accepted by "Dave" (controller) + + And "Dave" retrieves connection record through controller and validates that connection state is "completed" + And "Dave" saves the connectionID to variable "dave-router-connID" + + # Carl registers his routers + Then "Carl" unregisters the router with connection "carl-router-connID" + And "Carl" sets connection "carl-router-connID" as the router + And "Carl" verifies that the router connection is set to "carl-router-connID" + + # Dave registers his routers + And "Dave" unregisters the router with connection "dave-router-connID" + And "Dave" sets connection "dave-router-connID" as the router + And "Dave" verifies that the router connection is set to "dave-router-connID" + + # DIDExchange between Carl and Dave through routers + When "Carl" creates invitation through controller with label "carl-agent" and router "carl-router-connID" + And "Dave" receives invitation from "Carl" through controller + + Then "Dave" approves exchange invitation with router "dave-router-connID" through controller + And "Carl" approves exchange request with router "carl-router-connID" through controller + + Then "Carl,Dave" waits for post state event "completed" to web notifier + And "Carl,Dave" retrieves connection record through controller and validates that connection state is "completed"