C# Class Org.BouncyCastle.Bcpg.OpenPgp.PgpSecretKeyRing

Holder for a collection of PGP secret keys.
Inheritance: PgpKeyRing
Show file Open project: red-gate/iTextSharp-4.1.6 Class Usage Examples

Public Methods

Method Description
CopyWithNewPassword ( PgpSecretKeyRing ring, char oldPassPhrase, char newPassPhrase, SymmetricKeyAlgorithmTag newEncAlgorithm, SecureRandom rand ) : PgpSecretKeyRing

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.

Encode ( Stream outStr ) : void
GetEncoded ( ) : byte[]
GetExtraPublicKeys ( ) : IEnumerable

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.

GetPublicKey ( ) : PgpPublicKey

Return the public key for the master key.

GetSecretKey ( ) : PgpSecretKey

Return the master private key.

GetSecretKey ( long keyId ) : PgpSecretKey
GetSecretKeys ( ) : IEnumerable

Allows enumeration of the secret keys.

InsertSecretKey ( PgpSecretKeyRing secRing, PgpSecretKey secKey ) : PgpSecretKeyRing

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

PgpSecretKeyRing ( Stream inputStream ) : System
PgpSecretKeyRing ( byte encoding ) : System
RemoveSecretKey ( PgpSecretKeyRing secRing, PgpSecretKey secKey ) : PgpSecretKeyRing

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

ReplacePublicKeys ( PgpSecretKeyRing secretRing, PgpPublicKeyRing publicRing ) : PgpSecretKeyRing

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

Private Methods

Method Description
PgpSecretKeyRing ( IList keys ) : System
PgpSecretKeyRing ( IList keys, IList extraPubKeys ) : System

Method Details

CopyWithNewPassword() public static method

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.
public static CopyWithNewPassword ( PgpSecretKeyRing ring, char oldPassPhrase, char newPassPhrase, SymmetricKeyAlgorithmTag newEncAlgorithm, SecureRandom rand ) : PgpSecretKeyRing
ring PgpSecretKeyRing The PgpSecretKeyRing to be copied.
oldPassPhrase char The current password for key.
newPassPhrase char The new password for the key.
newEncAlgorithm SymmetricKeyAlgorithmTag The algorithm to be used for the encryption.
rand SecureRandom Source of randomness.
return PgpSecretKeyRing

Encode() public method

public Encode ( Stream outStr ) : void
outStr Stream
return void

GetEncoded() public method

public GetEncoded ( ) : byte[]
return byte[]

GetExtraPublicKeys() public method

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.
public GetExtraPublicKeys ( ) : IEnumerable
return IEnumerable

GetPublicKey() public method

Return the public key for the master key.
public GetPublicKey ( ) : PgpPublicKey
return PgpPublicKey

GetSecretKey() public method

Return the master private key.
public GetSecretKey ( ) : PgpSecretKey
return PgpSecretKey

GetSecretKey() public method

public GetSecretKey ( long keyId ) : PgpSecretKey
keyId long
return PgpSecretKey

GetSecretKeys() public method

Allows enumeration of the secret keys.
public GetSecretKeys ( ) : IEnumerable
return IEnumerable

InsertSecretKey() public static method

Returns a new key ring with the secret key passed in either added or replacing an existing one with the same key ID.
public static InsertSecretKey ( PgpSecretKeyRing secRing, PgpSecretKey secKey ) : PgpSecretKeyRing
secRing PgpSecretKeyRing The secret key ring to be modified.
secKey PgpSecretKey The secret key to be inserted.
return PgpSecretKeyRing

PgpSecretKeyRing() public method

public PgpSecretKeyRing ( Stream inputStream ) : System
inputStream Stream
return System

PgpSecretKeyRing() public method

public PgpSecretKeyRing ( byte encoding ) : System
encoding byte
return System

RemoveSecretKey() public static method

Returns a new key ring with the secret key passed in removed from the key ring.
public static RemoveSecretKey ( PgpSecretKeyRing secRing, PgpSecretKey secKey ) : PgpSecretKeyRing
secRing PgpSecretKeyRing The secret key ring to be modified.
secKey PgpSecretKey The secret key to be removed.
return PgpSecretKeyRing

ReplacePublicKeys() public static method

Replace the public key set on the secret ring with the corresponding key off the public ring.
public static ReplacePublicKeys ( PgpSecretKeyRing secretRing, PgpPublicKeyRing publicRing ) : PgpSecretKeyRing
secretRing PgpSecretKeyRing Secret ring to be changed.
publicRing PgpPublicKeyRing Public ring containing the new public key set.
return PgpSecretKeyRing