Documentation
¶
Index ¶
- func NewMockProvider(kp ...*cryptoutil.MessagingKeys) (*mockprovider.Provider, error)
- type CloseableKMS
- func (m *CloseableKMS) Close() error
- func (m *CloseableKMS) ConvertToEncryptionKey(key []byte) ([]byte, error)
- func (m *CloseableKMS) CreateKeySet() (string, string, error)
- func (m *CloseableKMS) DeriveKEK(alg, apu, fromKey, toPubKey []byte) ([]byte, error)
- func (m *CloseableKMS) FindVerKey(candidateKeys []string) (int, error)
- func (m *CloseableKMS) GetEncryptionKey(verKey []byte) ([]byte, error)
- func (m *CloseableKMS) SignMessage(message []byte, fromVerKey string) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMockProvider ¶
func NewMockProvider(kp ...*cryptoutil.MessagingKeys) (*mockprovider.Provider, error)
NewMockProvider will create a new mock KMS Provider that builds a KMS with the keypairs list kp
Types ¶
type CloseableKMS ¶
type CloseableKMS struct {
CreateEncryptionKeyValue string
CreateKeyErr error
CreateSigningKeyValue string
FindVerKeyValue int
FindVerKeyErr error
SignMessageValue []byte
SignMessageErr error
DecryptMessageValue []byte
DecryptMessageErr error
PackValue []byte
PackErr error
UnpackValue *transport.Envelope
UnpackErr error
MockDID *did.Doc
EncryptionKeyValue []byte
EncryptionKeyErr error
}
CloseableKMS mock Key Management Service (KMS)
func (*CloseableKMS) Close ¶
func (m *CloseableKMS) Close() error
Close previously-opened KMS, removing it if so configured.
func (*CloseableKMS) ConvertToEncryptionKey ¶
func (m *CloseableKMS) ConvertToEncryptionKey(key []byte) ([]byte, error)
ConvertToEncryptionKey converts the keypair containing the given verkey to an encryption keypair
func (*CloseableKMS) CreateKeySet ¶
func (m *CloseableKMS) CreateKeySet() (string, string, error)
CreateKeySet create a new public/private encryption and signature key pairs combo.
func (*CloseableKMS) DeriveKEK ¶
func (m *CloseableKMS) DeriveKEK(alg, apu, fromKey, toPubKey []byte) ([]byte, error)
DeriveKEK derives a key encryption key from two keys mocked to return empty derived KEK
func (*CloseableKMS) FindVerKey ¶
func (m *CloseableKMS) FindVerKey(candidateKeys []string) (int, error)
FindVerKey return a verification key from the list of candidates
func (*CloseableKMS) GetEncryptionKey ¶
func (m *CloseableKMS) GetEncryptionKey(verKey []byte) ([]byte, error)
GetEncryptionKey will return the public encryption key corresponding to the public verKey argument
func (*CloseableKMS) SignMessage ¶
func (m *CloseableKMS) SignMessage(message []byte, fromVerKey string) ([]byte, error)
SignMessage sign a message using the private key associated with a given verification key.