@@ -16,16 +16,16 @@ const (
16
16
encryptContentAlgo = jose .A256GCM
17
17
)
18
18
19
- type EncryptKeyer interface {
19
+ type EncryptKeyProvider interface {
20
20
EncryptingKey (ctx context.Context ) (id string , key interface {}, err error )
21
21
}
22
22
23
- type DecryptKeyer interface {
23
+ type DecryptKeyProvider interface {
24
24
DecryptingKey (ctx context.Context , id string ) (key interface {}, err error )
25
25
}
26
26
27
27
// Encrypt encrypts a token and returns it as a string.
28
- func Encrypt (ctx context.Context , e EncryptKeyer , claims Claims ) (string , error ) {
28
+ func Encrypt (ctx context.Context , e EncryptKeyProvider , claims Claims ) (string , error ) {
29
29
id , key , err := e .EncryptingKey (ctx )
30
30
if err != nil {
31
31
return "" , xerrors .Errorf ("get signing key: %w" , err )
@@ -72,7 +72,7 @@ type DecryptOptions struct {
72
72
}
73
73
74
74
// Decrypt decrypts the token using the provided key. It unmarshals into the provided claims.
75
- func Decrypt (ctx context.Context , d DecryptKeyer , token string , claims Claims , opts ... func (* DecryptOptions )) error {
75
+ func Decrypt (ctx context.Context , d DecryptKeyProvider , token string , claims Claims , opts ... func (* DecryptOptions )) error {
76
76
options := DecryptOptions {
77
77
RegisteredClaims : jwt.Expected {
78
78
Time : time .Now (),
0 commit comments