Docs

SecureBlackbox 2022 macOS Edition

Version 22.0 [Build 8174]

PGPKeyring Module

Properties   Methods   Events   Configuration Settings   Errors  

The PGPKeyring module accesses and manages PGP keyring files.

Syntax

SecureBlackbox.Pgpkeyring

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 module with short descriptions. Click on the links for further details.

FIPSModeReserved.
OpenedIndicates if the keyring is in an opened state.
PinnedKeyA PGP key that is being manipulated on.
PublicKeysPublic keys available in the keyring.
SecretKeysSecret keys available in the keyring.
SelectedPublicKeysThe public keys matching the selection criteria.
SelectedSecretKeysThe secret keys matching the selection criteria.

Method List


The following is the full list of the methods of the module 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.
DoActionPerforms an additional action.
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 module 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 module 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 module (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.
TagAllows to store any custom data.
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.

FIPSMode Property (PGPKeyring Module)

Reserved.

Syntax

public var fipsMode: Bool {

get {...}
set {...} }

@property (nonatomic,readwrite,assign,getter=FIPSMode,setter=setFIPSMode:) BOOL FIPSMode;

- (BOOL)FIPSMode;
- (void)setFIPSMode :(BOOL)newFIPSMode;

Default Value

False

Remarks

This property is reserved for future use.

Opened Property (PGPKeyring Module)

Indicates if the keyring is in an opened state.

Syntax

public var opened: Bool {

get {...} }

@property (nonatomic,readonly,assign,getter=opened) BOOL opened;

- (BOOL)opened;

Default Value

False

Remarks

If the keyring is open, it means that you can access, add, or removes keys from it.

This property is read-only.

PinnedKey Property (PGPKeyring Module)

A PGP key that is being manipulated on.

Syntax

public var pinnedKey: PGPKey {

get {...}
set {...} }

@property (nonatomic,readwrite,assign,getter=pinnedKeyHandle,setter=setPinnedKeyHandle:) long long pinnedKeyHandle;

- (long long)pinnedKeyHandle;
- (void)setPinnedKeyHandle :(long long)newPinnedKeyHandle;

 

Default Value

-1

Remarks

This property is read-only.

PublicKeys Property (PGPKeyring Module)

Public keys available in the keyring.

Syntax

public var publicKeys: Array<PGPKey> {

get {...} }

@property (nonatomic,readonly,assign,getter=publicKeyCount) int publicKeyCount;

- (int)publicKeyCount;

- (int)publicKeyBitsInKey:(int)publicKeyIndex;

- (BOOL)publicKeyCanEncrypt:(int)publicKeyIndex;

- (BOOL)publicKeyCanSign:(int)publicKeyIndex;

- (NSString*)publicKeyCurve:(int)publicKeyIndex;

- (BOOL)publicKeyEnabled:(int)publicKeyIndex;

- (NSString*)publicKeyEncryptionAlgorithm:(int)publicKeyIndex;

- (int)publicKeyExpires:(int)publicKeyIndex;

- (long long)publicKeyHandle:(int)publicKeyIndex;

- (NSString*)publicKeyHashAlgorithm:(int)publicKeyIndex;

- (BOOL)publicKeyIsPublic:(int)publicKeyIndex;

- (BOOL)publicKeyIsSecret:(int)publicKeyIndex;

- (BOOL)publicKeyIsSubkey:(int)publicKeyIndex;

- (NSString*)publicKeyKeyFP:(int)publicKeyIndex;

- (NSString*)publicKeyKeyHashAlgorithm:(int)publicKeyIndex;

- (NSString*)publicKeyKeyID:(int)publicKeyIndex;

- (BOOL)publicKeyOldPacketFormat:(int)publicKeyIndex;

- (NSString*)publicKeyPassphrase:(int)publicKeyIndex;

- (BOOL)publicKeyPassphraseValid:(int)publicKeyIndex;

- (NSString*)publicKeyPrimaryKeyID:(int)publicKeyIndex;

- (int)publicKeyProtection:(int)publicKeyIndex;

- (NSString*)publicKeyPublicKeyAlgorithm:(int)publicKeyIndex;

- (int)publicKeyQBits:(int)publicKeyIndex;

- (BOOL)publicKeyRevoked:(int)publicKeyIndex;

- (NSString*)publicKeySubkeyFP:(int)publicKeyIndex;

- (NSString*)publicKeySubkeyID:(int)publicKeyIndex;

- (NSString*)publicKeyTimestamp:(int)publicKeyIndex;

- (NSString*)publicKeyUsername:(int)publicKeyIndex;

- (int)publicKeyValid:(int)publicKeyIndex;

- (NSString*)publicKeyValidTo:(int)publicKeyIndex;

- (int)publicKeyVersion:(int)publicKeyIndex;

 

Default Value

-1

Remarks

This property is read-only.

SecretKeys Property (PGPKeyring Module)

Secret keys available in the keyring.

Syntax

public var secretKeys: Array<PGPKey> {

get {...} }

@property (nonatomic,readonly,assign,getter=secretKeyCount) int secretKeyCount;

- (int)secretKeyCount;

- (int)secretKeyBitsInKey:(int)secretKeyIndex;

- (BOOL)secretKeyCanEncrypt:(int)secretKeyIndex;

- (BOOL)secretKeyCanSign:(int)secretKeyIndex;

- (NSString*)secretKeyCurve:(int)secretKeyIndex;

- (BOOL)secretKeyEnabled:(int)secretKeyIndex;

- (NSString*)secretKeyEncryptionAlgorithm:(int)secretKeyIndex;

- (int)secretKeyExpires:(int)secretKeyIndex;

- (long long)secretKeyHandle:(int)secretKeyIndex;

- (NSString*)secretKeyHashAlgorithm:(int)secretKeyIndex;

- (BOOL)secretKeyIsPublic:(int)secretKeyIndex;

- (BOOL)secretKeyIsSecret:(int)secretKeyIndex;

- (BOOL)secretKeyIsSubkey:(int)secretKeyIndex;

- (NSString*)secretKeyKeyFP:(int)secretKeyIndex;

- (NSString*)secretKeyKeyHashAlgorithm:(int)secretKeyIndex;

- (NSString*)secretKeyKeyID:(int)secretKeyIndex;

- (BOOL)secretKeyOldPacketFormat:(int)secretKeyIndex;

- (NSString*)secretKeyPassphrase:(int)secretKeyIndex;

- (BOOL)secretKeyPassphraseValid:(int)secretKeyIndex;

- (NSString*)secretKeyPrimaryKeyID:(int)secretKeyIndex;

- (int)secretKeyProtection:(int)secretKeyIndex;

- (NSString*)secretKeyPublicKeyAlgorithm:(int)secretKeyIndex;

- (int)secretKeyQBits:(int)secretKeyIndex;

- (BOOL)secretKeyRevoked:(int)secretKeyIndex;

- (NSString*)secretKeySubkeyFP:(int)secretKeyIndex;

- (NSString*)secretKeySubkeyID:(int)secretKeyIndex;

- (NSString*)secretKeyTimestamp:(int)secretKeyIndex;

- (NSString*)secretKeyUsername:(int)secretKeyIndex;

- (int)secretKeyValid:(int)secretKeyIndex;

- (NSString*)secretKeyValidTo:(int)secretKeyIndex;

- (int)secretKeyVersion:(int)secretKeyIndex;

 

Default Value

-1

Remarks

This property is read-only.

SelectedPublicKeys Property (PGPKeyring Module)

The public keys matching the selection criteria.

Syntax

public var selectedPublicKeys: Array<PGPKey> {

get {...} }

@property (nonatomic,readonly,assign,getter=selectedPublicKeyCount) int selectedPublicKeyCount;

- (int)selectedPublicKeyCount;

- (int)selectedPublicKeyBitsInKey:(int)selectedPublicKeyIndex;

- (BOOL)selectedPublicKeyCanEncrypt:(int)selectedPublicKeyIndex;

- (BOOL)selectedPublicKeyCanSign:(int)selectedPublicKeyIndex;

- (NSString*)selectedPublicKeyCurve:(int)selectedPublicKeyIndex;

- (BOOL)selectedPublicKeyEnabled:(int)selectedPublicKeyIndex;

- (NSString*)selectedPublicKeyEncryptionAlgorithm:(int)selectedPublicKeyIndex;

- (int)selectedPublicKeyExpires:(int)selectedPublicKeyIndex;

- (long long)selectedPublicKeyHandle:(int)selectedPublicKeyIndex;

- (NSString*)selectedPublicKeyHashAlgorithm:(int)selectedPublicKeyIndex;

- (BOOL)selectedPublicKeyIsPublic:(int)selectedPublicKeyIndex;

- (BOOL)selectedPublicKeyIsSecret:(int)selectedPublicKeyIndex;

- (BOOL)selectedPublicKeyIsSubkey:(int)selectedPublicKeyIndex;

- (NSString*)selectedPublicKeyKeyFP:(int)selectedPublicKeyIndex;

- (NSString*)selectedPublicKeyKeyHashAlgorithm:(int)selectedPublicKeyIndex;

- (NSString*)selectedPublicKeyKeyID:(int)selectedPublicKeyIndex;

- (BOOL)selectedPublicKeyOldPacketFormat:(int)selectedPublicKeyIndex;

- (NSString*)selectedPublicKeyPassphrase:(int)selectedPublicKeyIndex;

- (BOOL)selectedPublicKeyPassphraseValid:(int)selectedPublicKeyIndex;

- (NSString*)selectedPublicKeyPrimaryKeyID:(int)selectedPublicKeyIndex;

- (int)selectedPublicKeyProtection:(int)selectedPublicKeyIndex;

- (NSString*)selectedPublicKeyPublicKeyAlgorithm:(int)selectedPublicKeyIndex;

- (int)selectedPublicKeyQBits:(int)selectedPublicKeyIndex;

- (BOOL)selectedPublicKeyRevoked:(int)selectedPublicKeyIndex;

- (NSString*)selectedPublicKeySubkeyFP:(int)selectedPublicKeyIndex;

- (NSString*)selectedPublicKeySubkeyID:(int)selectedPublicKeyIndex;

- (NSString*)selectedPublicKeyTimestamp:(int)selectedPublicKeyIndex;

- (NSString*)selectedPublicKeyUsername:(int)selectedPublicKeyIndex;

- (int)selectedPublicKeyValid:(int)selectedPublicKeyIndex;

- (NSString*)selectedPublicKeyValidTo:(int)selectedPublicKeyIndex;

- (int)selectedPublicKeyVersion:(int)selectedPublicKeyIndex;

 

Default Value

-1

Remarks

This property is read-only.

SelectedSecretKeys Property (PGPKeyring Module)

The secret keys matching the selection criteria.

Syntax

public var selectedSecretKeys: Array<PGPKey> {

get {...} }

@property (nonatomic,readonly,assign,getter=selectedSecretKeyCount) int selectedSecretKeyCount;

- (int)selectedSecretKeyCount;

- (int)selectedSecretKeyBitsInKey:(int)selectedSecretKeyIndex;

- (BOOL)selectedSecretKeyCanEncrypt:(int)selectedSecretKeyIndex;

- (BOOL)selectedSecretKeyCanSign:(int)selectedSecretKeyIndex;

- (NSString*)selectedSecretKeyCurve:(int)selectedSecretKeyIndex;

- (BOOL)selectedSecretKeyEnabled:(int)selectedSecretKeyIndex;

- (NSString*)selectedSecretKeyEncryptionAlgorithm:(int)selectedSecretKeyIndex;

- (int)selectedSecretKeyExpires:(int)selectedSecretKeyIndex;

- (long long)selectedSecretKeyHandle:(int)selectedSecretKeyIndex;

- (NSString*)selectedSecretKeyHashAlgorithm:(int)selectedSecretKeyIndex;

- (BOOL)selectedSecretKeyIsPublic:(int)selectedSecretKeyIndex;

- (BOOL)selectedSecretKeyIsSecret:(int)selectedSecretKeyIndex;

- (BOOL)selectedSecretKeyIsSubkey:(int)selectedSecretKeyIndex;

- (NSString*)selectedSecretKeyKeyFP:(int)selectedSecretKeyIndex;

- (NSString*)selectedSecretKeyKeyHashAlgorithm:(int)selectedSecretKeyIndex;

- (NSString*)selectedSecretKeyKeyID:(int)selectedSecretKeyIndex;

- (BOOL)selectedSecretKeyOldPacketFormat:(int)selectedSecretKeyIndex;

- (NSString*)selectedSecretKeyPassphrase:(int)selectedSecretKeyIndex;

- (BOOL)selectedSecretKeyPassphraseValid:(int)selectedSecretKeyIndex;

- (NSString*)selectedSecretKeyPrimaryKeyID:(int)selectedSecretKeyIndex;

- (int)selectedSecretKeyProtection:(int)selectedSecretKeyIndex;

- (NSString*)selectedSecretKeyPublicKeyAlgorithm:(int)selectedSecretKeyIndex;

- (int)selectedSecretKeyQBits:(int)selectedSecretKeyIndex;

- (BOOL)selectedSecretKeyRevoked:(int)selectedSecretKeyIndex;

- (NSString*)selectedSecretKeySubkeyFP:(int)selectedSecretKeyIndex;

- (NSString*)selectedSecretKeySubkeyID:(int)selectedSecretKeyIndex;

- (NSString*)selectedSecretKeyTimestamp:(int)selectedSecretKeyIndex;

- (NSString*)selectedSecretKeyUsername:(int)selectedSecretKeyIndex;

- (int)selectedSecretKeyValid:(int)selectedSecretKeyIndex;

- (NSString*)selectedSecretKeyValidTo:(int)selectedSecretKeyIndex;

- (int)selectedSecretKeyVersion:(int)selectedSecretKeyIndex;

 

Default Value

-1

Remarks

This property is read-only.

AddFromFile Method (PGPKeyring Module)

Adds an existing key to the keyring.

Syntax

public func addFromFile(filename: String) throws -> Void
- (void)addFromFile:(NSString*)filename;

Remarks

Use this method to add a key stored in a file to the keyring.

AddFromFiles Method (PGPKeyring Module)

Adds a collection of keys to the keyring.

Syntax

public func addFromFiles(publicKeyringFile: String, secretKeyringFile: String) throws -> Void
- (void)addFromFiles:(NSString*)publicKeyringFile :(NSString*)secretKeyringFile;

Remarks

Use this method to add keys stored in two separate keyring files to the keyring.

AddPinned Method (PGPKeyring Module)

Adds a pinned secret key to the keyring.

Syntax

public func addPinned() throws -> Void
- (void)addPinned;

Remarks

Use this method to add a key provided via PinnedKey to the keyring. This can be a public or secret key.

Clear Method (PGPKeyring Module)

Removes all the keys from the keyring.

Syntax

public func clear() throws -> Void
- (void)clear;

Remarks

Use this method to remove all the items from the keyring.

Close Method (PGPKeyring Module)

Closes the keyring.

Syntax

public func close() throws -> Void
- (void)close;

Remarks

Use this method to close the keyring and release any associated memory resources.

Config Method (PGPKeyring Module)

Sets or retrieves a configuration setting.

Syntax

public func config(configurationString: String) throws -> String
- (NSString*)config:(NSString*)configurationString;

Remarks

Config is a generic method available in every class. It is used to set and retrieve configuration settings for the class.

These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, access to these internal properties is provided through the Config method.

To set a configuration setting named PROPERTY, you must call Config("PROPERTY=VALUE"), where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).

To read (query) the value of a configuration setting, you must call Config("PROPERTY"). The value will be returned as a string.

CreateNew Method (PGPKeyring Module)

Creates a new empty keyring.

Syntax

public func createNew() throws -> Void
- (void)createNew;

Remarks

Use this method to initialize a new empty keyring.

DoAction Method (PGPKeyring Module)

Performs an additional action.

Syntax

public func doAction(actionID: String, actionParams: String) throws -> String
- (NSString*)doAction:(NSString*)actionID :(NSString*)actionParams;

Remarks

DoAction is a generic method available in every class. It is used to perform an additional action introduced after the product major release. The list of actions is not fixed, and may be flexibly extended over time.

The unique identifier of the action is provided in ActionID parameter. ActionParams contains a list of parameters for the action in the form of PARAM1=VALUE1;PARAM2=VALUE2;....

Load Method (PGPKeyring Module)

Loads a keyring from disk.

Syntax

public func load(publicKeyringFile: String, secretKeyringFile: String) throws -> Void
- (void)load:(NSString*)publicKeyringFile :(NSString*)secretKeyringFile;

Remarks

Use this method to load a keyring (usually stored in two files) to the keyring object. If you only have it in one file, pass an empty string as the second parameter.

LoadFromBytes Method (PGPKeyring Module)

Loads a keyring from two byte arrays.

Syntax

public func loadFromBytes(publicKeyring: Data, secretKeyring: Data) throws -> Void
- (void)loadFromBytes:(NSData*)publicKeyring :(NSData*)secretKeyring;

Remarks

Use this method to load a keyring from two byte arrays. Keyring are typically stored in the form of two files (public and secret), but if you only have one file, pass an empty array as the second parameter.

RemoveByID Method (PGPKeyring Module)

Removes key by its ID.

Syntax

public func removeByID(keyID: String) throws -> Void
- (void)removeByID:(NSString*)keyID;

Remarks

Call this method to remove the specified key from the keyring.

RemovePublic Method (PGPKeyring Module)

Removes the specified public key from the keyring.

Syntax

public func removePublic(index: Int32) throws -> Void
- (void)removePublic:(int)index;

Remarks

Use this method to remove a public key from the keyring. Use Index to pass the index of the key to be removed.

RemoveSecret Method (PGPKeyring Module)

Removes the specified secret key from the keyring.

Syntax

public func removeSecret(index: Int32) throws -> Void
- (void)removeSecret:(int)index;

Remarks

Use this method to remove a secret key from the keyring. Use Index to pass the index of the key to be removed.

Save Method (PGPKeyring Module)

Saves the keyring to disk.

Syntax

public func save(publicKeyringFile: String, secretKeyringFile: String) throws -> Void
- (void)save:(NSString*)publicKeyringFile :(NSString*)secretKeyringFile;

Remarks

Use this method to save the keyring to disk. PGP software typically uses two files to store keyrings, public and private.

SaveToBytes Method (PGPKeyring Module)

Saves the keyring to a byte array.

Syntax

public func saveToBytes(secret: Bool) throws -> Data
- (NSData*)saveToBytes:(BOOL)secret;

Remarks

Use this method to save the keyring to a byte array. PGP software typically uses two files to store keyrings. Use Secret parameter to specify which part of the keyring you would like to save (public or secret).

Select Method (PGPKeyring Module)

Filters a selection of keys from the keyring using a template.

Syntax

public func select(filter: String, secretOnly: Bool, maxCount: Int32) throws -> Void
- (void)select:(NSString*)filter :(BOOL)secretOnly :(int)maxCount;

Remarks

Use this method to get a list of keys that satisfy the Filter criteria. The filter should follow the "Name=Value" format, where Name can be one of the following: userid, fp, fingerprint, and keyid.

Set SecretOnly to True to only search for secret keys. MaxCount allows to limit the number of keys returned.

Once the method completes, the keys that match the criteria will be available in SelectedPublicKeys and SelectedSecretKeys properties.

Error Event (PGPKeyring Module)

Information about errors during PGP key management.

Syntax

func onError(errorCode: Int32, description: String)
- (void)onError:(int)errorCode :(NSString*)description;

Remarks

The event is fired in case of exceptional conditions during key management.

ErrorCode contains an error code and Description contains a textual description of the error.

Notification Event (PGPKeyring Module)

This event notifies the application about an underlying control flow event.

Syntax

func onNotification(eventID: String, eventParam: String)
- (void)onNotification:(NSString*)eventID :(NSString*)eventParam;

Remarks

The class fires this event to let the application know about some event, occurrence, or milestone in the component. For example, it may fire to report completion of the document processing. The list of events being reported is not fixed, and may be flexibly extended over time.

The unique identifier of the event is provided in EventID parameter. EventParam contains any parameters accompanying the occurrence. Depending on the type of the component, the exact action it is performing, or the document being processed, one or both may be omitted.

PGPKey Type

This container represents a PGP key.

Remarks

OpenPGP standard supports several types of keys. In our days, a typical OpenPGP keypair actually consists of two cryptographic keys: a primary key and a subkey. The primary key is normally used for signing, while the subkey is used for encryption.

While it is typical for PGP environments to use a primary key/subkey bundle, this is not a must. Sometimes you may come across standalone keys (mainly when dealing with older implementations), as well as whole key trees, each of those carrying a bunch of differently-purposed subkeys bound to the same primary key.

Algorithm-wise, OpenPGP keys also differ. Generally speaking, OpenPGP supports the following public key algorithms: RSA, Elgamal (often incorrectly referred to as DH), DSA, ECDH and ECDSA. When it comes to primary key/subkey bundles, DSA/Elgamal, RSA/RSA and ECDSA/ECDH pairs are typically used. Although there's no restriction on algorithm bundles, and, e.g. a ECDSA/Elgamal key bundle is perfectly possible, such combination is rarely used in practice.

A typical OpenPGP key is associated with some kind of user ID (Username). It is normally represented with a user's e-mail address, while in theory can be any piece of text. The secret part of the OpenPGP keypair is protected with a password (Passphrase).

Fields

bitsInKey
Int32

Indicates the key length in bits.

canEncrypt
Bool

Returns True if this key can be used for encryption.

canSign
Bool

Returns True if this key can be used for signing.

curve
String

Indicates the elliptic curve associated with a EC key.

Supported values:

SB_PGP_CURVE_P256P256
SB_PGP_CURVE_P384P384
SB_PGP_CURVE_P521P521
SB_PGP_CURVE_ED25519ED25519
SB_PGP_CURVE_CURVE25519CURVE25519
SB_PGP_CURVE_BRAINPOOLP256R1BRAINPOOLP256
SB_PGP_CURVE_BRAINPOOLP512R1BRAINPOOLP512

enabled
Bool

Enables or disables this key for use in encryption or signing operation.

encryptionAlgorithm
String

Indicates the symmetric algorithm used to encrypt the secret key.

expires
Int32

Indicates key expiration time in whole days from its generation moment. The value of 0 indicates that the key does not expire.

handle
Int64

Allows to get or set a 'handle', a unique identifier of the underlying property object. Use this property to assign objects of the same type in a quicker manner, without copying them fieldwise.

When you pass a handle of one object to another, the source object is copied to the destination rather than assigned. It is safe to get rid of the original object after such operation. pdfSigner.setSigningCertHandle(certMgr.getCertHandle());

hashAlgorithm
String

Specifies the hash algorithm associated with the key.

isPublic
Bool

Returns True if this key is a public key, and False otherwise.

isSecret
Bool

Returns True if this key is a secret key, and False otherwise.

isSubkey
Bool

Returns True if this key is a subkey of another key, and False otherwise.

keyFP
String

The 20-byte fingerprint (hash value) of this key.

KeyFP could be used to distinguish two keys with the same KeyID.

keyHashAlgorithm
String

Specifies the hash algorithm used with DSA keys to calculate signatures.

keyID
String

Contains a 8-byte key identifier.

It is quite rare that IDs of two keys collide. If that happens, their fingerprints (KeyFP) can be used for distinguish between the keys. Please note that many PGP implementations show only 4 lowest bytes of the KeyID to the user.

oldPacketFormat
Bool

Indicates whether legacy (PGP 2.6.x) packet format should be used.

passphrase
String

The key protection password.

passphraseValid
Bool

Use this property to check whether the specified is valid and can be used to unlock the secret key.

primaryKeyID
String

If this key is a subkey ( returns True), this property contains the identifier of the subkey's primary key.

protection
PGPProtectionTypes

Specifies the level of protection applied to the secret key.

Allowed values:

pptNone0Key is not encrypted
pptLow1Only the password hash is used to derive the secret key
pptNormal2Password hash with salt is used to derive the secret key
pptHigh3Hash from multiple passwords and salt are used for key derivation

publicKeyAlgorithm
String

Specifies the asymmetric algorithm of the key.

qBits
Int32

The length of the DSA Q (legitimate range: 160-512).

This parameter corresponds to the hash algorithm used with the key. For example, if the value of Q is 256, SHA-256 will be used.

revoked
Bool

Returns True if the key has been revoked, and False otherwise.

subkeyFP
String

The 20-byte fingerprint (hash value) of this key's subkey.

KeyFP could be used to distinguish two subkeys with the same SubkeyID.

subkeyID
String

Contains a 8-byte subkey identifier.

It is quite rare that IDs of two keys collide. If that happens, their fingerprints (SubkeyFP) can be used to distinguish between the keys. Please note that many PGP implementations show only 4 lowest bytes of the KeyID to the user.

timestamp
String

Use this property to check the time the key was generated. The date and time are stored and retrieved in Universal Coordinate Time (UTC).

username
String

Specifies the name of the user bound to this key.

The PGP username is typically represented with a full name and an email address, but generally can be any non-empty string.

valid
PGPKeyValidities

Indicates the validity status of the key.

pkvStrictlyValid0Strictly valid

pkvValid1Valid

pkvInvalid2Invalid

pkvFailure3Generic validation failure

pkvUnknown4Validity unknown

validTo
String

Provide accurate expiration moment indication. This is different to property which only contains expiration time in days in old keys.

version
Int32

Indicates the key version.

The key version refers to the version of the public-key packet format as defined in RFC 4880.

Only two versions are currently allowed here: 3 and 4. It is recommended that all new keys are created with version of 4.

Constructors

public init()

Creates an empty PGP key object.

Configuration Settings (PGPKeyring Module)

The class accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, access to these internal properties is provided through the Config method.

PGPKeyring Configuration Settings

TempPath:   Location where the temporary files are stored.

This setting specifies an absolute path to the location on disk where temporary files are stored.

Base Configuration Settings

CheckKeyIntegrityBeforeUse:   Enables or disable private key integrity check before use.

This global property enables or disables private key material check before each signing operation. This slows down performance a bit, but prevents a selection of attacks on RSA keys where keys with unknown origins are used.

You can switch this property off to improve performance if your project only uses known, good private keys.

CookieCaching:   Specifies whether a cookie cache should be used for HTTP(S) transports.

Set this property to enable or disable cookies caching for the class.

Supported values are:

offNo caching (default)
localLocal caching (supported for HTTPClient, RESTClient and SOAPClient only)
globalGlobal caching

Cookies:   Gets or sets local cookies for the class (supported for HTTPClient, RESTClient and SOAPClient only).

Use this property to get cookies from the internal cookie storage of the class and/or restore them back between application sessions.

DefDeriveKeyIterations:   Specifies the default key derivation algorithm iteration count.

This global property sets the default number of iterations for all supported key derivation algorithms. Note that you can provide the required number of iterations by using properties of the relevant key generation component; this global setting is used in scenarios where specific iteration count is not or cannot be provided.

EnableClientSideSSLFFDHE:   Enables or disables finite field DHE key exchange support in TLS clients.

This global property enables or disables support for finite field DHE key exchange methods in TLS clients. FF DHE is a slower algorithm if compared to EC DHE; enabling it may result in slower connections.

This setting only applies to sessions negotiated with TLS version 1.3.

GlobalCookies:   Gets or sets global cookies for all the HTTP transports.

Use this property to get cookies from the GLOBAL cookie storage or restore them back between application sessions. These cookies will be used by all the classes that have its CookieCaching property set to "global".

HttpUserAgent:   Specifies the user agent name to be used by all HTTP clients.

This global setting defines the User-Agent field of the HTTP request provides information about the software that initiates the request. This value will be used by all the HTTP clients including the ones used internally in other classes.

LogDestination:   Specifies the debug log destination.

Contains a comma-separated list of values that specifies where debug log should be dumped.

Supported values are:

fileFile
consoleConsole
systemlogSystem Log (supported for Android only)
debuggerDebugger (supported for VCL for Windows and .Net)

LogDetails:   Specifies the debug log details to dump.

Contains a comma-separated list of values that specifies which debug log details to dump.

Supported values are:

timeCurrent time
levelLevel
packagePackage name
moduleModule name
classClass name
methodMethod name
threadidThread Id
contenttypeContent type
contentContent
allAll details

LogFile:   Specifies the debug log filename.

Use this property to provide a path to the log file.

LogFilters:   Specifies the debug log filters.

Contains a comma-separated list of value pairs ("name:value") that describe filters.

Supported filter names are:

exclude-packageExclude a package specified in the value
exclude-moduleExclude a module specified in the value
exclude-classExclude a class specified in the value
exclude-methodExclude a method specified in the value
include-packageInclude a package specified in the value
include-moduleInclude a module specified in the value
include-classInclude a class specified in the value
include-methodInclude a method specified in the value

LogFlushMode:   Specifies the log flush mode.

Use this property to set the log flush mode. The following values are defined:

noneNo flush (caching only)
immediateImmediate flush (real-time logging)
maxcountFlush cached entries upon reaching LogMaxEventCount entries in the cache.

LogLevel:   Specifies the debug log level.

Use this property to provide the desired debug log level.

Supported values are:

noneNone (by default)
fatalSevere errors that cause premature termination.
errorOther runtime errors or unexpected conditions.
warningUse of deprecated APIs, poor use of API, 'almost' errors, other runtime situations that are undesirable or unexpected, but not necessarily "wrong".
infoInteresting runtime events (startup/shutdown).
debugDetailed information on flow of through the system.
traceMore detailed information.

LogMaxEventCount:   Specifies the maximum number of events to cache before further action is taken.

Use this property to specify the log event number threshold. This threshold may have different effects, depending on the rotation setting and/or the flush mode.

The default value of this setting is 100.

LogRotationMode:   Specifies the log rotation mode.

Use this property to set the log rotation mode. The following values are defined:

noneNo rotation
deleteolderDelete older entries from the cache upon reaching LogMaxEventCount
keepolderKeep older entries in the cache upon reaching LogMaxEventCount (newer entries are discarded)

MaxASN1BufferLength:   Specifies the maximal allowed length for ASN.1 primitive tag data.

This global property limits the maximal allowed length for ASN.1 tag data for non-content-carrying structures, such as certificates, CRLs, or timestamps. It does not affect structures that can carry content, such as CMS/CAdES messages. This is a security property aiming at preventing DoS attacks.

MaxASN1TreeDepth:   Specifies the maximal depth for processed ASN.1 trees.

This global property limits the maximal depth of ASN.1 trees that the component can handle without throwing an error. This is a security property aiming at preventing DoS attacks.

OCSPHashAlgorithm:   Specifies the hash algorithm to be used to identify certificates in OCSP requests.

This global setting defines the hash algorithm to use in OCSP requests during chain validation. Some OCSP responders can only use older algorithms, in which case setting this property to SHA1 may be helpful.

Tag:   Allows to store any custom data.

Use this config property to store any custom data.

UseSharedSystemStorages:   Specifies whether the validation engine should use a global per-process copy of the system certificate stores.

Set this global property to false to make each validation run use its own copy of system certificate stores.

UseSystemOAEPAndPSS:   Enforces or disables the use of system-driven RSA OAEP and PSS computations.

This global setting defines who is responsible for performing RSA-OAEP and RSA-PSS computations where the private key is stored in a Windows system store and is exportable. If set to true, SBB will delegate the computations to Windows via a CryptoAPI call. Otherwise, it will export the key material and perform the computations using its own OAEP/PSS implementation.

This setting only applies to certificates originating from a Windows system store.

UseSystemRandom:   Enables or disables the use of the OS PRNG.

Use this global property to enable or disable the use of operating system-driven pseudorandom number generation.

Trappable Errors (PGPKeyring Module)

PGPKeyring Errors

1048577   Invalid parameter value (SB_ERROR_INVALID_PARAMETER)
1048578   Class is configured incorrectly (SB_ERROR_INVALID_SETUP)
1048579   Operation cannot be executed in the current state (SB_ERROR_INVALID_STATE)
1048580   Attempt to set an invalid value to a property (SB_ERROR_INVALID_VALUE)
1048581   Certificate does not have its private key loaded (SB_ERROR_NO_PRIVATE_KEY)
1048581   Cancelled by the user (SB_ERROR_CANCELLED_BY_USER) 
27262977   File does not exist (SB_ERROR_PGP_FILE_NOT_EXISTS)
27262978   Invalid key (SB_ERROR_PGP_INVALID_KEY)
27262979   No public key (SB_ERROR_PGP_NO_PUBLIC_KEY)
27262980   No secret key (SB_ERROR_PGP_NO_SECRET_KEY)
27262981   Not found (SB_ERROR_PGP_NOT_FOUND)
27262982   Operation cannot be performed on a subkey (SB_ERROR_PGP_OPERATION_ON_SUBKEY)

Copyright (c) 2022 /n software inc. - All rights reserved.
SecureBlackbox 2022 macOS Edition - Version 22.0 [Build 8174]