Class PgpMasterKey
Master key provider for PGP (OpenPGP) keys. Uses BouncyCastle OpenPGP to decrypt session keys.
public class PgpMasterKey : IMasterKeyProvider
- Inheritance
-
PgpMasterKey
- Implements
- Inherited Members
Constructors
PgpMasterKey(string, byte[]?, string?)
Creates a PGP master key provider.
public PgpMasterKey(string fingerprint, byte[]? privateKeyBytes = null, string? passphrase = null)
Parameters
fingerprintstringThe key fingerprint (hex), or empty to match any key.
privateKeyBytesbyte[]The secret key, ASCII-armored or binary.
passphrasestringThe key's passphrase, if it has one.
Properties
Fingerprint
The PGP fingerprint (hex string). May be empty to match any key in the ring.
public string Fingerprint { get; }
Property Value
KeyType
The key type identifier ("pgp").
public string KeyType { get; }
Property Value
Passphrase
Optional passphrase for the PGP private key. SOPS requires explicit passphrase handling - never silently ignore.
public string? Passphrase { get; }
Property Value
PrivateKeyBytes
The PGP private key bytes (ASCII-armored or binary) or null if using external decrypt.
public byte[]? PrivateKeyBytes { get; }
Property Value
- byte[]
Methods
DecryptShareAsync(string, CancellationToken)
Decrypt the encrypted data key share using PGP. Returns null if this key cannot decrypt (key ID mismatch or parse error).
public Task<byte[]?> DecryptShareAsync(string enc, CancellationToken ct = default)
Parameters
encstringctCancellationToken