* feat: Implement encryption plugin. * fix: Removed interface test file * fix: Test case changes * fix: Test case for encryption * fix: formatting changes * fix: lint change * fix: shared renamed to pkg * fix: shared rename to pkg * fix: resolved pr comments * fix: indentation, formatting * fix: removed config, ctx check, test enhancements * fix: removed close function * fix: remove config and enhance test cases * fix: formatting changes, test case enhancement
16 lines
585 B
Go
16 lines
585 B
Go
package definition
|
|
|
|
import "context"
|
|
|
|
// Encrypter defines the methods for encryption.
|
|
type Encrypter interface {
|
|
// Encrypt encrypts the given body using the provided privateKeyBase64 and publicKeyBase64.
|
|
Encrypt(ctx context.Context, data string, privateKeyBase64, publicKeyBase64 string) (string, error)
|
|
}
|
|
|
|
// EncrypterProvider initializes a new encrypter instance with the given config.
|
|
type EncrypterProvider interface {
|
|
// New creates a new encrypter instance based on the provided config.
|
|
New(ctx context.Context, config map[string]string) (Encrypter, func() error, error)
|
|
}
|