SecureBlackbox 2020 PHP Edition

Questions / Feedback?

PGPKeyring Class

Properties   Methods   Events   Configuration Settings   Errors  

The PGPKeyring class accesses and manages PGP keyring files.

Class Name

SecureBlackbox_PGPKeyring

Procedural Interface

 secureblackbox_pgpkeyring_open();
 secureblackbox_pgpkeyring_close($res);
 secureblackbox_pgpkeyring_register_callback($res, $id, $function);
 secureblackbox_pgpkeyring_get_last_error($res);
 secureblackbox_pgpkeyring_get_last_error_code($res);
 secureblackbox_pgpkeyring_set($res, $id, $index, $value);
 secureblackbox_pgpkeyring_get($res, $id, $index);
 secureblackbox_pgpkeyring_do_addfromfile($res, $filename);
 secureblackbox_pgpkeyring_do_addfromfiles($res, $publickeyringfile, $secretkeyringfile);
 secureblackbox_pgpkeyring_do_addpinned($res);
 secureblackbox_pgpkeyring_do_clear($res);
 secureblackbox_pgpkeyring_do_close($res);
 secureblackbox_pgpkeyring_do_config($res, $configurationstring);
 secureblackbox_pgpkeyring_do_createnew($res);
 secureblackbox_pgpkeyring_do_load($res, $publickeyringfile, $secretkeyringfile);
 secureblackbox_pgpkeyring_do_loadfrombytes($res, $publickeyring, $secretkeyring);
 secureblackbox_pgpkeyring_do_removebyid($res, $keyid);
 secureblackbox_pgpkeyring_do_removepublic($res, $index);
 secureblackbox_pgpkeyring_do_removesecret($res, $index);
 secureblackbox_pgpkeyring_do_save($res, $publickeyringfile, $secretkeyringfile);
 secureblackbox_pgpkeyring_do_savetobytes($res, $secret);
 secureblackbox_pgpkeyring_do_select($res, $filter, $secretonly, $maxcount);

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.

OpenedIndicates if the keyring is in an opened state.
PinnedKeyHandleAllows to get or set a 'handle', a unique identifier of the underlying property object.
PublicKeyCountThe number of records in the PublicKey arrays.
PublicKeyBitsInKeyIndicates the key length in bits.
PublicKeyCanEncryptReturns True if this key can be used for encryption.
PublicKeyCanSignReturns True if this key can be used for signing.
PublicKeyCurveIndicates the elliptic curve associated with a EC key.
PublicKeyEnabledEnables or disables this key for use in encryption or signing operation.
PublicKeyEncryptionAlgorithmIndicates the symmetric algorithm used to encrypt the secret key.
PublicKeyExpiresIndicates key expiration time in whole days from its generation moment.
PublicKeyHandleAllows to get or set a 'handle', a unique identifier of the underlying property object.
PublicKeyHashAlgorithmSpecifies the hash algorithm associated with the key.
PublicKeyIsPublicReturns True if this key is a public key, and False otherwise.
PublicKeyIsSecretReturns True if this key is a secret key, and False otherwise.
PublicKeyIsSubkeyReturns True if this key is a subkey of another key, and False otherwise.
PublicKeyKeyFPThe 20-byte fingerprint (hash value) of this key.
PublicKeyKeyHashAlgorithmSpecifies the hash algorithm used with DSA keys to calculate signatures.
PublicKeyKeyIDContains a 8-byte key identifier.
PublicKeyOldPacketFormatIndicates whether legacy (PGP 2.
PublicKeyPassphraseThe key protection password.
PublicKeyPassphraseValidUse this property to check whether the specified Passphrase is valid and can be used to unlock the secret key.
PublicKeyPrimaryKeyIDIf this key is a subkey ( IsSubkey returns True), this property contains the identifier of the subkey's primary key.
PublicKeyProtectionSpecifies the level of protection applied to the secret key.
PublicKeyPublicKeyAlgorithmSpecifies the asymmetric algorithm of the key.
PublicKeyQBitsThe length of the DSA Q (legitimate range: 160-512).
PublicKeyRevokedReturns True if the key has been revoked, and False otherwise.
PublicKeySubkeyFPThe 20-byte fingerprint (hash value) of this key's subkey.
PublicKeySubkeyIDContains a 8-byte subkey identifier.
PublicKeyTimestampUse this property to check the time the key was generated.
PublicKeyUsernameSpecifies the name of the user bound to this key.
PublicKeyValidIndicates the validity status of the key.
PublicKeyVersionIndicates the key version.
SecretKeyCountThe number of records in the SecretKey arrays.
SecretKeyBitsInKeyIndicates the key length in bits.
SecretKeyCanEncryptReturns True if this key can be used for encryption.
SecretKeyCanSignReturns True if this key can be used for signing.
SecretKeyCurveIndicates the elliptic curve associated with a EC key.
SecretKeyEnabledEnables or disables this key for use in encryption or signing operation.
SecretKeyEncryptionAlgorithmIndicates the symmetric algorithm used to encrypt the secret key.
SecretKeyExpiresIndicates key expiration time in whole days from its generation moment.
SecretKeyHandleAllows to get or set a 'handle', a unique identifier of the underlying property object.
SecretKeyHashAlgorithmSpecifies the hash algorithm associated with the key.
SecretKeyIsPublicReturns True if this key is a public key, and False otherwise.
SecretKeyIsSecretReturns True if this key is a secret key, and False otherwise.
SecretKeyIsSubkeyReturns True if this key is a subkey of another key, and False otherwise.
SecretKeyKeyFPThe 20-byte fingerprint (hash value) of this key.
SecretKeyKeyHashAlgorithmSpecifies the hash algorithm used with DSA keys to calculate signatures.
SecretKeyKeyIDContains a 8-byte key identifier.
SecretKeyOldPacketFormatIndicates whether legacy (PGP 2.
SecretKeyPassphraseThe key protection password.
SecretKeyPassphraseValidUse this property to check whether the specified Passphrase is valid and can be used to unlock the secret key.
SecretKeyPrimaryKeyIDIf this key is a subkey ( IsSubkey returns True), this property contains the identifier of the subkey's primary key.
SecretKeyProtectionSpecifies the level of protection applied to the secret key.
SecretKeyPublicKeyAlgorithmSpecifies the asymmetric algorithm of the key.
SecretKeyQBitsThe length of the DSA Q (legitimate range: 160-512).
SecretKeyRevokedReturns True if the key has been revoked, and False otherwise.
SecretKeySubkeyFPThe 20-byte fingerprint (hash value) of this key's subkey.
SecretKeySubkeyIDContains a 8-byte subkey identifier.
SecretKeyTimestampUse this property to check the time the key was generated.
SecretKeyUsernameSpecifies the name of the user bound to this key.
SecretKeyValidIndicates the validity status of the key.
SecretKeyVersionIndicates the key version.
SelectedPublicKeyCountThe number of records in the SelectedPublicKey arrays.
SelectedPublicKeyBitsInKeyIndicates the key length in bits.
SelectedPublicKeyCanEncryptReturns True if this key can be used for encryption.
SelectedPublicKeyCanSignReturns True if this key can be used for signing.
SelectedPublicKeyCurveIndicates the elliptic curve associated with a EC key.
SelectedPublicKeyEnabledEnables or disables this key for use in encryption or signing operation.
SelectedPublicKeyEncryptionAlgorithmIndicates the symmetric algorithm used to encrypt the secret key.
SelectedPublicKeyExpiresIndicates key expiration time in whole days from its generation moment.
SelectedPublicKeyHandleAllows to get or set a 'handle', a unique identifier of the underlying property object.
SelectedPublicKeyHashAlgorithmSpecifies the hash algorithm associated with the key.
SelectedPublicKeyIsPublicReturns True if this key is a public key, and False otherwise.
SelectedPublicKeyIsSecretReturns True if this key is a secret key, and False otherwise.
SelectedPublicKeyIsSubkeyReturns True if this key is a subkey of another key, and False otherwise.
SelectedPublicKeyKeyFPThe 20-byte fingerprint (hash value) of this key.
SelectedPublicKeyKeyHashAlgorithmSpecifies the hash algorithm used with DSA keys to calculate signatures.
SelectedPublicKeyKeyIDContains a 8-byte key identifier.
SelectedPublicKeyOldPacketFormatIndicates whether legacy (PGP 2.
SelectedPublicKeyPassphraseThe key protection password.
SelectedPublicKeyPassphraseValidUse this property to check whether the specified Passphrase is valid and can be used to unlock the secret key.
SelectedPublicKeyPrimaryKeyIDIf this key is a subkey ( IsSubkey returns True), this property contains the identifier of the subkey's primary key.
SelectedPublicKeyProtectionSpecifies the level of protection applied to the secret key.
SelectedPublicKeyPublicKeyAlgorithmSpecifies the asymmetric algorithm of the key.
SelectedPublicKeyQBitsThe length of the DSA Q (legitimate range: 160-512).
SelectedPublicKeyRevokedReturns True if the key has been revoked, and False otherwise.
SelectedPublicKeySubkeyFPThe 20-byte fingerprint (hash value) of this key's subkey.
SelectedPublicKeySubkeyIDContains a 8-byte subkey identifier.
SelectedPublicKeyTimestampUse this property to check the time the key was generated.
SelectedPublicKeyUsernameSpecifies the name of the user bound to this key.
SelectedPublicKeyValidIndicates the validity status of the key.
SelectedPublicKeyVersionIndicates the key version.
SelectedSecretKeyCountThe number of records in the SelectedSecretKey arrays.
SelectedSecretKeyBitsInKeyIndicates the key length in bits.
SelectedSecretKeyCanEncryptReturns True if this key can be used for encryption.
SelectedSecretKeyCanSignReturns True if this key can be used for signing.
SelectedSecretKeyCurveIndicates the elliptic curve associated with a EC key.
SelectedSecretKeyEnabledEnables or disables this key for use in encryption or signing operation.
SelectedSecretKeyEncryptionAlgorithmIndicates the symmetric algorithm used to encrypt the secret key.
SelectedSecretKeyExpiresIndicates key expiration time in whole days from its generation moment.
SelectedSecretKeyHandleAllows to get or set a 'handle', a unique identifier of the underlying property object.
SelectedSecretKeyHashAlgorithmSpecifies the hash algorithm associated with the key.
SelectedSecretKeyIsPublicReturns True if this key is a public key, and False otherwise.
SelectedSecretKeyIsSecretReturns True if this key is a secret key, and False otherwise.
SelectedSecretKeyIsSubkeyReturns True if this key is a subkey of another key, and False otherwise.
SelectedSecretKeyKeyFPThe 20-byte fingerprint (hash value) of this key.
SelectedSecretKeyKeyHashAlgorithmSpecifies the hash algorithm used with DSA keys to calculate signatures.
SelectedSecretKeyKeyIDContains a 8-byte key identifier.
SelectedSecretKeyOldPacketFormatIndicates whether legacy (PGP 2.
SelectedSecretKeyPassphraseThe key protection password.
SelectedSecretKeyPassphraseValidUse this property to check whether the specified Passphrase is valid and can be used to unlock the secret key.
SelectedSecretKeyPrimaryKeyIDIf this key is a subkey ( IsSubkey returns True), this property contains the identifier of the subkey's primary key.
SelectedSecretKeyProtectionSpecifies the level of protection applied to the secret key.
SelectedSecretKeyPublicKeyAlgorithmSpecifies the asymmetric algorithm of the key.
SelectedSecretKeyQBitsThe length of the DSA Q (legitimate range: 160-512).
SelectedSecretKeyRevokedReturns True if the key has been revoked, and False otherwise.
SelectedSecretKeySubkeyFPThe 20-byte fingerprint (hash value) of this key's subkey.
SelectedSecretKeySubkeyIDContains a 8-byte subkey identifier.
SelectedSecretKeyTimestampUse this property to check the time the key was generated.
SelectedSecretKeyUsernameSpecifies the name of the user bound to this key.
SelectedSecretKeyValidIndicates the validity status of the key.
SelectedSecretKeyVersionIndicates 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.

AddFromFileAdds an existing key to the keyring.
AddFromFilesAdds a collection of keys to the keyring.
AddPinnedAdds a pinned secret key to the keyring.
ClearRemoves all the keys from the keyring.
CloseCloses the keyring.
ConfigSets or retrieves a configuration setting.
CreateNewCreates a new empty keyring.
LoadLoads a keyring from disk.
LoadFromBytesLoads a keyring from two byte arrays.
RemoveByIDRemoves key by its ID.
RemovePublicRemoves the specified public key from the keyring.
RemoveSecretRemoves the specified secret key from the keyring.
SaveSaves the keyring to disk.
SaveToBytesSaves the keyring to a byte array.
SelectFilters 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.

ErrorInformation about errors during PGP key management.
NotificationThis 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.

TempPathLocation where the temporary files are stored.
CheckKeyIntegrityBeforeUseEnables or disable private key integrity check before use.
CookieCachingSpecifies whether a cookie cache should be used for HTTP(S) transports.
CookiesGets or sets local cookies for the class (supported for HTTPClient, RESTClient and SOAPClient only).
DefDeriveKeyIterationsSpecifies the default key derivation algorithm iteration count.
EnableClientSideSSLFFDHEEnables or disables finite field DHE key exchange support in TLS clients.
GlobalCookiesGets or sets global cookies for all the HTTP transports.
HttpUserAgentSpecifies the user agent name to be used by all HTTP clients.
LogDestinationSpecifies the debug log destination.
LogDetailsSpecifies the debug log details to dump.
LogFileSpecifies the debug log filename.
LogFiltersSpecifies the debug log filters.
LogFlushModeSpecifies the log flush mode.
LogLevelSpecifies the debug log level.
LogMaxEventCountSpecifies the maximum number of events to cache before further action is taken.
LogRotationModeSpecifies the log rotation mode.
MaxASN1BufferLengthSpecifies the maximal allowed length for ASN.1 primitive tag data.
MaxASN1TreeDepthSpecifies the maximal depth for processed ASN.1 trees.
OCSPHashAlgorithmSpecifies the hash algorithm to be used to identify certificates in OCSP requests.
UseOwnDNSResolverSpecifies whether the client classes should use own DNS resolver.
UseSharedSystemStoragesSpecifies whether the validation engine should use a global per-process copy of the system certificate stores.
UseSystemOAEPAndPSSEnforces or disables the use of system-driven RSA OAEP and PSS computations.
UseSystemRandomEnables or disables the use of the OS PRNG.

Copyright (c) 2022 /n software inc. - All rights reserved.
SecureBlackbox 2020 PHP Edition - Version 20.0 [Build 8154]