PGP-Related Settings
In addition to the ICIPgpActionParams Interface and the ICIPGPKeyInfo Interface, PGP-related settings can also be found in the ICIServer Interface, ICISite Interface, and Enum Reference.
In the ICIServer Interface:
-
Property AvailablePGPKeys As Variant read-only
Retrieve a list of EFT’s PGP Keys. Its value is a variant containing the array of ICIPGPKeyInfo
HRESULT AvailablePGPKeys([out, retval]VARIANT* pVal);
Example (VBScript):
For Each key In Server.AvailablePGPKeys MsgBox key.Name & " key is available" Next
EFT v6.1 and later
Function CreatePGPKey(bstrFullName As String, bstrEmailAddress As String, dtExpirationDate As Date, nKeyType As PGPKeyType, nKeyCipher As PGPKeyCipher, ulKeySize As DWord, bstrPassphrase As String) As String
Create a PGPKey on EFT:
HRESULT CreatePGPKey( [in] BSTR bstrFullName, [in] BSTR bstrEmailAddress, [in] DATE dtExpirationDate, [in] PGPKeyType nKeyType, [in] PGPKeyCipher nKeyCipher, [in] ULONG ulKeySize, [in] BSTR bstrPassphrase, [out,retval] BSTR* pVal);
PGPKeyType
-
PGPKeyType_DSS = 0
-
PGPKeyType_RSA = 1
-
PGPKeyType_RSALegacy = 2
PGPKeyCipher
-
PGPKeyCipher_IDEA = 0
-
PGPKeyCipher_3DES = 1
-
PGPKeyCipher_CAST5 = 2
-
PGPKeyCipher_AES128 = 3
-
PGPKeyCipher_AES192 = 4
-
PGPKeyCipher_AES256 = 5
-
PGPKeyCipher_TWOFISH = 6
Example (VBScript):
strKeyId = oServer.CreatePGPKey("Ivan Ivanuch", "ipetrov@mail.com", expDate, PGPKeyType_RSA, PGPKeyCipher_IDEA, 1024, "password") MsgBox "New key id is " & strKeyId
EFT v6.3 and later
Sub ExportPGPKey(bstrKeyId As String, vbIncludePrivate As Boolean, bstrFileName As String)
Export an Open PGP Key:
HRESULT ExportPGPKey( [in] BSTR bstrKeyId, [in] VARIANT_BOOL vbIncludePrivate, [in] BSTR bstrFileName);
Example (VBScript):
oServer.ExportPGPKey "0x12345678", False, "C:\PGP\pgpkey.asc"
EFT v6.3 and later
Sub GetPGPKeyringSettings(pPublicPath As String, pPrivatePath As String)
For an example using this method, refer to the PGP script in Script Examples.
Retrieve the OpenPGP Keyring settings.
HRESULT GetPGPKeyringSettings( [out] VARIANT* pPublicPath, [out] VARIANT* pPrivatePath);
Example (VBScript):
oServer.GetPGPKeyringSettings strPublicKeyring, strPrivateKeyring
Example (C#):
m_server.ImportSSHKey(@"C:\SSHKey.pub"); object publicPath = new object(); object privatePath = new object(); m_server.GetPGPKeyringSettings(out publicPath, out privatePath); m_server.SetPGPKeyringSettings(@"C:\filecryptdata\pubring.pgp", @"C:\filecryptdata\secring.pgp");
(ImportSSHKey deprecated in v8)
EFT v6.3 and later
Sub ImportPGPKey(bstrKey As String, bstrKeyFile As String)
HRESULT ImportPGPKey([in] BSTR bstrKeyPath,[out, retval] BSTR* pNewKeyID);
Example (VBScript):
KeyId = oServer.ImportPGPKey("C:\PGP\pgpkey.asc")
EFT v6.3 and later
Sub RemovePGPKey(bstrKeyId As String)
Removes OpenPGP Key from EFT.
HRESULT RemovePGPKey([in] BSTR bstrKeyId);
Example (VBScript):
oServer.RemovePGPKey "0x01234567"
EFT v6.3 and later
Sub SetPGPKeyringSettings(newPublicKeyring As String, newPrivateKeyring As String)
For an example using this method, refer to the PGP script in Script Examples.
Changes OpenPGP Keyring settings.
HRESULT SetPGPKeyringSettings([in] BSTR newPublicKeyring,[in] BSTR newPrivateKeyring);
Retrieve OpenPGP Keyring settings with GetPGPKeyringSettings.
Example (VBScript):
oServer.SetPGPKeyringSettings "C:\PGP\pubrign.pgp", "C:\PGP\secring.pgp"
Example (C#):
m_server.ImportSSHKey(@"C:\SSHKey.pub"); object publicPath = new object(); object privatePath = new object(); m_server.GetPGPKeyringSettings(out publicPath, out privatePath); m_server.SetPGPKeyringSettings(@"C:\filecryptdata\pubring.pgp", @"C:\filecryptdata\secring.pgp");
EFT v6.3 and later
In the ICISite Interface:
-
Property DefaultPGPKeyID As String (read-only)
See also SetDefaultPGPKey
Retrieves the default PGP Key ID or empty string if Site has not default key.
HRESULT DefaultPGPKeyID([out, retval] BSTR* pVal);
EFT v6.4 and later
Property DefaultPGPKeyPassphrase As String (read-only)
See also SetDefaultPGPKey
Retrieves the default PGP Key passphrase.
HRESULT DefaultPGPKeyPassphrase([out, retval] BSTR* pVal);
EFT. v6.4 and later
Property EnablePGPLogging As Boolean
Retrieves or specifies whether OpenPGP logging is enabled.
HRESULT EnablePGPLogging([out, retval] VARIANT_BOOL* pVal); HRESULT EnablePGPLogging([in] VARIANT_BOOL newVal);
TRUE=Enabled; FALSE=Disabled
Example (VBScript):
Retrieving:
MsgBox "PGP logging: " & CStr(oSite.EnablePGPLogging)
Specifying:
oSite.EnablePGPLogging = False
EFT v6.3 and later
Property PGPLogFilePath As String
Retrieves or specifies the log file path.
HRESULT PGPLogFilePath([out, retval] BSTR* pVal); HRESULT PGPLogFilePath([in] BSTR newVal);
Example (VBScript):
Retrieving:
MsgBox "PGP log file path: " & oSite.PGPLogFilePath
Specifying:
oSite.PGPLogFilePath = "C:\PGP\logfile.txt"
EFT v6.3 and later
Property PGPLogLevel As PGPLogLevel
Retrieves or specifies the OpenPGP logging level.
HRESULT PGPLogLevel([out, retval] PGPLogLevel* pVal); HRESULT PGPLogLevel([in] PGPLogLevel newVal);
PGPLogLevel
-
PGPLogLevelStandard = 0
-
PGPLogLevelVerbose = 1
Example (VBScript):
Retrieving:
if PGPLogLevelStandard = oSite.PGPLogLevel MsgBox "PGP log level is standard." End If
Specifying:
oSite.PGPLogLevel = PGPLogLevelVerbose
EFT v6.3 and later
Sub SetDefaultPGPKey(bzKeyID As String, bzPassPhrase As String)
See also DefaultPGPKeyID and DefaultPGPKeyPassphrase.
Specifies the default PGP Key and passphrase. Specify an empty string for the key to assign "no key."
HRESULT SetDefaultPGPKey([in] BSTR bzKeyID, [in] BSTR bzPassphrase);
EFT v6.4 and later
Property UseDynamicPGPLogFile As Boolean
Retrieves or specifies whether to use dynamic log file.
HRESULT UseDynamicPGPLogFile([out, retval] VARIANT_BOOL* pVal); HRESULT UseDynamicPGPLogFile([in] VARIANT_BOOL newVal);
Example (VBScript):
Retrieving:
MsgBox "PGP uses dynamic log file:" & CStr(oSite.UseDynamicPGPLogFile)
Specifying:
oSite.UseDynamicPGPLogFile = true
EFT v6.3 and later
In the Enum Reference:
EventActionType (v6.0 and later)
Used in the ICIEventAction Interface type property.
-
PGPAction = 32
PGPCompressionLevel (v6.1 and later)
Used to specify the compression level for a PGP encryption operation in the ICIPgpActionParams InterfaceCompressionLevel property.
-
NoCompression = 0
-
CompressionLevel1 = 1
-
CompressionLevel2 = 2
-
CompressionLevel3 = 3
-
CompressionLevel4 = 4
-
CompressionLevel5 = 5
-
CompressionLevel6 = 6
-
CompressionLevel7 = 7
-
CompressionLevel8 = 8
-
CompressionLevel9 = 9
Used in the ICIServer Interface CreatePGPKey method to specify the PGP key cipher.
-
PGPKeyCipher_IDEA = 0
-
PGPKeyCipher_3DES = 1
-
PGPKeyCipher_CAST5 = 2
-
PGPKeyCipher_AES128 = 3
-
PGPKeyCipher_AES192 = 4
-
PGPKeyCipher_AES256 = 5
-
PGPKeyCipher_TWOFISH = 6
Used in the ICIServer Interface CreatePGPKey method to specify the PGP key type.
-
PGPKeyType_DSS = 0
-
PGPKeyType_RSA = 1
-
PGPKeyType_RSALegacy = 2
Used in the ICISite Interface PGPLogLevel property to specify the PGP module log level.
-
PGPLogLevelStandard = 0
-
PGPLogLevelVerbose = 1
Used to specify the PGP operation to perform on a file in the ICIPgpActionParams Interface Operation property.
-
Encrypt = 0
-
EncryptAndSign (added in v6.1) = 1
-
Sign (added in v6.1) = 2
-
SDA (added in v6.1) = 3
-
Decrypt (added in v6.1) = 4
-
DecryptAndVerify (added in v6.3) = 5
-
VerifyOnly (added in v6.3) = 6
PGPSigningHash (v6.1 and later)
Used to specify the hash algorithm for a PGP signing operation in the ICIPgpActionParams Interface SigningHash property.
-
MD5Hash = 0
-
SHA1Hash = 1
-
RIPEMD160Hash = 2
-
SHA256Hash = 3
-
SHA384Hash = 4
-
SHA512Hash = 5
ServerModule (v6.1 and later)
Used in the ICIServer Interface ModuleRegistrationState method to retrieve an EFT module state. Used with the RegistrationState enumerator.
-
PGPModule = 5