Add AES GCM encryption provider

This commit is contained in:
Lauris BH
2022-11-25 17:48:46 +08:00
committed by Jason Song
parent d4e84c0433
commit 4af45f7bc9
5 changed files with 180 additions and 4 deletions
+16
View File
@@ -0,0 +1,16 @@
// Copyright 2021 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package secrets
// EncryptionProvider encrypts and decrypts secrets
type EncryptionProvider interface {
Encrypt(secret, key []byte) ([]byte, error)
EncryptString(secret string, key []byte) (string, error)
Decrypt(enc, key []byte) ([]byte, error)
DecryptString(enc string, key []byte) (string, error)
}