PGPKeyring Class
Properties Methods Events Configuration Settings Errors
The PGPKeyring class accesses and manages PGP keyring files.
Syntax
SecureBlackboxPGPKeyring
SecureBlackboxPGPKeyringSwift
Remarks
PGPKeyring is used to hold and access PGP keys. It contains information about both public keys and secret keys, which are usually stored in two separate files: "public keyring" and "secret keyring", respectively.
Property List
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
- opened | Indicates if the keyring is in an opened state. |
- pinnedKeyHandle | Allows to get or set a 'handle', a unique identifier of the underlying property object. |
- publicKeyCount | The number of records in the PublicKey arrays. |
- publicKeyBitsInKey:(int)publicKeyIndex | Indicates the key length in bits. |
- publicKeyCanEncrypt:(int)publicKeyIndex | Returns True if this key can be used for encryption. |
- publicKeyCanSign:(int)publicKeyIndex | Returns True if this key can be used for signing. |
- publicKeyCurve:(int)publicKeyIndex | Indicates the elliptic curve associated with a EC key. |
- publicKeyEnabled:(int)publicKeyIndex | Enables or disables this key for use in encryption or signing operation. |
- publicKeyEncryptionAlgorithm:(int)publicKeyIndex | Indicates the symmetric algorithm used to encrypt the secret key. |
- publicKeyExpires:(int)publicKeyIndex | Indicates key expiration time in whole days from its generation moment. |
- publicKeyHandle:(int)publicKeyIndex | Allows to get or set a 'handle', a unique identifier of the underlying property object. |
- publicKeyHashAlgorithm:(int)publicKeyIndex | Specifies the hash algorithm associated with the key. |
- publicKeyIsPublic:(int)publicKeyIndex | Returns True if this key is a public key, and False otherwise. |
- publicKeyIsSecret:(int)publicKeyIndex | Returns True if this key is a secret key, and False otherwise. |
- publicKeyIsSubkey:(int)publicKeyIndex | Returns True if this key is a subkey of another key, and False otherwise. |
- publicKeyKeyFP:(int)publicKeyIndex | The 20-byte fingerprint (hash value) of this key. |
- publicKeyKeyHashAlgorithm:(int)publicKeyIndex | Specifies the hash algorithm used with DSA keys to calculate signatures. |
- publicKeyKeyID:(int)publicKeyIndex | Contains a 8-byte key identifier. |
- publicKeyOldPacketFormat:(int)publicKeyIndex | Indicates whether legacy (PGP 2. |
- publicKeyPassphrase:(int)publicKeyIndex | The key protection password. |
- publicKeyPassphraseValid:(int)publicKeyIndex | Use this property to check whether the specified Passphrase is valid and can be used to unlock the secret key. |
- publicKeyPrimaryKeyID:(int)publicKeyIndex | If this key is a subkey ( IsSubkey returns True), this property contains the identifier of the subkey's primary key. |
- publicKeyProtection:(int)publicKeyIndex | Specifies the level of protection applied to the secret key. |
- publicKeyPublicKeyAlgorithm:(int)publicKeyIndex | Specifies the asymmetric algorithm of the key. |
- publicKeyQBits:(int)publicKeyIndex | The length of the DSA Q (legitimate range: 160-512). |
- publicKeyRevoked:(int)publicKeyIndex | Returns True if the key has been revoked, and False otherwise. |
- publicKeySubkeyFP:(int)publicKeyIndex | The 20-byte fingerprint (hash value) of this key's subkey. |
- publicKeySubkeyID:(int)publicKeyIndex | Contains a 8-byte subkey identifier. |
- publicKeyTimestamp:(int)publicKeyIndex | Use this property to check the time the key was generated. |
- publicKeyUsername:(int)publicKeyIndex | Specifies the name of the user bound to this key. |
- publicKeyValid:(int)publicKeyIndex | Indicates the validity status of the key. |
- publicKeyVersion:(int)publicKeyIndex | Indicates the key version. |
- secretKeyCount | The number of records in the SecretKey arrays. |
- secretKeyBitsInKey:(int)secretKeyIndex | Indicates the key length in bits. |
- secretKeyCanEncrypt:(int)secretKeyIndex | Returns True if this key can be used for encryption. |
- secretKeyCanSign:(int)secretKeyIndex | Returns True if this key can be used for signing. |
- secretKeyCurve:(int)secretKeyIndex | Indicates the elliptic curve associated with a EC key. |
- secretKeyEnabled:(int)secretKeyIndex | Enables or disables this key for use in encryption or signing operation. |
- secretKeyEncryptionAlgorithm:(int)secretKeyIndex | Indicates the symmetric algorithm used to encrypt the secret key. |
- secretKeyExpires:(int)secretKeyIndex | Indicates key expiration time in whole days from its generation moment. |
- secretKeyHandle:(int)secretKeyIndex | Allows to get or set a 'handle', a unique identifier of the underlying property object. |
- secretKeyHashAlgorithm:(int)secretKeyIndex | Specifies the hash algorithm associated with the key. |
- secretKeyIsPublic:(int)secretKeyIndex | Returns True if this key is a public key, and False otherwise. |
- secretKeyIsSecret:(int)secretKeyIndex | Returns True if this key is a secret key, and False otherwise. |
- secretKeyIsSubkey:(int)secretKeyIndex | Returns True if this key is a subkey of another key, and False otherwise. |
- secretKeyKeyFP:(int)secretKeyIndex | The 20-byte fingerprint (hash value) of this key. |
- secretKeyKeyHashAlgorithm:(int)secretKeyIndex | Specifies the hash algorithm used with DSA keys to calculate signatures. |
- secretKeyKeyID:(int)secretKeyIndex | Contains a 8-byte key identifier. |
- secretKeyOldPacketFormat:(int)secretKeyIndex | Indicates whether legacy (PGP 2. |
- secretKeyPassphrase:(int)secretKeyIndex | The key protection password. |
- secretKeyPassphraseValid:(int)secretKeyIndex | Use this property to check whether the specified Passphrase is valid and can be used to unlock the secret key. |
- secretKeyPrimaryKeyID:(int)secretKeyIndex | If this key is a subkey ( IsSubkey returns True), this property contains the identifier of the subkey's primary key. |
- secretKeyProtection:(int)secretKeyIndex | Specifies the level of protection applied to the secret key. |
- secretKeyPublicKeyAlgorithm:(int)secretKeyIndex | Specifies the asymmetric algorithm of the key. |
- secretKeyQBits:(int)secretKeyIndex | The length of the DSA Q (legitimate range: 160-512). |
- secretKeyRevoked:(int)secretKeyIndex | Returns True if the key has been revoked, and False otherwise. |
- secretKeySubkeyFP:(int)secretKeyIndex | The 20-byte fingerprint (hash value) of this key's subkey. |
- secretKeySubkeyID:(int)secretKeyIndex | Contains a 8-byte subkey identifier. |
- secretKeyTimestamp:(int)secretKeyIndex | Use this property to check the time the key was generated. |
- secretKeyUsername:(int)secretKeyIndex | Specifies the name of the user bound to this key. |
- secretKeyValid:(int)secretKeyIndex | Indicates the validity status of the key. |
- secretKeyVersion:(int)secretKeyIndex | Indicates the key version. |
- selectedPublicKeyCount | The number of records in the SelectedPublicKey arrays. |
- selectedPublicKeyBitsInKey:(int)selectedPublicKeyIndex | Indicates the key length in bits. |
- selectedPublicKeyCanEncrypt:(int)selectedPublicKeyIndex | Returns True if this key can be used for encryption. |
- selectedPublicKeyCanSign:(int)selectedPublicKeyIndex | Returns True if this key can be used for signing. |
- selectedPublicKeyCurve:(int)selectedPublicKeyIndex | Indicates the elliptic curve associated with a EC key. |
- selectedPublicKeyEnabled:(int)selectedPublicKeyIndex | Enables or disables this key for use in encryption or signing operation. |
- selectedPublicKeyEncryptionAlgorithm:(int)selectedPublicKeyIndex | Indicates the symmetric algorithm used to encrypt the secret key. |
- selectedPublicKeyExpires:(int)selectedPublicKeyIndex | Indicates key expiration time in whole days from its generation moment. |
- selectedPublicKeyHandle:(int)selectedPublicKeyIndex | Allows to get or set a 'handle', a unique identifier of the underlying property object. |
- selectedPublicKeyHashAlgorithm:(int)selectedPublicKeyIndex | Specifies the hash algorithm associated with the key. |
- selectedPublicKeyIsPublic:(int)selectedPublicKeyIndex | Returns True if this key is a public key, and False otherwise. |
- selectedPublicKeyIsSecret:(int)selectedPublicKeyIndex | Returns True if this key is a secret key, and False otherwise. |
- selectedPublicKeyIsSubkey:(int)selectedPublicKeyIndex | Returns True if this key is a subkey of another key, and False otherwise. |
- selectedPublicKeyKeyFP:(int)selectedPublicKeyIndex | The 20-byte fingerprint (hash value) of this key. |
- selectedPublicKeyKeyHashAlgorithm:(int)selectedPublicKeyIndex | Specifies the hash algorithm used with DSA keys to calculate signatures. |
- selectedPublicKeyKeyID:(int)selectedPublicKeyIndex | Contains a 8-byte key identifier. |
- selectedPublicKeyOldPacketFormat:(int)selectedPublicKeyIndex | Indicates whether legacy (PGP 2. |
- selectedPublicKeyPassphrase:(int)selectedPublicKeyIndex | The key protection password. |
- selectedPublicKeyPassphraseValid:(int)selectedPublicKeyIndex | Use this property to check whether the specified Passphrase is valid and can be used to unlock the secret key. |
- selectedPublicKeyPrimaryKeyID:(int)selectedPublicKeyIndex | If this key is a subkey ( IsSubkey returns True), this property contains the identifier of the subkey's primary key. |
- selectedPublicKeyProtection:(int)selectedPublicKeyIndex | Specifies the level of protection applied to the secret key. |
- selectedPublicKeyPublicKeyAlgorithm:(int)selectedPublicKeyIndex | Specifies the asymmetric algorithm of the key. |
- selectedPublicKeyQBits:(int)selectedPublicKeyIndex | The length of the DSA Q (legitimate range: 160-512). |
- selectedPublicKeyRevoked:(int)selectedPublicKeyIndex | Returns True if the key has been revoked, and False otherwise. |
- selectedPublicKeySubkeyFP:(int)selectedPublicKeyIndex | The 20-byte fingerprint (hash value) of this key's subkey. |
- selectedPublicKeySubkeyID:(int)selectedPublicKeyIndex | Contains a 8-byte subkey identifier. |
- selectedPublicKeyTimestamp:(int)selectedPublicKeyIndex | Use this property to check the time the key was generated. |
- selectedPublicKeyUsername:(int)selectedPublicKeyIndex | Specifies the name of the user bound to this key. |
- selectedPublicKeyValid:(int)selectedPublicKeyIndex | Indicates the validity status of the key. |
- selectedPublicKeyVersion:(int)selectedPublicKeyIndex | Indicates the key version. |
- selectedSecretKeyCount | The number of records in the SelectedSecretKey arrays. |
- selectedSecretKeyBitsInKey:(int)selectedSecretKeyIndex | Indicates the key length in bits. |
- selectedSecretKeyCanEncrypt:(int)selectedSecretKeyIndex | Returns True if this key can be used for encryption. |
- selectedSecretKeyCanSign:(int)selectedSecretKeyIndex | Returns True if this key can be used for signing. |
- selectedSecretKeyCurve:(int)selectedSecretKeyIndex | Indicates the elliptic curve associated with a EC key. |
- selectedSecretKeyEnabled:(int)selectedSecretKeyIndex | Enables or disables this key for use in encryption or signing operation. |
- selectedSecretKeyEncryptionAlgorithm:(int)selectedSecretKeyIndex | Indicates the symmetric algorithm used to encrypt the secret key. |
- selectedSecretKeyExpires:(int)selectedSecretKeyIndex | Indicates key expiration time in whole days from its generation moment. |
- selectedSecretKeyHandle:(int)selectedSecretKeyIndex | Allows to get or set a 'handle', a unique identifier of the underlying property object. |
- selectedSecretKeyHashAlgorithm:(int)selectedSecretKeyIndex | Specifies the hash algorithm associated with the key. |
- selectedSecretKeyIsPublic:(int)selectedSecretKeyIndex | Returns True if this key is a public key, and False otherwise. |
- selectedSecretKeyIsSecret:(int)selectedSecretKeyIndex | Returns True if this key is a secret key, and False otherwise. |
- selectedSecretKeyIsSubkey:(int)selectedSecretKeyIndex | Returns True if this key is a subkey of another key, and False otherwise. |
- selectedSecretKeyKeyFP:(int)selectedSecretKeyIndex | The 20-byte fingerprint (hash value) of this key. |
- selectedSecretKeyKeyHashAlgorithm:(int)selectedSecretKeyIndex | Specifies the hash algorithm used with DSA keys to calculate signatures. |
- selectedSecretKeyKeyID:(int)selectedSecretKeyIndex | Contains a 8-byte key identifier. |
- selectedSecretKeyOldPacketFormat:(int)selectedSecretKeyIndex | Indicates whether legacy (PGP 2. |
- selectedSecretKeyPassphrase:(int)selectedSecretKeyIndex | The key protection password. |
- selectedSecretKeyPassphraseValid:(int)selectedSecretKeyIndex | Use this property to check whether the specified Passphrase is valid and can be used to unlock the secret key. |
- selectedSecretKeyPrimaryKeyID:(int)selectedSecretKeyIndex | If this key is a subkey ( IsSubkey returns True), this property contains the identifier of the subkey's primary key. |
- selectedSecretKeyProtection:(int)selectedSecretKeyIndex | Specifies the level of protection applied to the secret key. |
- selectedSecretKeyPublicKeyAlgorithm:(int)selectedSecretKeyIndex | Specifies the asymmetric algorithm of the key. |
- selectedSecretKeyQBits:(int)selectedSecretKeyIndex | The length of the DSA Q (legitimate range: 160-512). |
- selectedSecretKeyRevoked:(int)selectedSecretKeyIndex | Returns True if the key has been revoked, and False otherwise. |
- selectedSecretKeySubkeyFP:(int)selectedSecretKeyIndex | The 20-byte fingerprint (hash value) of this key's subkey. |
- selectedSecretKeySubkeyID:(int)selectedSecretKeyIndex | Contains a 8-byte subkey identifier. |
- selectedSecretKeyTimestamp:(int)selectedSecretKeyIndex | Use this property to check the time the key was generated. |
- selectedSecretKeyUsername:(int)selectedSecretKeyIndex | Specifies the name of the user bound to this key. |
- selectedSecretKeyValid:(int)selectedSecretKeyIndex | Indicates the validity status of the key. |
- selectedSecretKeyVersion:(int)selectedSecretKeyIndex | Indicates the key version. |
Method List
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
- addFromFile | Adds an existing key to the keyring. |
- addFromFiles | Adds a collection of keys to the keyring. |
- addPinned | Adds a pinned secret key to the keyring. |
- clear | Removes all the keys from the keyring. |
- close | Closes the keyring. |
- config | Sets or retrieves a configuration setting. |
- createNew | Creates a new empty keyring. |
- load | Loads a keyring from disk. |
- loadFromBytes | Loads a keyring from two byte arrays. |
- removeByID | Removes key by its ID. |
- removePublic | Removes the specified public key from the keyring. |
- removeSecret | Removes the specified secret key from the keyring. |
- save | Saves the keyring to disk. |
- saveToBytes | Saves the keyring to a byte array. |
- select | Filters a selection of keys from the keyring using a template. |
Event List
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
- onError | Information about errors during PGP key management. |
- onNotification | This event notifies the application about an underlying control flow event. |
Configuration Settings
The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.
TempPath | Location where the temporary files are stored. |
CheckKeyIntegrityBeforeUse | Enables or disable private key integrity check before use. |
CookieCaching | Specifies whether a cookie cache should be used for HTTP(S) transports. |
Cookies | Gets or sets local cookies for the class (supported for HTTPClient, RESTClient and SOAPClient only). |
DefDeriveKeyIterations | Specifies the default key derivation algorithm iteration count. |
EnableClientSideSSLFFDHE | Enables or disables finite field DHE key exchange support in TLS clients. |
GlobalCookies | Gets or sets global cookies for all the HTTP transports. |
HttpUserAgent | Specifies the user agent name to be used by all HTTP clients. |
LogDestination | Specifies the debug log destination. |
LogDetails | Specifies the debug log details to dump. |
LogFile | Specifies the debug log filename. |
LogFilters | Specifies the debug log filters. |
LogFlushMode | Specifies the log flush mode. |
LogLevel | Specifies the debug log level. |
LogMaxEventCount | Specifies the maximum number of events to cache before further action is taken. |
LogRotationMode | Specifies the log rotation mode. |
MaxASN1BufferLength | Specifies the maximal allowed length for ASN.1 primitive tag data. |
MaxASN1TreeDepth | Specifies the maximal depth for processed ASN.1 trees. |
OCSPHashAlgorithm | Specifies the hash algorithm to be used to identify certificates in OCSP requests. |
UseOwnDNSResolver | Specifies whether the client classes should use own DNS resolver. |
UseSharedSystemStorages | Specifies whether the validation engine should use a global per-process copy of the system certificate stores. |
UseSystemOAEPAndPSS | Enforces or disables the use of system-driven RSA OAEP and PSS computations. |
UseSystemRandom | Enables or disables the use of the OS PRNG. |