Add AES GCM encryption provider

This commit is contained in:
Lauris BH
2021-01-07 11:31:54 +02:00
committed by Jason Song
parent d4e84c0433
commit 4af45f7bc9
5 changed files with 180 additions and 4 deletions

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