MCPcopy Index your code
hub / github.com/rilldata/rill / ParseEncryptionKeyring

Function ParseEncryptionKeyring

admin/database/database.go:1276–1288  ·  view source on GitHub ↗

ParseEncryptionKeyring parses a JSON string containing an array of EncryptionKey objects. If the provided string is empty, an empty keyring is returned. When using an empty keyring, columns will be read and written without applying encryption/decryption.

(keyring string)

Source from the content-addressed store, hash-verified

1274// If the provided string is empty, an empty keyring is returned.
1275// When using an empty keyring, columns will be read and written without applying encryption/decryption.
1276func ParseEncryptionKeyring(keyring string) ([]*EncryptionKey, error) {
1277 if keyring == "" {
1278 return nil, nil
1279 }
1280
1281 var encKeyring []*EncryptionKey
1282 err := json.Unmarshal([]byte(keyring), &encKeyring)
1283 if err != nil {
1284 return nil, err
1285 }
1286
1287 return encKeyring, nil
1288}
1289
1290func NewRandomKeyring() ([]*EncryptionKey, error) {
1291 secret := make([]byte, 32) // 32 bytes for AES-256

Callers 2

mainFunction · 0.92
OpenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected