Skip to main content

load_encrypted_secrets

Function load_encrypted_secrets 

Source
pub fn load_encrypted_secrets(
    encrypted_bytes: &[u8],
    password: &str,
    format: Option<SecretsFormat>,
) -> Result<PatternCompileResult>
Expand description

Load, decrypt, parse, and compile an encrypted secrets file into ScanPatterns ready for the streaming scanner.

This is the primary entry point for CLI integration.

§Arguments

  • encrypted_bytes — raw bytes of the .enc file.
  • password — user-supplied password.
  • format — optional explicit format override.

§Returns

(patterns, warnings) where warnings contains indices and errors for entries that failed to compile.

§Security

The decrypted plaintext is held in zeroizing memory and dropped immediately after parsing.

§Errors

Returns [SanitizeError::SecretsError] if decryption or parsing fails.