sc_env

Macro sc_env 

Source
sc_env!() { /* proc-macro */ }
Expand description

Reads and encrypts the contents of the specified environment variable using Aes256Gcm with the key embedded using use_staticrypt and a randomly generated nonce (derived from the STATICRYPT_SEED variable at compile time).

The contents of the environment variable are read at compile time.

Example:

use staticrypt::*;

use_staticrypt!();

fn main() {
    let encrypted = sc_env!("MY_SECRET_VAR");

    assert_eq!(encrypted, "super secret env");
}