secure-rs
| Proc-macro name | Args | Description | Example | Feature |
|---|---|---|---|---|
| include_secure_str_brotli | pathname, varname** | equivalent of include_str!(), but compress in c-t* via brotli |
here | compression |
| secure_str_brotli | varname**, str value | equivalent of const NAME: &str, but compress in c-t* via brotli |
here | compression |
| include_secure_bytes_brotli | pathname, varname** | equivalent of include_bytes!(), but compress in c-t* via brotli |
here | compression |
| include_secure_bytes_aes | pathname, aes_key, varname** | equivalent of include_str!(), but compress in c-t* via aes |
here | encryption |
| secure_str_aes | aes_key, varname**, str value | equivalent of const NAME: &str, but encrypt in c-t* via aes |
here | encryption |
| include_secure_bytes_aes | pathname, aes_key varname** | equivalent of include_bytes!(), but compress in c-t* via aes |
here | encryption |
c-t* — compile-time
varname** — each macro accept varname and as result generate function with name: get_{varname}
Results of usage:
Non-secure string:
const API_KEY: &str = "-----BEGIN PUBLIC KEY-----
MIGeMA0GCSqGSIb3DQEBAQUAA4GMADCBiAKBgGQlFVujnjLZ2Ln+JjvcSu3cOiMB
JrKb3G49Ivg3Mvefp+D+UHN5OV2AcN1c0znkIzk/QgqxJ6VKaZtqjKMhZWG/0mta
niD36GTJTnUZ5MWQ2dVlItO6gtM/61uIf4FNZaLJG4CReoHkH61ffl7Fz7B9aroj
8+MhcMLInbWDQ6sJAgMBAAE=
-----END PUBLIC KEY-----";
binary:
Secure string
use secure_str_brotli;
secure_str_brotli!;
binary:
Usage:
use secure_str_brotli;
secure_str_brotli!;
Add to dependencies
= "0.22.1"
= "7.0.0"
= { = "0.2.0", = ["compression", "encryption"] }