MCPcopy
hub / github.com/oauth2-proxy/oauth2-proxy / Encrypt

Method Encrypt

pkg/encryption/cipher.go:29–36  ·  view source on GitHub ↗

Encrypt encrypts a value with the embedded Cipher & Base64 encodes it

(value []byte)

Source from the content-addressed store, hash-verified

27
28// Encrypt encrypts a value with the embedded Cipher & Base64 encodes it
29func (c *base64Cipher) Encrypt(value []byte) ([]byte, error) {
30 encrypted, err := c.Cipher.Encrypt(value)
31 if err != nil {
32 return nil, err
33 }
34
35 return []byte(base64.StdEncoding.EncodeToString(encrypted)), nil
36}
37
38// Decrypt Base64 decodes a value & decrypts it with the embedded Cipher
39func (c *base64Cipher) Decrypt(ciphertext []byte) ([]byte, error) {

Callers

nothing calls this directly

Calls 1

EncryptMethod · 0.65

Tested by

no test coverage detected