Files
kumomta/crates/data-loader/test.lua
T
Dario Maiocchi 847cc21e9b implement aes-cbc block with examples
Add CBC and ecb Block mode aes encryption/decryption.

To facilitate testing this better, and just to be nicer overall, adjust
data-loader's KeySource::key_data variant to support loading raw binary
bytes.

Co-authored-by: Wez Furlong <wez@wezfurlong.org>

Closes: https://github.com/KumoCorp/kumomta/pull/395
2025-10-22 11:55:16 +01:00

15 lines
339 B
Lua

local kumo = require 'kumo'
local utils = require 'policy-extras.policy_utils'
-- Confirm that text is loaded as a string
local text = kumo.secrets.load {
key_data = 'hello',
}
utils.assert_eq(text, 'hello')
-- Confirm that binary can be loaded too
local text = kumo.secrets.load {
key_data = '\x00',
}
utils.assert_eq(text, '\x00')