Files
onix/pkg/plugin/definition/decrypter.go
rupinder-syngh c5bfd0a122 feat: decryption plugin (#430)
* feat: Implemented decryption plugin

* fix: Removed interface test file

* fix: Test case

* fix: Test case for plugin

* fix: test case change

* fix: resolved pr comments

* fix: resolved pr comments

* fix: removed mock dcrypter

* fix: formatting

* fix: removed config, close function, enhanced test cases

* fix: test cases enhancement, formatting
2025-03-21 19:23:40 +05:30

16 lines
594 B
Go

package definition
import "context"
// Decrypter defines the methods for decryption.
type Decrypter interface {
// Decrypt decrypts the given body using the provided privateKeyBase64 and publicKeyBase64.
Decrypt(ctx context.Context, encryptedData string, privateKeyBase64, publicKeyBase64 string) (string, error)
}
// DecrypterProvider initializes a new decrypter instance with the given config.
type DecrypterProvider interface {
// New creates a new decrypter instance based on the provided config.
New(ctx context.Context, config map[string]string) (Decrypter, func() error, error)
}