github.com/trustbloc/kms-go@v1.1.2/wrapper/localsuite/suite.go (about)

     1  /*
     2  Copyright Gen Digital Inc. All Rights Reserved.
     3  SPDX-License-Identifier: Apache-2.0
     4  */
     5  
     6  package localsuite
     7  
     8  import (
     9  	"github.com/trustbloc/kms-go/doc/jose/jwk"
    10  	wrapperapi "github.com/trustbloc/kms-go/wrapper/api"
    11  )
    12  
    13  type suiteImpl struct {
    14  	kms    keyManager
    15  	crypto allCrypto
    16  }
    17  
    18  func (s *suiteImpl) KeyCreator() (wrapperapi.KeyCreator, error) {
    19  	return newKeyCreator(s.kms), nil
    20  }
    21  
    22  func (s *suiteImpl) RawKeyCreator() (wrapperapi.RawKeyCreator, error) {
    23  	return newKeyCreator(s.kms), nil
    24  }
    25  
    26  func (s *suiteImpl) KMSCrypto() (wrapperapi.KMSCrypto, error) {
    27  	return newKMSCrypto(s.kms, s.crypto), nil
    28  }
    29  
    30  func (s *suiteImpl) KMSCryptoSigner() (wrapperapi.KMSCryptoSigner, error) {
    31  	return newKMSCryptoSigner(s.kms, s.crypto), nil
    32  }
    33  
    34  func (s *suiteImpl) KMSCryptoMultiSigner() (wrapperapi.KMSCryptoMultiSigner, error) {
    35  	return newKMSCryptoMultiSigner(s.kms, s.crypto), nil
    36  }
    37  
    38  func (s *suiteImpl) KMSCryptoVerifier() (wrapperapi.KMSCryptoVerifier, error) {
    39  	return newKMSCrypto(s.kms, s.crypto), nil
    40  }
    41  
    42  func (s *suiteImpl) EncrypterDecrypter() (wrapperapi.EncrypterDecrypter, error) {
    43  	return newEncrypterDecrypter(s.kms, s.crypto), nil
    44  }
    45  
    46  func (s *suiteImpl) FixedKeyCrypto(pub *jwk.JWK) (wrapperapi.FixedKeyCrypto, error) {
    47  	return makeFixedKeyCrypto(s.kms, s.crypto, pub)
    48  }
    49  
    50  func (s *suiteImpl) FixedKeySigner(kid string) (wrapperapi.FixedKeySigner, error) {
    51  	return makeFixedKeySigner(s.kms, s.crypto, kid)
    52  }
    53  
    54  func (s *suiteImpl) FixedKeyMultiSigner(kid string) (wrapperapi.FixedKeyMultiSigner, error) {
    55  	return getFixedMultiSigner(s.kms, s.crypto, kid)
    56  }