Datatypes › Secrets and credentials (passwords, keys, tokens)

OpenPGP private key block

ID pgp_private_key_block

DatatypeNot PIIidentifierDraft

This record is a draft: it has not been reviewed yet and may be incomplete or wrong. Do not rely on it for compliance decisions. Help improve it (see CONTRIBUTING.md).

OpenPGP secret key in ASCII armor: Radix-64 text between the lines -----BEGIN PGP PRIVATE KEY BLOCK----- and -----END PGP PRIVATE KEY BLOCK-----, as defined in RFC 9580.

Categories
Secrets and credentials (passwords, keys, tokens), Cryptographic identifiers
Countries
Global (not tied to a country)
Languages
Common to most languages
MISP attribute type
pgp-private-key
Quality
88/100 · missing: second example, translation
Metacrafter rules
no detection rule yet
Supported by tools
Amazon Macie, Datadog Sensitive Data Scanner, detect-secrets, GitGuardian, GitHub secret scanning, Gitleaks, Nightfall AI, pyWhat, Semgrep

Regular expression

^-----BEGIN PGP PRIVATE KEY BLOCK-----[\s\S]+-----END PGP PRIVATE KEY BLOCK-----$

Python re syntax.

Test a value

Examples

ValueDescription
-----BEGIN PGP PRIVATE KEY BLOCK----- EXAMPLE -----END PGP PRIVATE KEY BLOCK----- Armor lines around placeholder text, not a key
-----BEGIN PGP PUBLIC KEY BLOCK----- EXAMPLE -----END PGP PUBLIC KEY BLOCK----- invalid Public key block

Sources

Use this record