github.com/trustbloc/kms-go@v1.1.2/mock/suite/suite.go (about) 1 /* 2 Copyright Gen Digital Inc. All Rights Reserved. 3 SPDX-License-Identifier: Apache-2.0 4 */ 5 6 // Package suite contains mocks for kms+crypto wrapper suite. 7 package suite 8 9 import ( 10 "github.com/trustbloc/kms-go/doc/jose/jwk" 11 "github.com/trustbloc/kms-go/mock/wrapper" 12 "github.com/trustbloc/kms-go/wrapper/api" 13 ) 14 15 // MockSuite mocks api.Suite. 16 type MockSuite wrapper.MockKMSCrypto 17 18 // KMSCrypto mock. 19 func (m *MockSuite) KMSCrypto() (api.KMSCrypto, error) { 20 return (*wrapper.MockKMSCrypto)(m), nil 21 } 22 23 // KeyCreator mock. 24 func (m *MockSuite) KeyCreator() (api.KeyCreator, error) { 25 return (*wrapper.MockKMSCrypto)(m), nil 26 } 27 28 // RawKeyCreator mock. 29 func (m *MockSuite) RawKeyCreator() (api.RawKeyCreator, error) { 30 return (*wrapper.MockKMSCrypto)(m), nil 31 } 32 33 // KMSCryptoSigner mock. 34 func (m *MockSuite) KMSCryptoSigner() (api.KMSCryptoSigner, error) { 35 return (*wrapper.MockKMSCrypto)(m), nil 36 } 37 38 // KMSCryptoVerifier mock. 39 func (m *MockSuite) KMSCryptoVerifier() (api.KMSCryptoVerifier, error) { 40 return (*wrapper.MockKMSCrypto)(m), nil 41 } 42 43 // KMSCryptoMultiSigner mock. 44 func (m *MockSuite) KMSCryptoMultiSigner() (api.KMSCryptoMultiSigner, error) { 45 return (*wrapper.MockKMSCrypto)(m), nil 46 } 47 48 // EncrypterDecrypter mock. 49 func (m *MockSuite) EncrypterDecrypter() (api.EncrypterDecrypter, error) { 50 return (*wrapper.MockKMSCrypto)(m), nil 51 } 52 53 // FixedKeyCrypto mock. 54 func (m *MockSuite) FixedKeyCrypto(pub *jwk.JWK) (api.FixedKeyCrypto, error) { 55 return (*wrapper.MockKMSCrypto)(m).FixedKeyCrypto(pub) 56 } 57 58 // FixedKeySigner mock. 59 func (m *MockSuite) FixedKeySigner(kid string) (api.FixedKeySigner, error) { 60 return (*wrapper.MockKMSCrypto)(m).FixedKeySigner(nil) 61 } 62 63 // FixedKeyMultiSigner mock. 64 func (m *MockSuite) FixedKeyMultiSigner(kid string) (api.FixedKeyMultiSigner, error) { 65 return (*wrapper.MockKMSCrypto)(m).FixedKeyMultiSigner(nil) 66 } 67 68 var _ api.Suite = &MockSuite{}