mirror of
https://github.com/go-gitea/gitea.git
synced 2025-08-22 16:44:06 +09:00
Add AES GCM encryption provider
This commit is contained in:
16
services/secrets/encryption.go
Normal file
16
services/secrets/encryption.go
Normal 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)
|
||||
}
|
Reference in New Issue
Block a user