2022-06-09 17:35:23 +00:00
|
|
|
package content_crypt //nolint:golint
|
|
|
|
|
|
|
|
import (
|
2022-06-09 18:53:45 +00:00
|
|
|
"github.com/lestrrat-go/jwx/v2/jwa"
|
|
|
|
"github.com/lestrrat-go/jwx/v2/jwe/internal/cipher"
|
2022-06-09 17:35:23 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Generic encrypts a message by applying all the necessary
|
|
|
|
// modifications to the keys and the contents
|
|
|
|
type Generic struct {
|
|
|
|
alg jwa.ContentEncryptionAlgorithm
|
|
|
|
keysize int
|
|
|
|
tagsize int
|
|
|
|
cipher cipher.ContentCipher
|
|
|
|
}
|
|
|
|
|
|
|
|
type Cipher interface {
|
|
|
|
Decrypt([]byte, []byte, []byte, []byte, []byte) ([]byte, error)
|
|
|
|
KeySize() int
|
|
|
|
}
|