<PackageReference Include="BouncyCastle.Cryptography" Version="2.4.0" />

PgpSecretKeyRing

public class PgpSecretKeyRing : PgpKeyRing
public PgpSecretKeyRing(byte[] encoding)

public PgpSecretKeyRing(Stream inputStream)

public static PgpSecretKeyRing CopyWithNewPassword(PgpSecretKeyRing ring, char[] oldPassPhrase, char[] newPassPhrase, SymmetricKeyAlgorithmTag newEncAlgorithm, SecureRandom rand)

Return a copy of the passed in secret key ring, with the master key and sub keys encrypted using a new password and the passed in algorithm.

Returns a new key ring with the secret key passed in either added or replacing an existing one with the same key ID.

Returns a new key ring with the secret key passed in removed from the key ring.

Replace the public key set on the secret ring with the corresponding key off the public ring.

public void Encode(Stream outStr)

public byte[] GetEncoded()

Return an iterator of the public keys in the secret key ring that have no matching private key. At the moment only personal certificate data appears in this fashion.

Return the public key for the master key.

public PgpPublicKey GetPublicKey(long keyID)

Return the public key referred to by the passed in keyID if it is present.

public PgpPublicKey GetPublicKey(byte[] fingerprint)

Return the public key with the passed in fingerprint if it is present.

Return the master private key.

public PgpSecretKey GetSecretKey(long keyId)

Return the secret key referred to by the passed in keyID if it is present.

public PgpSecretKey GetSecretKey(byte[] fingerprint)

Return the secret key associated with the passed in fingerprint if it is present.

Allows enumeration of the secret keys.