Files
onix/pkg/plugin/definition/encrypter.go
rupinder-syngh d6ba0edb27 feat: encryption plugin (#429)
* 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
2025-03-21 17:18:51 +05:30

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)
}