scan
Finds the well-known credentials in text.
The text is cut into words made of letters, digits, _, - and ., and each word is checked
with detect; a PEM private key header line (-----BEGIN ... PRIVATE KEY-----)
is found as a whole line. Quotes, =, :, spaces and other punctuation around a token are not
part of it. Like detect this is a format check: expect false negatives for formats it does
not know, and use it as a safety net, not as your only protection.
Import
Section titled “Import”Cargo feature secret (enabled by default). To compile only this module:
or in Cargo.toml:
Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
text | &str | The text to search, such as a file or a log. |
Returns
Section titled “Returns”Vec<Finding> — The findings in the order they appear, with their byte ranges in text.
