keyhog-scanner 0.5.40

keyhog-scanner: high-performance SIMD-accelerated secret detection engine
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! PGP encrypted blocks within lookback infer Encrypted context.

use keyhog_scanner::context::{infer_context, CodeContext};

#[test]
fn context_encrypted_pgp_block() {
    let lines = vec![
        "-----BEGIN PGP MESSAGE-----",
        "Version: OpenPGP",
        "hQEMAw...",
    ];
    assert_eq!(
        infer_context(&lines, 2, None),
        CodeContext::Encrypted,
        "lines after PGP header must be encrypted context"
    );
}