The KeyStore type exposes the following members.

Constructors

  NameDescription
Public methodKeyStore()()()()
Initializes a new Key Store object located in-memory.
Public methodKeyStore(String, String)
Initializes a new Key Store object.

Methods

  NameDescription
Public methodChangePrivateKeyPassword(Int64, String, String)
Changes private key password.

This method is equivalent to the GnuPG commands:
gpg --edit-key [userId]
Command>passwd
Public methodChangePrivateKeyPassword(String, String, String)
Changes private key password.
If more than one key pairs exist with the supplied userId, only the first one is affected.

This method is equivalent to the GnuPG commands:
gpg --edit-key [userId]
Command>passwd
Public methodCheckPassword
Checks if a password for a key store file is correct
Public methodContainsKey(Int64)
Checks is there a key with the specified Key ID in this Key Store
Public methodContainsKey(String)
Checks is there a key with the specified User Id in this Key Store
Public methodContainsPrivateKey(Int64)
Checks is there a private key with the specified Key ID in this Key Store
Public methodContainsPrivateKey(String)
Checks is there a private key with the specified User Id in this Key Store
Public methodContainsPublicKey(Int64)
Checks is there a public key with the specified Key ID in this Key Store
Public methodContainsPublicKey(String)
Checks is there a public key with the specified User Id in this Key Store
Public methodDeleteKeyPair(Int64)
Deletes the key pair (public and private key) from this key store that have the specified keyId.
Public methodDeleteKeyPair(String)
Deletes the first key pair (public and private key) from this key store that has the specified userId.
Public methodDeletePrivateKey(Int64)
Deletes a private key with the specified key Id from this KeyStore.
Public methodDeletePrivateKey(String)
Deletes the first private key from this key store that has the specified User Id.
Public methodDeletePublicKey(Int64)
Deletes the public key with the specified key Id from this key store.
Public methodDeletePublicKey(String)
Deletes the first public key pair from this key store that has the specified User Id.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodExportKeyRing(String, Int64)
Exports Key ring (both public and private key) located in this Key store in one file.
Public methodExportKeyRing(String, String)
Exports a key ring (the public and private key combined) located in this key store in one file.
Public methodExportKeyRing(String, Int64, Boolean)
Exports a key ring (the public and private key combined) located in this key store in one file.
Public methodExportKeyRing(String, String, Boolean)
Exports a key ring (the public and private key combined) located in this key store in one file.
Public methodExportPrivateKey(String, Int64, Boolean)
Exports private key from this OpenPGP key store into a file.
Public methodExportPrivateKey(String, String, Boolean)
Exports private key from this OpenPGP key store into a file.
Public methodExportPrivateKeyAsString(Int64)
Exports private key from this OpenPGP key store as a String in ASCII armored format.
Public methodExportPrivateKeyAsString(String)
Exports private key from this OpenPGP key store as a String in ASCII armored format.
Public methodExportPrivateKeyBytes(Int64)
Exports private key from this OpenPGP key store as a byte array.
Public methodExportPrivateKeyBytes(String)
Exports private key from this OpenPGP key store as a byte array
Public methodExportPrivateKeyStream(Int64)
Exports private key from this OpenPGP key store as an input stream for reading
Public methodExportPrivateKeyStream(String)
Exports private key from this OpenPGP key store as an input stream for reading
Public methodExportPublicKey(String, Int64, Boolean)
Exports public key from this OpenPGP key store into a file.
Public methodExportPublicKey(String, String, Boolean)
Exports public key from this OpenPGP key store, into file.
Public methodExportPublicKeyAsString(Int64)
Exports Public key from this OpenPGP key store as a String in ASCII armored format.
Public methodExportPublicKeyAsString(String)
Exports Public key from this OpenPGP key store as a String in ASCII armored format.
Public methodExportPublicKeyStream(Int64)
Exports public key from this OpenPGP key store as an input stream for reading
Public methodExportPublicKeyStream(String)
Exports public key from this OpenPGP key store as an input stream for reading
Protected methodFinalize
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGenerateKeyPair(Int32, String, String)
Generates OpenPGP Key pair with RSA encryption and predefined values for compression, hashing and cypher like the ones generated with PGP Desktop(tm) wizard.
Public methodGenerateKeyPair(Int32, String, KeyAlgorithm, String, array<CompressionAlgorithm>[]()[][], array<HashAlgorithm>[]()[][], array<CypherAlgorithm>[]()[][])
Generates OpenPGP Key pair (public and private key) with no expiration date.
The newly generated key is stored in this KeyStore instance.
Public methodGenerateKeyPair(Int32, String, String, String, String, String, String)
Generates OpenPGP Key pair (public and private key).
The newly generated key is stored in this KeyStore instance.
Public methodGenerateKeyPair(Int32, String, KeyAlgorithm, String, array<CompressionAlgorithm>[]()[][], array<HashAlgorithm>[]()[][], array<CypherAlgorithm>[]()[][], DateTime)
Generates PGP Key pair (public and private key) that expires on given date.
The newly generated key is stored in this KeyStore instance.
Public methodGenerateKeyPair(Int32, String, String, String, String, String, String, DateTime)
Generates PGP Key pair (public and private key).
The newly generated key is stored in this KeyStore instance.
Public methodGenerateKeyPair(Int32, String, String, String, String, String, String, Int64)
Generates PGP Key pair (public and private key).
The newly generated key is stored in this KeyStore instance.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetKeyIdForKeyIdHex
Returns the real Key ID (of type long) corresponding to this Hexadecimal Key Id.
Public methodGetKeyIdForUserId
Returns the real Key ID (of type long) corresponding to this User Id.
Public methodGetKeys
Returns the key pairs stored in this OpenPGP key store.
Public methodGetPublicKeysData
Returns the public keys data contained in this KeyStore
Public methodGetPublicKeysWithUserId
Returns the public keys data with the specified User Id contained in this KeyStore
Public methodGetPublicKeyWithKeyId
Returns the public key data with the specified Key Id contained in this IKeyStore
Public methodGetSecretKeysData
Returns the secret keys data contained in this KeyStore
Public methodGetSecretKeysWithUserId
Returns the secret keys data with the specified User Id contained in this IKeyStore
Public methodGetSecretKeyWithKeyId
Returns the secret key data with the specified Key Id contained in this IKeyStore
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodImportKeyRing(FileInfo)
Imports OpenPGP key ring in this key store.
Public methodImportKeyRing(String)
Imports OpenPGP key ring in this KeyStore instance.
Public methodImportPrivateKey(String)
Imports and OpenPGP private key into a custom OpenPGP key store.
Public methodImportPrivateKey(String, String)
Imports and OpenPGP private key into a custom OpenPGP key store.
Public methodImportPublicKey
Imports Public key into a custom OpenPGP key store. If the key store does not exist, it is created.
Public methodisTrusted(Int64)
Checks is a public key trusted in this Key store.
Public methodisTrusted(String)
Checks is a public key trusted in this Key store.
Public methodLoadFromStream
Loads the keystore data from a stream, where it has been stored previously
Protected methodloadKeyFile
Helper method for importing external public or private keys
Protected methodLoadPublicKeysData
Loads public keys data into this IKeyStore from a byte array obtained from an OpenPGP public key ring
Protected methodLoadSecretKeysData
Loads secret keys data into this IKeyStore from a byte array obtained from an OpenPGP secret key ring
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodStatic memberOpenFile
Initializes a new Key Store object.
Public methodStatic memberOpenInMemory
Creates a new in-memory KeyStore instance.
Public methodSave
Saves the Key Store to disk.
Public methodSaveToStream
Saves the keystore data to a stream
Public methodSetTrust(Int64, TrustLevel)
Sets an internal trust value for a public key, valid only in this KeyStore instance
Public methodSetTrust(String, TrustLevel)
Sets an internal trust value for a public key, valid only in this KeyStore instance
Public methodSignPublicKey(Int64, Int64, String)
Signs a public key with a specified private key.
Public methodSignPublicKey(String, String, String)
Signs a public key with a private key.
Public methodSignPublicKeyAsTrustedIntroducer(Int64, Int64, String)
Signs a public key as trusted introducer
Public methodSignPublicKeyAsTrustedIntroducer(String, Int64, String)
Signs a public key as trusted introducer
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)

Fields

  NameDescription
Public fieldStatic memberDSA
Constant for DSA asymmetric algorithm
Used in DH/DSS key generation
Public fieldStatic memberELGAMAL
Constant for ElGamal asymmetric algorithm
Used in DH/DSS key generation
Protected fieldkeys
List of keys contained in this KeyStore. Pairs of (keyId, KeyPairInformation)
Public fieldStatic memberRSA
Constant for RSA asymmetric algorithm

Properties

  NameDescription
Public propertyAutoSave
Property that indicates should the KeyStore backing file be auto saved after each operation that changes its state.
Public propertyBackupOnSave
Property that indicates should the old KeyStore backing file be copied automatically in a file with extension .bak right before the save operation
Public propertyFileName
File name where this KeyStore object is stored.
Public propertyHexKeyIds
Returns array of Hexadecimal string representation of the key Id's for the keys contained in this KeyStore instance.

This hexadecimal value is composed of the lower four bytes of the real key Id (8 bytes) and is the same as the one displayed by PGP (r) and GnuPG.
Public propertyIsInMemory
Indicates is this KeyStore instance in-memory (True) or file based (False)
Public propertyPartialMatchUserIds
Sets/Gets is searching keys performed on whole User Id or only on part of it.
Public propertyPassword
Password of this KeyStore
Public propertyUserIds
Returns array of Strings representing all user Id's contained in this KeyStore instance.

See Also