MailWriter Class
Properties Methods Events Config Settings Errors
The MailWriter class composes, encrypts, and signs e-mail messages.
Syntax
MailWriter
Remarks
Use MailWriter to compose, sign, and encrypt e-mail messages, and prepare them for sending or saving.
Preparing a very simple message and saving it to a file:
MailWriter writer = new MailWriter();
writer.From.Add(new MailAddress("John Doe", "jdoe@company.com"));
writer.SendTo.Add(new MailAddress("Mary Dow", "mdow@home.com"));
writer.Message.Subject = "Lating to the party";
writer.Message.PlainText = "Hi Mary!\r\nStill in the office waiting for my partner.\r\nProbably I'll be late to the party for about an hour.\r\nSorry.\r\nJohn";
writer.SaveToFile("path\\message.eml");
Attaching an image and referencing it from the message text:
writer.AttachImage("myimage", File.ReadAllBytes("path\\image.jpg"));
writer.Attachments[0].ContentSubtype = "jpeg";
writer.Message.HtmlText = "<html><body>Message with an image<p><img src=\"cid:myimage\"></body></html>";
Signing a message with a certificate (note that the certificate should contain its private key):
CertificateManager manager = new CertificateManager();
manager.ImportFromFile("path\\cert.pfx", "password");
writer.SecuritySettings.Sign = true;
writer.SecuritySettings.HashAlgorithm = "SHA256";
writer.SigningCertificate = manager.Certificate;
writer.SaveToFile("path\\message.eml");
Encrypting a message with one or more certificates (no private key is required):
CertificateManager manager = new CertificateManager();
manager.ImportFromFile("path\\cert.cer", "");
writer.SecuritySettings.Encrypt = true;
writer.SecuritySettings.EncryptionAlgorithm = "AES256";
writer.EncryptionCertificates.Add(manager.Certificate);
// add more certificates if needed
writer.SaveToFile("D:\\test.eml");
Property List
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
AttachEncoding | The encoding to be applied to the attachments. |
Attachments | Contains a list of attachments to the message. |
Bcc | The BCC header of the Message. |
Cc | The CC header of the Message. |
Charset | The charset to apply to Message . |
EncryptionCertificates | The recipients' encryption certificates. |
ExternalCrypto | Provides access to external signing and DC parameters. |
FIPSMode | Reserved. |
From | The From header of the Message. |
HeaderEncoding | The encoding to be applied to the message header. |
Mailer | The name of the software used to compose and/or send the message. |
Message | The message that is currently being composed. |
OtherHeaders | Provides access to secondary message headers. |
Profile | Specifies a pre-defined profile to apply when creating the signature. |
ReplyTo | The value of the Reply-To header field of the Message. |
SecuritySettings | A container for the message's security settings. |
Sender | The value of the Sender header field of the Message. |
SendTo | The value of the To header field of the Message. |
SigningCertificate | The certificate to be used for signing. |
SigningChain | The signing certificate chain. |
TextEncoding | The encoding to be applied to the message. |
Method List
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
AttachBytes | Creates an attachment from a memory buffer. |
AttachFile | Creates an attachment from a file. |
AttachImage | Creates an image attachment from a memory buffer. |
Config | Sets or retrieves a configuration setting. |
CreateNew | Creates a template for a new message. |
DoAction | Performs an additional action. |
Reset | Resets the class settings. |
SaveToBytes | Serializes the message to a byte array. |
SaveToFile | Serializes the message to a file. |
SaveToStream | Serializes the message to a stream. |
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.
Error | Reports information about errors during e-mail message assembling or saving. |
ExternalSign | Handles remote or external signing initiated by the SignExternal method or other source. |
Notification | This event notifies the application about an underlying control flow event. |
Config Settings
The following is a list of config settings for the class with short descriptions. Click on the links for further details.
BitsInKey | Key length for the block cipher used for encryption. The value should be a multiple of 8. |
IncludeSigningCertificate | If true (by default), the signing certificate is included into the signature. Otherwise, it is included only if SigningChain is not empty. |
TempPath | Path for storing temporary files. |
ASN1UseGlobalTagCache | Controls whether ASN.1 module should use a global object cache. |
AssignSystemSmartCardPins | Specifies whether CSP-level PINs should be assigned to CNG keys. |
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. |
DefDeriveKeyIterations | Specifies the default key derivation algorithm iteration count. |
DNSLocalSuffix | The suffix to assign for TLD names. |
EnableClientSideSSLFFDHE | Enables or disables finite field DHE key exchange support in TLS clients. |
GlobalCookies | Gets or sets global cookies for all the HTTP transports. |
HardwareCryptoUsePolicy | The hardware crypto usage policy. |
HttpUserAgent | Specifies the user agent name to be used by all HTTP clients. |
HttpVersion | The HTTP version to use in any inner HTTP client classes created. |
IgnoreExpiredMSCTLSigningCert | Whether to tolerate the expired Windows Update signing certificate. |
ListDelimiter | The delimiter character for multi-element lists. |
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. |
OldClientSideRSAFallback | Specifies whether the SSH client should use a SHA1 fallback. |
ProductVersion | Returns the version of the SecureBlackbox library. |
ServerSSLDHKeyLength | Sets the size of the TLS DHE key exchange group. |
StaticDNS | Specifies whether static DNS rules should be used. |
StaticIPAddress[domain] | Gets or sets an IP address for the specified domain name. |
StaticIPAddresses | Gets or sets all the static DNS rules. |
Tag | Allows to store any custom data. |
TLSSessionGroup | Specifies the group name of TLS sessions to be used for session resumption. |
TLSSessionLifetime | Specifies lifetime in seconds of the cached TLS session. |
TLSSessionPurgeInterval | Specifies how often the session cache should remove the expired TLS sessions. |
UseInternalRandom | Switches between SecureBlackbox-own and platform PRNGs. |
UseLegacyAdESValidation | Enables legacy AdES validation mode. |
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. |
UseSystemNativeSizeCalculation | An internal CryptoAPI access tweak. |
UseSystemOAEPAndPSS | Enforces or disables the use of system-driven RSA OAEP and PSS computations. |
UseSystemRandom | Enables or disables the use of the OS PRNG. |
AttachEncoding Property (MailWriter Class)
The encoding to be applied to the attachments.
Syntax
ANSI (Cross Platform) int GetAttachEncoding();
int SetAttachEncoding(int iAttachEncoding); Unicode (Windows) INT GetAttachEncoding();
INT SetAttachEncoding(INT iAttachEncoding);
Possible Values
ME_AUTO(0),
ME_8BIT(1),
ME_BASE_64(2),
ME_QUOTED_PRINTABLE(3)
int secureblackbox_mailwriter_getattachencoding(void* lpObj);
int secureblackbox_mailwriter_setattachencoding(void* lpObj, int iAttachEncoding);
int GetAttachEncoding();
int SetAttachEncoding(int iAttachEncoding);
Default Value
0
Remarks
Use this property to specify the encoding method for the attached files.
meAuto | 0 | |
me8bit | 1 | |
meBase64 | 2 | |
meQuotedPrintable | 3 |
Data Type
Integer
Attachments Property (MailWriter Class)
Contains a list of attachments to the message.
Syntax
SecureBlackboxList<SecureBlackboxMailAttachment>* GetAttachments(); int SetAttachments(SecureBlackboxList<SecureBlackboxMailAttachment>* val);
int secureblackbox_mailwriter_getattachcount(void* lpObj);
int secureblackbox_mailwriter_setattachcount(void* lpObj, int iAttachCount);
char* secureblackbox_mailwriter_getattachcontentsubtype(void* lpObj, int attachindex);
int secureblackbox_mailwriter_setattachcontentsubtype(void* lpObj, int attachindex, const char* lpszAttachContentSubtype);
char* secureblackbox_mailwriter_getattachcontenttype(void* lpObj, int attachindex);
int secureblackbox_mailwriter_setattachcontenttype(void* lpObj, int attachindex, const char* lpszAttachContentType);
char* secureblackbox_mailwriter_getattachcreationdate(void* lpObj, int attachindex);
int secureblackbox_mailwriter_setattachcreationdate(void* lpObj, int attachindex, const char* lpszAttachCreationDate);
int secureblackbox_mailwriter_getattachdata(void* lpObj, int attachindex, char** lpAttachData, int* lenAttachData);
int secureblackbox_mailwriter_setattachdata(void* lpObj, int attachindex, const char* lpAttachData, int lenAttachData);
char* secureblackbox_mailwriter_getattachdescription(void* lpObj, int attachindex);
int secureblackbox_mailwriter_setattachdescription(void* lpObj, int attachindex, const char* lpszAttachDescription);
char* secureblackbox_mailwriter_getattachfilename(void* lpObj, int attachindex);
int secureblackbox_mailwriter_setattachfilename(void* lpObj, int attachindex, const char* lpszAttachFileName);
int64 secureblackbox_mailwriter_getattachhandle(void* lpObj, int attachindex);
int secureblackbox_mailwriter_setattachhandle(void* lpObj, int attachindex, int64 lAttachHandle);
char* secureblackbox_mailwriter_getattachid(void* lpObj, int attachindex);
int secureblackbox_mailwriter_setattachid(void* lpObj, int attachindex, const char* lpszAttachID);
char* secureblackbox_mailwriter_getattachmodificationdate(void* lpObj, int attachindex);
int secureblackbox_mailwriter_setattachmodificationdate(void* lpObj, int attachindex, const char* lpszAttachModificationDate);
char* secureblackbox_mailwriter_getattachreaddate(void* lpObj, int attachindex);
int secureblackbox_mailwriter_setattachreaddate(void* lpObj, int attachindex, const char* lpszAttachReadDate);
int64 secureblackbox_mailwriter_getattachsize(void* lpObj, int attachindex);
int secureblackbox_mailwriter_setattachsize(void* lpObj, int attachindex, int64 lAttachSize);
int GetAttachCount();
int SetAttachCount(int iAttachCount); QString GetAttachContentSubtype(int iAttachIndex);
int SetAttachContentSubtype(int iAttachIndex, QString qsAttachContentSubtype); QString GetAttachContentType(int iAttachIndex);
int SetAttachContentType(int iAttachIndex, QString qsAttachContentType); QString GetAttachCreationDate(int iAttachIndex);
int SetAttachCreationDate(int iAttachIndex, QString qsAttachCreationDate); QByteArray GetAttachData(int iAttachIndex);
int SetAttachData(int iAttachIndex, QByteArray qbaAttachData); QString GetAttachDescription(int iAttachIndex);
int SetAttachDescription(int iAttachIndex, QString qsAttachDescription); QString GetAttachFileName(int iAttachIndex);
int SetAttachFileName(int iAttachIndex, QString qsAttachFileName); qint64 GetAttachHandle(int iAttachIndex);
int SetAttachHandle(int iAttachIndex, qint64 lAttachHandle); QString GetAttachID(int iAttachIndex);
int SetAttachID(int iAttachIndex, QString qsAttachID); QString GetAttachModificationDate(int iAttachIndex);
int SetAttachModificationDate(int iAttachIndex, QString qsAttachModificationDate); QString GetAttachReadDate(int iAttachIndex);
int SetAttachReadDate(int iAttachIndex, QString qsAttachReadDate); qint64 GetAttachSize(int iAttachIndex);
int SetAttachSize(int iAttachIndex, qint64 lAttachSize);
Remarks
Use this property to access all attachments added to the Message and tune up their properties.
This property is not available at design time.
Data Type
Bcc Property (MailWriter Class)
The BCC header of the Message.
Syntax
SecureBlackboxList<SecureBlackboxMailAddress>* GetBcc(); int SetBcc(SecureBlackboxList<SecureBlackboxMailAddress>* val);
int secureblackbox_mailwriter_getbccaddrcount(void* lpObj);
int secureblackbox_mailwriter_setbccaddrcount(void* lpObj, int iBccAddrCount);
char* secureblackbox_mailwriter_getbccaddraddress(void* lpObj, int bccaddrindex);
int secureblackbox_mailwriter_setbccaddraddress(void* lpObj, int bccaddrindex, const char* lpszBccAddrAddress);
char* secureblackbox_mailwriter_getbccaddrdisplayname(void* lpObj, int bccaddrindex);
int secureblackbox_mailwriter_setbccaddrdisplayname(void* lpObj, int bccaddrindex, const char* lpszBccAddrDisplayName);
char* secureblackbox_mailwriter_getbccaddrgroupname(void* lpObj, int bccaddrindex);
int secureblackbox_mailwriter_setbccaddrgroupname(void* lpObj, int bccaddrindex, const char* lpszBccAddrGroupName);
int GetBccAddrCount();
int SetBccAddrCount(int iBccAddrCount); QString GetBccAddrAddress(int iBccAddrIndex);
int SetBccAddrAddress(int iBccAddrIndex, QString qsBccAddrAddress); QString GetBccAddrDisplayName(int iBccAddrIndex);
int SetBccAddrDisplayName(int iBccAddrIndex, QString qsBccAddrDisplayName); QString GetBccAddrGroupName(int iBccAddrIndex);
int SetBccAddrGroupName(int iBccAddrIndex, QString qsBccAddrGroupName);
Remarks
The BCC header field contains the addresses of secondary recipients of the message whose addresses are not to be revealed to other recipients of the message. Mail servers remove the BCC header when processing the message and use its value for dispatching the message only.
This property is not available at design time.
Data Type
Cc Property (MailWriter Class)
The CC header of the Message.
Syntax
SecureBlackboxList<SecureBlackboxMailAddress>* GetCc(); int SetCc(SecureBlackboxList<SecureBlackboxMailAddress>* val);
int secureblackbox_mailwriter_getccaddrcount(void* lpObj);
int secureblackbox_mailwriter_setccaddrcount(void* lpObj, int iCcAddrCount);
char* secureblackbox_mailwriter_getccaddraddress(void* lpObj, int ccaddrindex);
int secureblackbox_mailwriter_setccaddraddress(void* lpObj, int ccaddrindex, const char* lpszCcAddrAddress);
char* secureblackbox_mailwriter_getccaddrdisplayname(void* lpObj, int ccaddrindex);
int secureblackbox_mailwriter_setccaddrdisplayname(void* lpObj, int ccaddrindex, const char* lpszCcAddrDisplayName);
char* secureblackbox_mailwriter_getccaddrgroupname(void* lpObj, int ccaddrindex);
int secureblackbox_mailwriter_setccaddrgroupname(void* lpObj, int ccaddrindex, const char* lpszCcAddrGroupName);
int GetCcAddrCount();
int SetCcAddrCount(int iCcAddrCount); QString GetCcAddrAddress(int iCcAddrIndex);
int SetCcAddrAddress(int iCcAddrIndex, QString qsCcAddrAddress); QString GetCcAddrDisplayName(int iCcAddrIndex);
int SetCcAddrDisplayName(int iCcAddrIndex, QString qsCcAddrDisplayName); QString GetCcAddrGroupName(int iCcAddrIndex);
int SetCcAddrGroupName(int iCcAddrIndex, QString qsCcAddrGroupName);
Remarks
The CC field contains the addresses of secondary recipients of the message.
This property is not available at design time.
Data Type
Charset Property (MailWriter Class)
The charset to apply to Message .
Syntax
ANSI (Cross Platform) char* GetCharset();
int SetCharset(const char* lpszCharset); Unicode (Windows) LPWSTR GetCharset();
INT SetCharset(LPCWSTR lpszCharset);
char* secureblackbox_mailwriter_getcharset(void* lpObj);
int secureblackbox_mailwriter_setcharset(void* lpObj, const char* lpszCharset);
QString GetCharset();
int SetCharset(QString qsCharset);
Default Value
"utf-8"
Remarks
Use this property to specify the character set to use in the message.
Data Type
String
EncryptionCertificates Property (MailWriter Class)
The recipients' encryption certificates.
Syntax
SecureBlackboxList<SecureBlackboxCertificate>* GetEncryptionCertificates(); int SetEncryptionCertificates(SecureBlackboxList<SecureBlackboxCertificate>* val);
int secureblackbox_mailwriter_getencryptioncertcount(void* lpObj);
int secureblackbox_mailwriter_setencryptioncertcount(void* lpObj, int iEncryptionCertCount);
int secureblackbox_mailwriter_getencryptioncertbytes(void* lpObj, int encryptioncertindex, char** lpEncryptionCertBytes, int* lenEncryptionCertBytes);
int64 secureblackbox_mailwriter_getencryptioncerthandle(void* lpObj, int encryptioncertindex);
int secureblackbox_mailwriter_setencryptioncerthandle(void* lpObj, int encryptioncertindex, int64 lEncryptionCertHandle);
int GetEncryptionCertCount();
int SetEncryptionCertCount(int iEncryptionCertCount); QByteArray GetEncryptionCertBytes(int iEncryptionCertIndex); qint64 GetEncryptionCertHandle(int iEncryptionCertIndex);
int SetEncryptionCertHandle(int iEncryptionCertIndex, qint64 lEncryptionCertHandle);
Remarks
Use this property to provide certificates to be used for message encryption.
This property is not available at design time.
Data Type
ExternalCrypto Property (MailWriter Class)
Provides access to external signing and DC parameters.
Syntax
SecureBlackboxExternalCrypto* GetExternalCrypto();
char* secureblackbox_mailwriter_getexternalcryptoasyncdocumentid(void* lpObj);
int secureblackbox_mailwriter_setexternalcryptoasyncdocumentid(void* lpObj, const char* lpszExternalCryptoAsyncDocumentID);
char* secureblackbox_mailwriter_getexternalcryptocustomparams(void* lpObj);
int secureblackbox_mailwriter_setexternalcryptocustomparams(void* lpObj, const char* lpszExternalCryptoCustomParams);
char* secureblackbox_mailwriter_getexternalcryptodata(void* lpObj);
int secureblackbox_mailwriter_setexternalcryptodata(void* lpObj, const char* lpszExternalCryptoData);
int secureblackbox_mailwriter_getexternalcryptoexternalhashcalculation(void* lpObj);
int secureblackbox_mailwriter_setexternalcryptoexternalhashcalculation(void* lpObj, int bExternalCryptoExternalHashCalculation);
char* secureblackbox_mailwriter_getexternalcryptohashalgorithm(void* lpObj);
int secureblackbox_mailwriter_setexternalcryptohashalgorithm(void* lpObj, const char* lpszExternalCryptoHashAlgorithm);
char* secureblackbox_mailwriter_getexternalcryptokeyid(void* lpObj);
int secureblackbox_mailwriter_setexternalcryptokeyid(void* lpObj, const char* lpszExternalCryptoKeyID);
char* secureblackbox_mailwriter_getexternalcryptokeysecret(void* lpObj);
int secureblackbox_mailwriter_setexternalcryptokeysecret(void* lpObj, const char* lpszExternalCryptoKeySecret);
int secureblackbox_mailwriter_getexternalcryptomethod(void* lpObj);
int secureblackbox_mailwriter_setexternalcryptomethod(void* lpObj, int iExternalCryptoMethod);
int secureblackbox_mailwriter_getexternalcryptomode(void* lpObj);
int secureblackbox_mailwriter_setexternalcryptomode(void* lpObj, int iExternalCryptoMode);
char* secureblackbox_mailwriter_getexternalcryptopublickeyalgorithm(void* lpObj);
int secureblackbox_mailwriter_setexternalcryptopublickeyalgorithm(void* lpObj, const char* lpszExternalCryptoPublicKeyAlgorithm);
QString GetExternalCryptoAsyncDocumentID();
int SetExternalCryptoAsyncDocumentID(QString qsExternalCryptoAsyncDocumentID); QString GetExternalCryptoCustomParams();
int SetExternalCryptoCustomParams(QString qsExternalCryptoCustomParams); QString GetExternalCryptoData();
int SetExternalCryptoData(QString qsExternalCryptoData); bool GetExternalCryptoExternalHashCalculation();
int SetExternalCryptoExternalHashCalculation(bool bExternalCryptoExternalHashCalculation); QString GetExternalCryptoHashAlgorithm();
int SetExternalCryptoHashAlgorithm(QString qsExternalCryptoHashAlgorithm); QString GetExternalCryptoKeyID();
int SetExternalCryptoKeyID(QString qsExternalCryptoKeyID); QString GetExternalCryptoKeySecret();
int SetExternalCryptoKeySecret(QString qsExternalCryptoKeySecret); int GetExternalCryptoMethod();
int SetExternalCryptoMethod(int iExternalCryptoMethod); int GetExternalCryptoMode();
int SetExternalCryptoMode(int iExternalCryptoMode); QString GetExternalCryptoPublicKeyAlgorithm();
int SetExternalCryptoPublicKeyAlgorithm(QString qsExternalCryptoPublicKeyAlgorithm);
Remarks
Use this property to tune-up remote cryptography settings. SecureBlackbox supports two independent types of external cryptography: synchronous (based on the ExternalSign event) and asynchronous (based on the DC protocol and the DCAuth signing component).
This property is read-only.
Data Type
FIPSMode Property (MailWriter Class)
Reserved.
Syntax
ANSI (Cross Platform) int GetFIPSMode();
int SetFIPSMode(int bFIPSMode); Unicode (Windows) BOOL GetFIPSMode();
INT SetFIPSMode(BOOL bFIPSMode);
int secureblackbox_mailwriter_getfipsmode(void* lpObj);
int secureblackbox_mailwriter_setfipsmode(void* lpObj, int bFIPSMode);
bool GetFIPSMode();
int SetFIPSMode(bool bFIPSMode);
Default Value
FALSE
Remarks
This property is reserved for future use.
Data Type
Boolean
From Property (MailWriter Class)
The From header of the Message.
Syntax
SecureBlackboxList<SecureBlackboxMailAddress>* GetFrom(); int SetFrom(SecureBlackboxList<SecureBlackboxMailAddress>* val);
int secureblackbox_mailwriter_getfromaddrcount(void* lpObj);
int secureblackbox_mailwriter_setfromaddrcount(void* lpObj, int iFromAddrCount);
char* secureblackbox_mailwriter_getfromaddraddress(void* lpObj, int fromaddrindex);
int secureblackbox_mailwriter_setfromaddraddress(void* lpObj, int fromaddrindex, const char* lpszFromAddrAddress);
char* secureblackbox_mailwriter_getfromaddrdisplayname(void* lpObj, int fromaddrindex);
int secureblackbox_mailwriter_setfromaddrdisplayname(void* lpObj, int fromaddrindex, const char* lpszFromAddrDisplayName);
char* secureblackbox_mailwriter_getfromaddrgroupname(void* lpObj, int fromaddrindex);
int secureblackbox_mailwriter_setfromaddrgroupname(void* lpObj, int fromaddrindex, const char* lpszFromAddrGroupName);
int GetFromAddrCount();
int SetFromAddrCount(int iFromAddrCount); QString GetFromAddrAddress(int iFromAddrIndex);
int SetFromAddrAddress(int iFromAddrIndex, QString qsFromAddrAddress); QString GetFromAddrDisplayName(int iFromAddrIndex);
int SetFromAddrDisplayName(int iFromAddrIndex, QString qsFromAddrDisplayName); QString GetFromAddrGroupName(int iFromAddrIndex);
int SetFromAddrGroupName(int iFromAddrIndex, QString qsFromAddrGroupName);
Remarks
This field contains address(es) of the message author(s). If the actual sender is not an author of the message, use Sender additionally to specify the sender.
Data Type
HeaderEncoding Property (MailWriter Class)
The encoding to be applied to the message header.
Syntax
ANSI (Cross Platform) int GetHeaderEncoding();
int SetHeaderEncoding(int iHeaderEncoding); Unicode (Windows) INT GetHeaderEncoding();
INT SetHeaderEncoding(INT iHeaderEncoding);
Possible Values
ME_AUTO(0),
ME_8BIT(1),
ME_BASE_64(2),
ME_QUOTED_PRINTABLE(3)
int secureblackbox_mailwriter_getheaderencoding(void* lpObj);
int secureblackbox_mailwriter_setheaderencoding(void* lpObj, int iHeaderEncoding);
int GetHeaderEncoding();
int SetHeaderEncoding(int iHeaderEncoding);
Default Value
0
Remarks
Use this property to specify the encoding to use with the message header.
meAuto | 0 | |
me8bit | 1 | |
meBase64 | 2 | |
meQuotedPrintable | 3 |
Data Type
Integer
Mailer Property (MailWriter Class)
The name of the software used to compose and/or send the message.
Syntax
ANSI (Cross Platform) char* GetMailer();
int SetMailer(const char* lpszMailer); Unicode (Windows) LPWSTR GetMailer();
INT SetMailer(LPCWSTR lpszMailer);
char* secureblackbox_mailwriter_getmailer(void* lpObj);
int secureblackbox_mailwriter_setmailer(void* lpObj, const char* lpszMailer);
QString GetMailer();
int SetMailer(QString qsMailer);
Default Value
""
Remarks
Use this property to specify the software that was used to compose and send this message.
Data Type
String
Message Property (MailWriter Class)
The message that is currently being composed.
Syntax
SecureBlackboxMailMessage* GetMessage(); int SetMessage(SecureBlackboxMailMessage* val);
int secureblackbox_mailwriter_getmsgattachmentcount(void* lpObj);
char* secureblackbox_mailwriter_getmsgbcc(void* lpObj);
int secureblackbox_mailwriter_setmsgbcc(void* lpObj, const char* lpszMsgBcc);
char* secureblackbox_mailwriter_getmsgcc(void* lpObj);
int secureblackbox_mailwriter_setmsgcc(void* lpObj, const char* lpszMsgCc);
char* secureblackbox_mailwriter_getmsgcomments(void* lpObj);
int secureblackbox_mailwriter_setmsgcomments(void* lpObj, const char* lpszMsgComments);
char* secureblackbox_mailwriter_getmsgdate(void* lpObj);
int secureblackbox_mailwriter_setmsgdate(void* lpObj, const char* lpszMsgDate);
int secureblackbox_mailwriter_getmsgdeliveryreceipt(void* lpObj);
int secureblackbox_mailwriter_setmsgdeliveryreceipt(void* lpObj, int bMsgDeliveryReceipt);
char* secureblackbox_mailwriter_getmsgfrom(void* lpObj);
int secureblackbox_mailwriter_setmsgfrom(void* lpObj, const char* lpszMsgFrom);
int64 secureblackbox_mailwriter_getmsghandle(void* lpObj);
int secureblackbox_mailwriter_setmsghandle(void* lpObj, int64 lMsgHandle);
char* secureblackbox_mailwriter_getmsghtmltext(void* lpObj);
int secureblackbox_mailwriter_setmsghtmltext(void* lpObj, const char* lpszMsgHtmlText);
char* secureblackbox_mailwriter_getmsgid(void* lpObj);
int secureblackbox_mailwriter_setmsgid(void* lpObj, const char* lpszMsgID);
char* secureblackbox_mailwriter_getmsginreplyto(void* lpObj);
int secureblackbox_mailwriter_setmsginreplyto(void* lpObj, const char* lpszMsgInReplyTo);
char* secureblackbox_mailwriter_getmsgkeywords(void* lpObj);
int secureblackbox_mailwriter_setmsgkeywords(void* lpObj, const char* lpszMsgKeywords);
char* secureblackbox_mailwriter_getmsgmailer(void* lpObj);
char* secureblackbox_mailwriter_getmsgplaintext(void* lpObj);
int secureblackbox_mailwriter_setmsgplaintext(void* lpObj, const char* lpszMsgPlainText);
int secureblackbox_mailwriter_getmsgpriority(void* lpObj);
int secureblackbox_mailwriter_setmsgpriority(void* lpObj, int iMsgPriority);
int secureblackbox_mailwriter_getmsgreadreceipt(void* lpObj);
int secureblackbox_mailwriter_setmsgreadreceipt(void* lpObj, int bMsgReadReceipt);
char* secureblackbox_mailwriter_getmsgreferences(void* lpObj);
int secureblackbox_mailwriter_setmsgreferences(void* lpObj, const char* lpszMsgReferences);
char* secureblackbox_mailwriter_getmsgreplyto(void* lpObj);
int secureblackbox_mailwriter_setmsgreplyto(void* lpObj, const char* lpszMsgReplyTo);
char* secureblackbox_mailwriter_getmsgreturnpath(void* lpObj);
int secureblackbox_mailwriter_setmsgreturnpath(void* lpObj, const char* lpszMsgReturnPath);
char* secureblackbox_mailwriter_getmsgsender(void* lpObj);
int secureblackbox_mailwriter_setmsgsender(void* lpObj, const char* lpszMsgSender);
char* secureblackbox_mailwriter_getmsgsendto(void* lpObj);
int secureblackbox_mailwriter_setmsgsendto(void* lpObj, const char* lpszMsgSendTo);
char* secureblackbox_mailwriter_getmsgsubject(void* lpObj);
int secureblackbox_mailwriter_setmsgsubject(void* lpObj, const char* lpszMsgSubject);
int GetMsgAttachmentCount(); QString GetMsgBcc();
int SetMsgBcc(QString qsMsgBcc); QString GetMsgCc();
int SetMsgCc(QString qsMsgCc); QString GetMsgComments();
int SetMsgComments(QString qsMsgComments); QString GetMsgDate();
int SetMsgDate(QString qsMsgDate); bool GetMsgDeliveryReceipt();
int SetMsgDeliveryReceipt(bool bMsgDeliveryReceipt); QString GetMsgFrom();
int SetMsgFrom(QString qsMsgFrom); qint64 GetMsgHandle();
int SetMsgHandle(qint64 lMsgHandle); QString GetMsgHtmlText();
int SetMsgHtmlText(QString qsMsgHtmlText); QString GetMsgID();
int SetMsgID(QString qsMsgID); QString GetMsgInReplyTo();
int SetMsgInReplyTo(QString qsMsgInReplyTo); QString GetMsgKeywords();
int SetMsgKeywords(QString qsMsgKeywords); QString GetMsgMailer(); QString GetMsgPlainText();
int SetMsgPlainText(QString qsMsgPlainText); int GetMsgPriority();
int SetMsgPriority(int iMsgPriority); bool GetMsgReadReceipt();
int SetMsgReadReceipt(bool bMsgReadReceipt); QString GetMsgReferences();
int SetMsgReferences(QString qsMsgReferences); QString GetMsgReplyTo();
int SetMsgReplyTo(QString qsMsgReplyTo); QString GetMsgReturnPath();
int SetMsgReturnPath(QString qsMsgReturnPath); QString GetMsgSender();
int SetMsgSender(QString qsMsgSender); QString GetMsgSendTo();
int SetMsgSendTo(QString qsMsgSendTo); QString GetMsgSubject();
int SetMsgSubject(QString qsMsgSubject);
Remarks
This property accumulates the properties of the message that is being composed.
This property is not available at design time.
Data Type
OtherHeaders Property (MailWriter Class)
Provides access to secondary message headers.
Syntax
SecureBlackboxList<SecureBlackboxStringNameValuePair>* GetOtherHeaders(); int SetOtherHeaders(SecureBlackboxList<SecureBlackboxStringNameValuePair>* val);
int secureblackbox_mailwriter_getheaderfieldcount(void* lpObj);
int secureblackbox_mailwriter_setheaderfieldcount(void* lpObj, int iHeaderFieldCount);
char* secureblackbox_mailwriter_getheaderfieldcategory(void* lpObj, int headerfieldindex);
int secureblackbox_mailwriter_setheaderfieldcategory(void* lpObj, int headerfieldindex, const char* lpszHeaderFieldCategory);
int secureblackbox_mailwriter_getheaderfieldformat(void* lpObj, int headerfieldindex);
int secureblackbox_mailwriter_setheaderfieldformat(void* lpObj, int headerfieldindex, int iHeaderFieldFormat);
char* secureblackbox_mailwriter_getheaderfieldname(void* lpObj, int headerfieldindex);
int secureblackbox_mailwriter_setheaderfieldname(void* lpObj, int headerfieldindex, const char* lpszHeaderFieldName);
char* secureblackbox_mailwriter_getheaderfieldvalue(void* lpObj, int headerfieldindex);
int secureblackbox_mailwriter_setheaderfieldvalue(void* lpObj, int headerfieldindex, const char* lpszHeaderFieldValue);
int GetHeaderFieldCount();
int SetHeaderFieldCount(int iHeaderFieldCount); QString GetHeaderFieldCategory(int iHeaderFieldIndex);
int SetHeaderFieldCategory(int iHeaderFieldIndex, QString qsHeaderFieldCategory); int GetHeaderFieldFormat(int iHeaderFieldIndex);
int SetHeaderFieldFormat(int iHeaderFieldIndex, int iHeaderFieldFormat); QString GetHeaderFieldName(int iHeaderFieldIndex);
int SetHeaderFieldName(int iHeaderFieldIndex, QString qsHeaderFieldName); QString GetHeaderFieldValue(int iHeaderFieldIndex);
int SetHeaderFieldValue(int iHeaderFieldIndex, QString qsHeaderFieldValue);
Remarks
Use this property to access the headers of the message that are not available via first-level properties of the class
This property is not available at design time.
Data Type
SecureBlackboxStringNameValuePair
Profile Property (MailWriter Class)
Specifies a pre-defined profile to apply when creating the signature.
Syntax
ANSI (Cross Platform) char* GetProfile();
int SetProfile(const char* lpszProfile); Unicode (Windows) LPWSTR GetProfile();
INT SetProfile(LPCWSTR lpszProfile);
char* secureblackbox_mailwriter_getprofile(void* lpObj);
int secureblackbox_mailwriter_setprofile(void* lpObj, const char* lpszProfile);
QString GetProfile();
int SetProfile(QString qsProfile);
Default Value
""
Remarks
Advanced signatures come in many variants, which are often defined by parties that needs to process them or by local standards. SecureBlackbox profiles are sets of pre-defined configurations which correspond to particular signature variants. By specifying a profile, you are pre-configuring the component to make it produce the signature that matches the configuration corresponding to that profile.
Data Type
String
ReplyTo Property (MailWriter Class)
The value of the Reply-To header field of the Message.
Syntax
SecureBlackboxList<SecureBlackboxMailAddress>* GetReplyTo(); int SetReplyTo(SecureBlackboxList<SecureBlackboxMailAddress>* val);
int secureblackbox_mailwriter_getreplytoaddrcount(void* lpObj);
int secureblackbox_mailwriter_setreplytoaddrcount(void* lpObj, int iReplyToAddrCount);
char* secureblackbox_mailwriter_getreplytoaddraddress(void* lpObj, int replytoaddrindex);
int secureblackbox_mailwriter_setreplytoaddraddress(void* lpObj, int replytoaddrindex, const char* lpszReplyToAddrAddress);
char* secureblackbox_mailwriter_getreplytoaddrdisplayname(void* lpObj, int replytoaddrindex);
int secureblackbox_mailwriter_setreplytoaddrdisplayname(void* lpObj, int replytoaddrindex, const char* lpszReplyToAddrDisplayName);
char* secureblackbox_mailwriter_getreplytoaddrgroupname(void* lpObj, int replytoaddrindex);
int secureblackbox_mailwriter_setreplytoaddrgroupname(void* lpObj, int replytoaddrindex, const char* lpszReplyToAddrGroupName);
int GetReplyToAddrCount();
int SetReplyToAddrCount(int iReplyToAddrCount); QString GetReplyToAddrAddress(int iReplyToAddrIndex);
int SetReplyToAddrAddress(int iReplyToAddrIndex, QString qsReplyToAddrAddress); QString GetReplyToAddrDisplayName(int iReplyToAddrIndex);
int SetReplyToAddrDisplayName(int iReplyToAddrIndex, QString qsReplyToAddrDisplayName); QString GetReplyToAddrGroupName(int iReplyToAddrIndex);
int SetReplyToAddrGroupName(int iReplyToAddrIndex, QString qsReplyToAddrGroupName);
Remarks
This field contains the addresses to which the replies to this message should be sent. This field is optional. If not specified, the replies must be sent to the addresses specified in the From field.
Data Type
SecuritySettings Property (MailWriter Class)
A container for the message's security settings.
Syntax
SecureBlackboxMailSecuritySettings* GetSecuritySettings();
char* secureblackbox_mailwriter_getsecsettingsclaimedsigningtime(void* lpObj);
int secureblackbox_mailwriter_setsecsettingsclaimedsigningtime(void* lpObj, const char* lpszSecSettingsClaimedSigningTime);
int secureblackbox_mailwriter_getsecsettingsencrypt(void* lpObj);
int secureblackbox_mailwriter_setsecsettingsencrypt(void* lpObj, int bSecSettingsEncrypt);
char* secureblackbox_mailwriter_getsecsettingsencryptionalgorithm(void* lpObj);
int secureblackbox_mailwriter_setsecsettingsencryptionalgorithm(void* lpObj, const char* lpszSecSettingsEncryptionAlgorithm);
char* secureblackbox_mailwriter_getsecsettingshashalgorithm(void* lpObj);
int secureblackbox_mailwriter_setsecsettingshashalgorithm(void* lpObj, const char* lpszSecSettingsHashAlgorithm);
int secureblackbox_mailwriter_getsecsettingssign(void* lpObj);
int secureblackbox_mailwriter_setsecsettingssign(void* lpObj, int bSecSettingsSign);
int secureblackbox_mailwriter_getsecsettingssignatureformat(void* lpObj);
int secureblackbox_mailwriter_setsecsettingssignatureformat(void* lpObj, int iSecSettingsSignatureFormat);
int secureblackbox_mailwriter_getsecsettingssignbeforeencrypt(void* lpObj);
int secureblackbox_mailwriter_setsecsettingssignbeforeencrypt(void* lpObj, int bSecSettingsSignBeforeEncrypt);
int secureblackbox_mailwriter_getsecsettingssignmessageheader(void* lpObj);
int secureblackbox_mailwriter_setsecsettingssignmessageheader(void* lpObj, int bSecSettingsSignMessageHeader);
QString GetSecSettingsClaimedSigningTime();
int SetSecSettingsClaimedSigningTime(QString qsSecSettingsClaimedSigningTime); bool GetSecSettingsEncrypt();
int SetSecSettingsEncrypt(bool bSecSettingsEncrypt); QString GetSecSettingsEncryptionAlgorithm();
int SetSecSettingsEncryptionAlgorithm(QString qsSecSettingsEncryptionAlgorithm); QString GetSecSettingsHashAlgorithm();
int SetSecSettingsHashAlgorithm(QString qsSecSettingsHashAlgorithm); bool GetSecSettingsSign();
int SetSecSettingsSign(bool bSecSettingsSign); int GetSecSettingsSignatureFormat();
int SetSecSettingsSignatureFormat(int iSecSettingsSignatureFormat); bool GetSecSettingsSignBeforeEncrypt();
int SetSecSettingsSignBeforeEncrypt(bool bSecSettingsSignBeforeEncrypt); bool GetSecSettingsSignMessageHeader();
int SetSecSettingsSignMessageHeader(bool bSecSettingsSignMessageHeader);
Remarks
Use this property to tune up the message's security parameters.
This property is read-only.
Data Type
SecureBlackboxMailSecuritySettings
Sender Property (MailWriter Class)
The value of the Sender header field of the Message.
Syntax
SecureBlackboxMailAddress* GetSender(); int SetSender(SecureBlackboxMailAddress* val);
char* secureblackbox_mailwriter_getsenderaddraddress(void* lpObj);
int secureblackbox_mailwriter_setsenderaddraddress(void* lpObj, const char* lpszSenderAddrAddress);
char* secureblackbox_mailwriter_getsenderaddrdisplayname(void* lpObj);
int secureblackbox_mailwriter_setsenderaddrdisplayname(void* lpObj, const char* lpszSenderAddrDisplayName);
char* secureblackbox_mailwriter_getsenderaddrgroupname(void* lpObj);
int secureblackbox_mailwriter_setsenderaddrgroupname(void* lpObj, const char* lpszSenderAddrGroupName);
QString GetSenderAddrAddress();
int SetSenderAddrAddress(QString qsSenderAddrAddress); QString GetSenderAddrDisplayName();
int SetSenderAddrDisplayName(QString qsSenderAddrDisplayName); QString GetSenderAddrGroupName();
int SetSenderAddrGroupName(QString qsSenderAddrGroupName);
Remarks
This field specifies the mailbox of the agent responsible for the actual transmission of the message.
If the originator of the message can be indicated by a single mailbox, and the author and the transmitter is the same identity, the "Sender:" field should not be used.
This property is not available at design time.
Data Type
SendTo Property (MailWriter Class)
The value of the To header field of the Message.
Syntax
SecureBlackboxList<SecureBlackboxMailAddress>* GetSendTo(); int SetSendTo(SecureBlackboxList<SecureBlackboxMailAddress>* val);
int secureblackbox_mailwriter_getsendtoaddrcount(void* lpObj);
int secureblackbox_mailwriter_setsendtoaddrcount(void* lpObj, int iSendToAddrCount);
char* secureblackbox_mailwriter_getsendtoaddraddress(void* lpObj, int sendtoaddrindex);
int secureblackbox_mailwriter_setsendtoaddraddress(void* lpObj, int sendtoaddrindex, const char* lpszSendToAddrAddress);
char* secureblackbox_mailwriter_getsendtoaddrdisplayname(void* lpObj, int sendtoaddrindex);
int secureblackbox_mailwriter_setsendtoaddrdisplayname(void* lpObj, int sendtoaddrindex, const char* lpszSendToAddrDisplayName);
char* secureblackbox_mailwriter_getsendtoaddrgroupname(void* lpObj, int sendtoaddrindex);
int secureblackbox_mailwriter_setsendtoaddrgroupname(void* lpObj, int sendtoaddrindex, const char* lpszSendToAddrGroupName);
int GetSendToAddrCount();
int SetSendToAddrCount(int iSendToAddrCount); QString GetSendToAddrAddress(int iSendToAddrIndex);
int SetSendToAddrAddress(int iSendToAddrIndex, QString qsSendToAddrAddress); QString GetSendToAddrDisplayName(int iSendToAddrIndex);
int SetSendToAddrDisplayName(int iSendToAddrIndex, QString qsSendToAddrDisplayName); QString GetSendToAddrGroupName(int iSendToAddrIndex);
int SetSendToAddrGroupName(int iSendToAddrIndex, QString qsSendToAddrGroupName);
Remarks
This field specifies the address(es) of the primary recipient(s) of the message.
Data Type
SigningCertificate Property (MailWriter Class)
The certificate to be used for signing.
Syntax
SecureBlackboxCertificate* GetSigningCertificate(); int SetSigningCertificate(SecureBlackboxCertificate* val);
int secureblackbox_mailwriter_getsigningcertbytes(void* lpObj, char** lpSigningCertBytes, int* lenSigningCertBytes);
int64 secureblackbox_mailwriter_getsigningcerthandle(void* lpObj);
int secureblackbox_mailwriter_setsigningcerthandle(void* lpObj, int64 lSigningCertHandle);
QByteArray GetSigningCertBytes(); qint64 GetSigningCertHandle();
int SetSigningCertHandle(qint64 lSigningCertHandle);
Remarks
Use this property to specify the certificate that shall be used for signing the data. Note that this certificate should have a private key associated with it. Use SigningChain to supply the rest of the certificate chain for inclusion into the signature.
This property is not available at design time.
Data Type
SigningChain Property (MailWriter Class)
The signing certificate chain.
Syntax
SecureBlackboxList<SecureBlackboxCertificate>* GetSigningChain(); int SetSigningChain(SecureBlackboxList<SecureBlackboxCertificate>* val);
int secureblackbox_mailwriter_getsigningchaincount(void* lpObj);
int secureblackbox_mailwriter_setsigningchaincount(void* lpObj, int iSigningChainCount);
int secureblackbox_mailwriter_getsigningchainbytes(void* lpObj, int signingchainindex, char** lpSigningChainBytes, int* lenSigningChainBytes);
int64 secureblackbox_mailwriter_getsigningchainhandle(void* lpObj, int signingchainindex);
int secureblackbox_mailwriter_setsigningchainhandle(void* lpObj, int signingchainindex, int64 lSigningChainHandle);
int GetSigningChainCount();
int SetSigningChainCount(int iSigningChainCount); QByteArray GetSigningChainBytes(int iSigningChainIndex); qint64 GetSigningChainHandle(int iSigningChainIndex);
int SetSigningChainHandle(int iSigningChainIndex, qint64 lSigningChainHandle);
Remarks
Use this property to provide the chain for the signing certificate. Use the SigningCertificate property, if it is available, to provide the signing certificate itself.
This property is not available at design time.
Data Type
TextEncoding Property (MailWriter Class)
The encoding to be applied to the message.
Syntax
ANSI (Cross Platform) int GetTextEncoding();
int SetTextEncoding(int iTextEncoding); Unicode (Windows) INT GetTextEncoding();
INT SetTextEncoding(INT iTextEncoding);
Possible Values
ME_AUTO(0),
ME_8BIT(1),
ME_BASE_64(2),
ME_QUOTED_PRINTABLE(3)
int secureblackbox_mailwriter_gettextencoding(void* lpObj);
int secureblackbox_mailwriter_settextencoding(void* lpObj, int iTextEncoding);
int GetTextEncoding();
int SetTextEncoding(int iTextEncoding);
Default Value
0
Remarks
Use this property to specify the encoding to use for the content of the message.
meAuto | 0 | |
me8bit | 1 | |
meBase64 | 2 | |
meQuotedPrintable | 3 |
Data Type
Integer
AttachBytes Method (MailWriter Class)
Creates an attachment from a memory buffer.
Syntax
ANSI (Cross Platform) int AttachBytes(const char* lpData, int lenData); Unicode (Windows) INT AttachBytes(LPCSTR lpData, INT lenData);
int secureblackbox_mailwriter_attachbytes(void* lpObj, const char* lpData, int lenData);
int AttachBytes(QByteArray qbaData);
Remarks
Use this method to create an attachment from a memory buffer. Use Attachments property to provide further attachment details.
The method returns the index of the new attachment in the Attachments list.
Error Handling (C++)
This method returns an Integer value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.
AttachFile Method (MailWriter Class)
Creates an attachment from a file.
Syntax
ANSI (Cross Platform) int AttachFile(const char* lpszFileName); Unicode (Windows) INT AttachFile(LPCWSTR lpszFileName);
int secureblackbox_mailwriter_attachfile(void* lpObj, const char* lpszFileName);
int AttachFile(const QString& qsFileName);
Remarks
Use this method to create an attachment from a file. Use Attachments property to provide further attachment details.
The method returns the index of the new attachment in the Attachments list.
Error Handling (C++)
This method returns an Integer value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.
AttachImage Method (MailWriter Class)
Creates an image attachment from a memory buffer.
Syntax
ANSI (Cross Platform) int AttachImage(const char* lpszID, const char* lpData, int lenData); Unicode (Windows) INT AttachImage(LPCWSTR lpszID, LPCSTR lpData, INT lenData);
int secureblackbox_mailwriter_attachimage(void* lpObj, const char* lpszID, const char* lpData, int lenData);
int AttachImage(const QString& qsID, QByteArray qbaData);
Remarks
Use this method to create a picture attachment from a memory buffer. Use Attachments property to provide further attachment details.
The method returns the index of the new attachment in the Attachments list.
Error Handling (C++)
This method returns an Integer value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.
Config Method (MailWriter Class)
Sets or retrieves a configuration setting.
Syntax
ANSI (Cross Platform) char* Config(const char* lpszConfigurationString); Unicode (Windows) LPWSTR Config(LPCWSTR lpszConfigurationString);
char* secureblackbox_mailwriter_config(void* lpObj, const char* lpszConfigurationString);
QString Config(const QString& qsConfigurationString);
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.
Error Handling (C++)
This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.
CreateNew Method (MailWriter Class)
Creates a template for a new message.
Syntax
ANSI (Cross Platform) int CreateNew(); Unicode (Windows) INT CreateNew();
int secureblackbox_mailwriter_createnew(void* lpObj);
int CreateNew();
Remarks
This method cleans up the current message and makes the component ready for new operation.
Use this method to create a fresh email message for further editing and saving.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
DoAction Method (MailWriter Class)
Performs an additional action.
Syntax
ANSI (Cross Platform) char* DoAction(const char* lpszActionID, const char* lpszActionParams); Unicode (Windows) LPWSTR DoAction(LPCWSTR lpszActionID, LPCWSTR lpszActionParams);
char* secureblackbox_mailwriter_doaction(void* lpObj, const char* lpszActionID, const char* lpszActionParams);
QString DoAction(const QString& qsActionID, const QString& qsActionParams);
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 (case insensitive) of the action is provided in the ActionID parameter.
ActionParams contains the value of a single parameter, or a list of multiple parameters for the action in the form of PARAM1=VALUE1;PARAM2=VALUE2;....
Error Handling (C++)
This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.
Reset Method (MailWriter Class)
Resets the class settings.
Syntax
ANSI (Cross Platform) int Reset(); Unicode (Windows) INT Reset();
int secureblackbox_mailwriter_reset(void* lpObj);
int Reset();
Remarks
Reset is a generic method available in every class.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
SaveToBytes Method (MailWriter Class)
Serializes the message to a byte array.
Syntax
ANSI (Cross Platform) char* SaveToBytes(int *lpSize = NULL); Unicode (Windows) LPSTR SaveToBytes(LPINT lpSize = NULL);
char* secureblackbox_mailwriter_savetobytes(void* lpObjint *lpSize);
QByteArray SaveToBytes();
Remarks
Use this method to assemble the message and save it to a byte array.
Error Handling (C++)
This method returns a Byte Array value (with length lpSize); after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.
SaveToFile Method (MailWriter Class)
Serializes the message to a file.
Syntax
ANSI (Cross Platform) int SaveToFile(const char* lpszFileName); Unicode (Windows) INT SaveToFile(LPCWSTR lpszFileName);
int secureblackbox_mailwriter_savetofile(void* lpObj, const char* lpszFileName);
int SaveToFile(const QString& qsFileName);
Remarks
Use this method to assemble the message and save it to a file.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
SaveToStream Method (MailWriter Class)
Serializes the message to a stream.
Syntax
ANSI (Cross Platform) int SaveToStream(SecureBlackboxStream* sStream); Unicode (Windows) INT SaveToStream(SecureBlackboxStream* sStream);
int secureblackbox_mailwriter_savetostream(void* lpObj, SecureBlackboxStream* sStream);
int SaveToStream(SecureBlackboxStream* sStream);
Remarks
Use this method to assemble the message and save it to a stream.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
Error Event (MailWriter Class)
Reports information about errors during e-mail message assembling or saving.
Syntax
ANSI (Cross Platform) virtual int FireError(MailWriterErrorEventParams *e);
typedef struct {
int ErrorCode;
const char *Description; int reserved; } MailWriterErrorEventParams;
Unicode (Windows) virtual INT FireError(MailWriterErrorEventParams *e);
typedef struct {
INT ErrorCode;
LPCWSTR Description; INT reserved; } MailWriterErrorEventParams;
#define EID_MAILWRITER_ERROR 1 virtual INT SECUREBLACKBOX_CALL FireError(INT &iErrorCode, LPSTR &lpszDescription);
class MailWriterErrorEventParams { public: int ErrorCode(); const QString &Description(); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void Error(MailWriterErrorEventParams *e);
// Or, subclass MailWriter and override this emitter function. virtual int FireError(MailWriterErrorEventParams *e) {...}
Remarks
The event is fired in case of exceptional conditions during message processing.
ErrorCode contains an error code and Description contains a textual description of the error.
ExternalSign Event (MailWriter Class)
Handles remote or external signing initiated by the SignExternal method or other source.
Syntax
ANSI (Cross Platform) virtual int FireExternalSign(MailWriterExternalSignEventParams *e);
typedef struct {
const char *OperationId;
const char *HashAlgorithm;
const char *Pars;
const char *Data;
char *SignedData; int reserved; } MailWriterExternalSignEventParams;
Unicode (Windows) virtual INT FireExternalSign(MailWriterExternalSignEventParams *e);
typedef struct {
LPCWSTR OperationId;
LPCWSTR HashAlgorithm;
LPCWSTR Pars;
LPCWSTR Data;
LPWSTR SignedData; INT reserved; } MailWriterExternalSignEventParams;
#define EID_MAILWRITER_EXTERNALSIGN 2 virtual INT SECUREBLACKBOX_CALL FireExternalSign(LPSTR &lpszOperationId, LPSTR &lpszHashAlgorithm, LPSTR &lpszPars, LPSTR &lpszData, LPSTR &lpszSignedData);
class MailWriterExternalSignEventParams { public: const QString &OperationId(); const QString &HashAlgorithm(); const QString &Pars(); const QString &Data(); const QString &SignedData(); void SetSignedData(const QString &qsSignedData); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void ExternalSign(MailWriterExternalSignEventParams *e);
// Or, subclass MailWriter and override this emitter function. virtual int FireExternalSign(MailWriterExternalSignEventParams *e) {...}
Remarks
Assign a handler to this event if you need to delegate a low-level signing operation to an external, remote, or custom signing engine. Depending on the settings, the handler will receive a hashed or unhashed value to be signed.
The event handler must pass the value of Data to the signer, obtain the signature, and pass it back to the class via the SignedData parameter.
OperationId provides a comment about the operation and its origin. It depends on the exact class being used, and may be empty. HashAlgorithm specifies the hash algorithm being used for the operation, and Pars contains algorithm-dependent parameters.
The class uses base16 (hex) encoding for the Data, SignedData, and Pars parameters. If your signing engine uses a different input and output encoding, you may need to decode and/or encode the data before and/or after the signing.
A sample MD5 hash encoded in base16: a0dee2a0382afbb09120ffa7ccd8a152 - lower case base16 A0DEE2A0382AFBB09120FFA7CCD8A152 - upper case base16
A sample event handler that uses the .NET RSACryptoServiceProvider class may look like the following:
signer.OnExternalSign += (s, e) =>
{
var cert = new X509Certificate2("cert.pfx", "", X509KeyStorageFlags.Exportable);
var key = (RSACryptoServiceProvider)cert.PrivateKey;
var dataToSign = e.Data.FromBase16String();
var signedData = key.SignHash(dataToSign, "2.16.840.1.101.3.4.2.1");
e.SignedData = signedData.ToBase16String();
};
Notification Event (MailWriter Class)
This event notifies the application about an underlying control flow event.
Syntax
ANSI (Cross Platform) virtual int FireNotification(MailWriterNotificationEventParams *e);
typedef struct {
const char *EventID;
const char *EventParam; int reserved; } MailWriterNotificationEventParams;
Unicode (Windows) virtual INT FireNotification(MailWriterNotificationEventParams *e);
typedef struct {
LPCWSTR EventID;
LPCWSTR EventParam; INT reserved; } MailWriterNotificationEventParams;
#define EID_MAILWRITER_NOTIFICATION 3 virtual INT SECUREBLACKBOX_CALL FireNotification(LPSTR &lpszEventID, LPSTR &lpszEventParam);
class MailWriterNotificationEventParams { public: const QString &EventID(); const QString &EventParam(); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void Notification(MailWriterNotificationEventParams *e);
// Or, subclass MailWriter and override this emitter function. virtual int FireNotification(MailWriterNotificationEventParams *e) {...}
Remarks
The class fires this event to let the application know about some event, occurrence, or milestone in the class. 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 the EventID parameter. EventParam contains any parameters accompanying the occurrence. Depending on the type of the class, the exact action it is performing, or the document being processed, one or both may be omitted.
Certificate Type
Encapsulates an individual X.509 certificate.
Syntax
SecureBlackboxCertificate (declared in secureblackbox.h)
Remarks
This type keeps and provides access to X.509 certificate details.
Fields
Bytes
char* (read-only)
Default Value:
Returns the raw certificate data in DER format.
CA
int
Default Value: FALSE
Indicates whether the certificate has a CA capability. For the certificate to be considered a CA, it must have its Basic Constraints extension set with the CA indicator enabled.
Set this field when generating a new certificate to have its Basic Constraints extension generated automatically.
CAKeyID
char* (read-only)
Default Value:
A unique identifier (fingerprint) of the CA certificate's cryptographic key.
Authority Key Identifier is a certificate extension which allows identification of certificates belonging to the same issuer, but with different public keys. It is a de-facto standard to include this extension in all certificates to facilitate chain building.
This setting cannot be set when generating a certificate as it always derives from another certificate property. CertificateManager generates this setting automatically if enough information is available to it: for self-signed certificates, this value is copied from the SubjectKeyID setting, and for lower-level certificates, from the parent certificate's subject key ID extension.
CertType
int (read-only)
Default Value: 0
Returns the type of the entity contained in the Certificate object.
A Certificate object can contain two types of cryptographic objects: a ready-to-use X.509 certificate, or a certificate request ("an unsigned certificate"). Certificate requests can be upgraded to full certificates by signing them with a CA certificate.
Use the CertificateManager class to load or create new certificate and certificate requests objects.
CRLDistributionPoints
char*
Default Value: ""
Contains a list of locations of CRL distribution points used to check this certificate's validity. The list is taken from the respective certificate extension.
Use this field when generating a certificate to provide a list of CRL endpoints that should be made part of the new certificate.
The endpoints are provided as a list of CRLF-separated URLs. Note that this differs from the behaviour used in earlier product versions, where the "|" character was used as the location separator.
Curve
char*
Default Value: ""
Specifies the elliptic curve associated with the certificate's public key. This setting only applies to certificates containing EC keys.
SB_EC_SECP112R1 | SECP112R1 | |
SB_EC_SECP112R2 | SECP112R2 | |
SB_EC_SECP128R1 | SECP128R1 | |
SB_EC_SECP128R2 | SECP128R2 | |
SB_EC_SECP160K1 | SECP160K1 | |
SB_EC_SECP160R1 | SECP160R1 | |
SB_EC_SECP160R2 | SECP160R2 | |
SB_EC_SECP192K1 | SECP192K1 | |
SB_EC_SECP192R1 | SECP192R1 | |
SB_EC_SECP224K1 | SECP224K1 | |
SB_EC_SECP224R1 | SECP224R1 | |
SB_EC_SECP256K1 | SECP256K1 | |
SB_EC_SECP256R1 | SECP256R1 | |
SB_EC_SECP384R1 | SECP384R1 | |
SB_EC_SECP521R1 | SECP521R1 | |
SB_EC_SECT113R1 | SECT113R1 | |
SB_EC_SECT113R2 | SECT113R2 | |
SB_EC_SECT131R1 | SECT131R1 | |
SB_EC_SECT131R2 | SECT131R2 | |
SB_EC_SECT163K1 | SECT163K1 | |
SB_EC_SECT163R1 | SECT163R1 | |
SB_EC_SECT163R2 | SECT163R2 | |
SB_EC_SECT193R1 | SECT193R1 | |
SB_EC_SECT193R2 | SECT193R2 | |
SB_EC_SECT233K1 | SECT233K1 | |
SB_EC_SECT233R1 | SECT233R1 | |
SB_EC_SECT239K1 | SECT239K1 | |
SB_EC_SECT283K1 | SECT283K1 | |
SB_EC_SECT283R1 | SECT283R1 | |
SB_EC_SECT409K1 | SECT409K1 | |
SB_EC_SECT409R1 | SECT409R1 | |
SB_EC_SECT571K1 | SECT571K1 | |
SB_EC_SECT571R1 | SECT571R1 | |
SB_EC_PRIME192V1 | PRIME192V1 | |
SB_EC_PRIME192V2 | PRIME192V2 | |
SB_EC_PRIME192V3 | PRIME192V3 | |
SB_EC_PRIME239V1 | PRIME239V1 | |
SB_EC_PRIME239V2 | PRIME239V2 | |
SB_EC_PRIME239V3 | PRIME239V3 | |
SB_EC_PRIME256V1 | PRIME256V1 | |
SB_EC_C2PNB163V1 | C2PNB163V1 | |
SB_EC_C2PNB163V2 | C2PNB163V2 | |
SB_EC_C2PNB163V3 | C2PNB163V3 | |
SB_EC_C2PNB176W1 | C2PNB176W1 | |
SB_EC_C2TNB191V1 | C2TNB191V1 | |
SB_EC_C2TNB191V2 | C2TNB191V2 | |
SB_EC_C2TNB191V3 | C2TNB191V3 | |
SB_EC_C2ONB191V4 | C2ONB191V4 | |
SB_EC_C2ONB191V5 | C2ONB191V5 | |
SB_EC_C2PNB208W1 | C2PNB208W1 | |
SB_EC_C2TNB239V1 | C2TNB239V1 | |
SB_EC_C2TNB239V2 | C2TNB239V2 | |
SB_EC_C2TNB239V3 | C2TNB239V3 | |
SB_EC_C2ONB239V4 | C2ONB239V4 | |
SB_EC_C2ONB239V5 | C2ONB239V5 | |
SB_EC_C2PNB272W1 | C2PNB272W1 | |
SB_EC_C2PNB304W1 | C2PNB304W1 | |
SB_EC_C2TNB359V1 | C2TNB359V1 | |
SB_EC_C2PNB368W1 | C2PNB368W1 | |
SB_EC_C2TNB431R1 | C2TNB431R1 | |
SB_EC_NISTP192 | NISTP192 | |
SB_EC_NISTP224 | NISTP224 | |
SB_EC_NISTP256 | NISTP256 | |
SB_EC_NISTP384 | NISTP384 | |
SB_EC_NISTP521 | NISTP521 | |
SB_EC_NISTB163 | NISTB163 | |
SB_EC_NISTB233 | NISTB233 | |
SB_EC_NISTB283 | NISTB283 | |
SB_EC_NISTB409 | NISTB409 | |
SB_EC_NISTB571 | NISTB571 | |
SB_EC_NISTK163 | NISTK163 | |
SB_EC_NISTK233 | NISTK233 | |
SB_EC_NISTK283 | NISTK283 | |
SB_EC_NISTK409 | NISTK409 | |
SB_EC_NISTK571 | NISTK571 | |
SB_EC_GOSTCPTEST | GOSTCPTEST | |
SB_EC_GOSTCPA | GOSTCPA | |
SB_EC_GOSTCPB | GOSTCPB | |
SB_EC_GOSTCPC | GOSTCPC | |
SB_EC_GOSTCPXCHA | GOSTCPXCHA | |
SB_EC_GOSTCPXCHB | GOSTCPXCHB | |
SB_EC_BRAINPOOLP160R1 | BRAINPOOLP160R1 | |
SB_EC_BRAINPOOLP160T1 | BRAINPOOLP160T1 | |
SB_EC_BRAINPOOLP192R1 | BRAINPOOLP192R1 | |
SB_EC_BRAINPOOLP192T1 | BRAINPOOLP192T1 | |
SB_EC_BRAINPOOLP224R1 | BRAINPOOLP224R1 | |
SB_EC_BRAINPOOLP224T1 | BRAINPOOLP224T1 | |
SB_EC_BRAINPOOLP256R1 | BRAINPOOLP256R1 | |
SB_EC_BRAINPOOLP256T1 | BRAINPOOLP256T1 | |
SB_EC_BRAINPOOLP320R1 | BRAINPOOLP320R1 | |
SB_EC_BRAINPOOLP320T1 | BRAINPOOLP320T1 | |
SB_EC_BRAINPOOLP384R1 | BRAINPOOLP384R1 | |
SB_EC_BRAINPOOLP384T1 | BRAINPOOLP384T1 | |
SB_EC_BRAINPOOLP512R1 | BRAINPOOLP512R1 | |
SB_EC_BRAINPOOLP512T1 | BRAINPOOLP512T1 | |
SB_EC_CURVE25519 | CURVE25519 | |
SB_EC_CURVE448 | CURVE448 |
Fingerprint
char* (read-only)
Default Value: ""
Contains the fingerprint (a hash imprint) of this certificate.
While there is no formal standard defining what a fingerprint is, a SHA1 hash of the certificate's DER-encoded body is typically used.
FriendlyName
char* (read-only)
Default Value: ""
Contains an associated alias (friendly name) of the certificate. The friendly name is not a property of a certificate: it is maintained by the certificate media rather than being included in its DER representation. Windows certificate stores are one example of media that does support friendly names.
Handle
int64
Default Value: 0
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
char*
Default Value: ""
Provides means to set the hash algorithm to be used in the subsequent operation on the certificate (such as generation or key signing). It is not a property of a certificate; use SigAlgorithm to find out the hash algorithm that is part of the certificate signature.
SB_HASH_ALGORITHM_SHA1 | SHA1 | |
SB_HASH_ALGORITHM_SHA224 | SHA224 | |
SB_HASH_ALGORITHM_SHA256 | SHA256 | |
SB_HASH_ALGORITHM_SHA384 | SHA384 | |
SB_HASH_ALGORITHM_SHA512 | SHA512 | |
SB_HASH_ALGORITHM_MD2 | MD2 | |
SB_HASH_ALGORITHM_MD4 | MD4 | |
SB_HASH_ALGORITHM_MD5 | MD5 | |
SB_HASH_ALGORITHM_RIPEMD160 | RIPEMD160 | |
SB_HASH_ALGORITHM_CRC32 | CRC32 | |
SB_HASH_ALGORITHM_SSL3 | SSL3 | |
SB_HASH_ALGORITHM_GOST_R3411_1994 | GOST1994 | |
SB_HASH_ALGORITHM_WHIRLPOOL | WHIRLPOOL | |
SB_HASH_ALGORITHM_POLY1305 | POLY1305 | |
SB_HASH_ALGORITHM_SHA3_224 | SHA3_224 | |
SB_HASH_ALGORITHM_SHA3_256 | SHA3_256 | |
SB_HASH_ALGORITHM_SHA3_384 | SHA3_384 | |
SB_HASH_ALGORITHM_SHA3_512 | SHA3_512 | |
SB_HASH_ALGORITHM_BLAKE2S_128 | BLAKE2S_128 | |
SB_HASH_ALGORITHM_BLAKE2S_160 | BLAKE2S_160 | |
SB_HASH_ALGORITHM_BLAKE2S_224 | BLAKE2S_224 | |
SB_HASH_ALGORITHM_BLAKE2S_256 | BLAKE2S_256 | |
SB_HASH_ALGORITHM_BLAKE2B_160 | BLAKE2B_160 | |
SB_HASH_ALGORITHM_BLAKE2B_256 | BLAKE2B_256 | |
SB_HASH_ALGORITHM_BLAKE2B_384 | BLAKE2B_384 | |
SB_HASH_ALGORITHM_BLAKE2B_512 | BLAKE2B_512 | |
SB_HASH_ALGORITHM_SHAKE_128 | SHAKE_128 | |
SB_HASH_ALGORITHM_SHAKE_256 | SHAKE_256 | |
SB_HASH_ALGORITHM_SHAKE_128_LEN | SHAKE_128_LEN | |
SB_HASH_ALGORITHM_SHAKE_256_LEN | SHAKE_256_LEN |
Issuer
char* (read-only)
Default Value: ""
The common name of the certificate issuer (CA), typically a company name. This is part of a larger set of credentials available via IssuerRDN.
IssuerRDN
char*
Default Value: ""
A list of Property=Value pairs that uniquely identify the certificate issuer.
Example: /C=US/O=Nationwide CA/CN=Web Certification Authority
KeyAlgorithm
char*
Default Value: "0"
Specifies the public key algorithm of this certificate.
SB_CERT_ALGORITHM_ID_RSA_ENCRYPTION | rsaEncryption | |
SB_CERT_ALGORITHM_MD2_RSA_ENCRYPTION | md2withRSAEncryption | |
SB_CERT_ALGORITHM_MD5_RSA_ENCRYPTION | md5withRSAEncryption | |
SB_CERT_ALGORITHM_SHA1_RSA_ENCRYPTION | sha1withRSAEncryption | |
SB_CERT_ALGORITHM_ID_DSA | id-dsa | |
SB_CERT_ALGORITHM_ID_DSA_SHA1 | id-dsa-with-sha1 | |
SB_CERT_ALGORITHM_DH_PUBLIC | dhpublicnumber | |
SB_CERT_ALGORITHM_SHA224_RSA_ENCRYPTION | sha224WithRSAEncryption | |
SB_CERT_ALGORITHM_SHA256_RSA_ENCRYPTION | sha256WithRSAEncryption | |
SB_CERT_ALGORITHM_SHA384_RSA_ENCRYPTION | sha384WithRSAEncryption | |
SB_CERT_ALGORITHM_SHA512_RSA_ENCRYPTION | sha512WithRSAEncryption | |
SB_CERT_ALGORITHM_ID_RSAPSS | id-RSASSA-PSS | |
SB_CERT_ALGORITHM_ID_RSAOAEP | id-RSAES-OAEP | |
SB_CERT_ALGORITHM_RSASIGNATURE_RIPEMD160 | ripemd160withRSA | |
SB_CERT_ALGORITHM_ID_ELGAMAL | elGamal | |
SB_CERT_ALGORITHM_SHA1_ECDSA | ecdsa-with-SHA1 | |
SB_CERT_ALGORITHM_RECOMMENDED_ECDSA | ecdsa-recommended | |
SB_CERT_ALGORITHM_SHA224_ECDSA | ecdsa-with-SHA224 | |
SB_CERT_ALGORITHM_SHA256_ECDSA | ecdsa-with-SHA256 | |
SB_CERT_ALGORITHM_SHA384_ECDSA | ecdsa-with-SHA384 | |
SB_CERT_ALGORITHM_SHA512_ECDSA | ecdsa-with-SHA512 | |
SB_CERT_ALGORITHM_EC | id-ecPublicKey | |
SB_CERT_ALGORITHM_SPECIFIED_ECDSA | ecdsa-specified | |
SB_CERT_ALGORITHM_GOST_R3410_1994 | id-GostR3410-94 | |
SB_CERT_ALGORITHM_GOST_R3410_2001 | id-GostR3410-2001 | |
SB_CERT_ALGORITHM_GOST_R3411_WITH_R3410_1994 | id-GostR3411-94-with-GostR3410-94 | |
SB_CERT_ALGORITHM_GOST_R3411_WITH_R3410_2001 | id-GostR3411-94-with-GostR3410-2001 | |
SB_CERT_ALGORITHM_SHA1_ECDSA_PLAIN | ecdsa-plain-SHA1 | |
SB_CERT_ALGORITHM_SHA224_ECDSA_PLAIN | ecdsa-plain-SHA224 | |
SB_CERT_ALGORITHM_SHA256_ECDSA_PLAIN | ecdsa-plain-SHA256 | |
SB_CERT_ALGORITHM_SHA384_ECDSA_PLAIN | ecdsa-plain-SHA384 | |
SB_CERT_ALGORITHM_SHA512_ECDSA_PLAIN | ecdsa-plain-SHA512 | |
SB_CERT_ALGORITHM_RIPEMD160_ECDSA_PLAIN | ecdsa-plain-RIPEMD160 | |
SB_CERT_ALGORITHM_WHIRLPOOL_RSA_ENCRYPTION | whirlpoolWithRSAEncryption | |
SB_CERT_ALGORITHM_ID_DSA_SHA224 | id-dsa-with-sha224 | |
SB_CERT_ALGORITHM_ID_DSA_SHA256 | id-dsa-with-sha256 | |
SB_CERT_ALGORITHM_SHA3_224_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-sha3-224 | |
SB_CERT_ALGORITHM_SHA3_256_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-sha3-256 | |
SB_CERT_ALGORITHM_SHA3_384_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-sha3-384 | |
SB_CERT_ALGORITHM_SHA3_512_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-sha3-512 | |
SB_CERT_ALGORITHM_SHA3_224_ECDSA | id-ecdsa-with-sha3-224 | |
SB_CERT_ALGORITHM_SHA3_256_ECDSA | id-ecdsa-with-sha3-256 | |
SB_CERT_ALGORITHM_SHA3_384_ECDSA | id-ecdsa-with-sha3-384 | |
SB_CERT_ALGORITHM_SHA3_512_ECDSA | id-ecdsa-with-sha3-512 | |
SB_CERT_ALGORITHM_SHA3_224_ECDSA_PLAIN | id-ecdsa-plain-with-sha3-224 | |
SB_CERT_ALGORITHM_SHA3_256_ECDSA_PLAIN | id-ecdsa-plain-with-sha3-256 | |
SB_CERT_ALGORITHM_SHA3_384_ECDSA_PLAIN | id-ecdsa-plain-with-sha3-384 | |
SB_CERT_ALGORITHM_SHA3_512_ECDSA_PLAIN | id-ecdsa-plain-with-sha3-512 | |
SB_CERT_ALGORITHM_ID_DSA_SHA3_224 | id-dsa-with-sha3-224 | |
SB_CERT_ALGORITHM_ID_DSA_SHA3_256 | id-dsa-with-sha3-256 | |
SB_CERT_ALGORITHM_BLAKE2S_128_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2s128 | |
SB_CERT_ALGORITHM_BLAKE2S_160_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2s160 | |
SB_CERT_ALGORITHM_BLAKE2S_224_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2s224 | |
SB_CERT_ALGORITHM_BLAKE2S_256_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2s256 | |
SB_CERT_ALGORITHM_BLAKE2B_160_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2b160 | |
SB_CERT_ALGORITHM_BLAKE2B_256_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2b256 | |
SB_CERT_ALGORITHM_BLAKE2B_384_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2b384 | |
SB_CERT_ALGORITHM_BLAKE2B_512_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2b512 | |
SB_CERT_ALGORITHM_BLAKE2S_128_ECDSA | id-ecdsa-with-blake2s128 | |
SB_CERT_ALGORITHM_BLAKE2S_160_ECDSA | id-ecdsa-with-blake2s160 | |
SB_CERT_ALGORITHM_BLAKE2S_224_ECDSA | id-ecdsa-with-blake2s224 | |
SB_CERT_ALGORITHM_BLAKE2S_256_ECDSA | id-ecdsa-with-blake2s256 | |
SB_CERT_ALGORITHM_BLAKE2B_160_ECDSA | id-ecdsa-with-blake2b160 | |
SB_CERT_ALGORITHM_BLAKE2B_256_ECDSA | id-ecdsa-with-blake2b256 | |
SB_CERT_ALGORITHM_BLAKE2B_384_ECDSA | id-ecdsa-with-blake2b384 | |
SB_CERT_ALGORITHM_BLAKE2B_512_ECDSA | id-ecdsa-with-blake2b512 | |
SB_CERT_ALGORITHM_BLAKE2S_128_ECDSA_PLAIN | id-ecdsa-plain-with-blake2s128 | |
SB_CERT_ALGORITHM_BLAKE2S_160_ECDSA_PLAIN | id-ecdsa-plain-with-blake2s160 | |
SB_CERT_ALGORITHM_BLAKE2S_224_ECDSA_PLAIN | id-ecdsa-plain-with-blake2s224 | |
SB_CERT_ALGORITHM_BLAKE2S_256_ECDSA_PLAIN | id-ecdsa-plain-with-blake2s256 | |
SB_CERT_ALGORITHM_BLAKE2B_160_ECDSA_PLAIN | id-ecdsa-plain-with-blake2b160 | |
SB_CERT_ALGORITHM_BLAKE2B_256_ECDSA_PLAIN | id-ecdsa-plain-with-blake2b256 | |
SB_CERT_ALGORITHM_BLAKE2B_384_ECDSA_PLAIN | id-ecdsa-plain-with-blake2b384 | |
SB_CERT_ALGORITHM_BLAKE2B_512_ECDSA_PLAIN | id-ecdsa-plain-with-blake2b512 | |
SB_CERT_ALGORITHM_ID_DSA_BLAKE2S_224 | id-dsa-with-blake2s224 | |
SB_CERT_ALGORITHM_ID_DSA_BLAKE2S_256 | id-dsa-with-blake2s256 | |
SB_CERT_ALGORITHM_EDDSA_ED25519 | id-Ed25519 | |
SB_CERT_ALGORITHM_EDDSA_ED448 | id-Ed448 | |
SB_CERT_ALGORITHM_EDDSA_ED25519_PH | id-Ed25519ph | |
SB_CERT_ALGORITHM_EDDSA_ED448_PH | id-Ed448ph | |
SB_CERT_ALGORITHM_EDDSA | id-EdDSA | |
SB_CERT_ALGORITHM_EDDSA_SIGNATURE | id-EdDSA-sig |
Use the KeyBits, Curve, and PublicKeyBytes fields to get more details about the key the certificate contains.
KeyBits
int (read-only)
Default Value: 0
Returns the length of the public key in bits.
This value indicates the length of the principal cryptographic parameter of the key, such as the length of the RSA modulus or ECDSA field. The key data returned by the PublicKeyBytes or PrivateKeyBytes field would typically contain auxiliary values, and therefore be longer.
KeyFingerprint
char* (read-only)
Default Value: ""
Returns a SHA1 fingerprint of the public key contained in the certificate.
Note that the key fingerprint is different from the certificate fingerprint accessible via the Fingerprint field. The key fingeprint uniquely identifies the public key, and so can be the same for multiple certificates containing the same key.
KeyUsage
int
Default Value: 0
Indicates the purposes of the key contained in the certificate, in the form of an OR'ed flag set.
This value is a bit mask of the following values:
ckuUnknown | 0x00000 | Unknown key usage |
ckuDigitalSignature | 0x00001 | Digital signature |
ckuNonRepudiation | 0x00002 | Non-repudiation |
ckuKeyEncipherment | 0x00004 | Key encipherment |
ckuDataEncipherment | 0x00008 | Data encipherment |
ckuKeyAgreement | 0x00010 | Key agreement |
ckuKeyCertSign | 0x00020 | Certificate signing |
ckuCRLSign | 0x00040 | Revocation signing |
ckuEncipherOnly | 0x00080 | Encipher only |
ckuDecipherOnly | 0x00100 | Decipher only |
ckuServerAuthentication | 0x00200 | Server authentication |
ckuClientAuthentication | 0x00400 | Client authentication |
ckuCodeSigning | 0x00800 | Code signing |
ckuEmailProtection | 0x01000 | Email protection |
ckuTimeStamping | 0x02000 | Timestamping |
ckuOCSPSigning | 0x04000 | OCSP signing |
ckuSmartCardLogon | 0x08000 | Smartcard logon |
ckuKeyPurposeClientAuth | 0x10000 | Kerberos - client authentication |
ckuKeyPurposeKDC | 0x20000 | Kerberos - KDC |
Set this field before generating the certificate to propagate the key usage flags to the new certificate.
KeyValid
int (read-only)
Default Value: FALSE
Returns True if the certificate's key is cryptographically valid, and False otherwise.
OCSPLocations
char*
Default Value: ""
Locations of OCSP services that can be used to check this certificate's validity in real time, as recorded by the CA.
Set this field before calling the certificate manager's Generate method to propagate it to the new certificate.
The OCSP locations are provided as a list of CRLF-separated URLs. Note that this differs from the behaviour used in earlier product versions, where the "|" character was used as the location separator.
OCSPNoCheck
int
Default Value: FALSE
Accessor to the value of the certificate's ocsp-no-check extension.
Origin
int (read-only)
Default Value: 0
Returns the location that the certificate was taken or loaded from.
PolicyIDs
char*
Default Value: ""
Contains identifiers (OIDs) of the applicable certificate policies.
The Certificate Policies extension identifies a sequence of policies under which the certificate has been issued, and which regulate its usage.
Set this field when generating a certificate to propagate the policies information to the new certificate.
The policies are provided as a list of CRLF-separated entries. Note that this differs from the behaviour used in earlier product versions, where the "|" character was used as the policy element separator.
PrivateKeyBytes
char* (read-only)
Default Value:
Returns the certificate's private key in DER-encoded format. It is normal for this field to be empty if the private key is non-exportable, which, for example, is typical for certificates originating from hardware security devices.
PrivateKeyExists
int (read-only)
Default Value: FALSE
Indicates whether the certificate has a usable private key associated with it. If it is set to True, the certificate can be used for private key operations, such as signing or decryption.
This field is independent from PrivateKeyBytes, and can be set to True even if the former is empty. This would imply that the private key is non-exportable, but still can be used for cryptographic operations.
PrivateKeyExtractable
int (read-only)
Default Value: FALSE
Indicates whether the private key is extractable (exportable).
PublicKeyBytes
char* (read-only)
Default Value:
Contains the certificate's public key in DER format.
This typically would contain an ASN.1-encoded public key value. The exact format depends on the type of the public key contained in the certificate.
Qualified
int (read-only)
Default Value: FALSE
Indicates whether the certificate is qualified.
This property is set to True if the certificate is confirmed by a Trusted List to be qualified.
QualifiedStatements
int
Default Value: 0
Returns a simplified qualified status of the certificate.
Qualifiers
char* (read-only)
Default Value: ""
A list of qualifiers.
Contains a comma-separated list of qualifier aliases for the certificate, for example QCP-n-qscd,QCWithSSCD.
SelfSigned
int (read-only)
Default Value: FALSE
Indicates whether the certificate is self-signed (root) or signed by an external CA.
SerialNumber
char*
Default Value:
Returns the certificate's serial number.
The serial number is a binary string that uniquely identifies a certificate among others issued by the same CA. According to the X.509 standard, the (issuer, serial number) pair should be globally unique to facilitate chain building.
SigAlgorithm
char* (read-only)
Default Value: ""
Indicates the algorithm that was used by the CA to sign this certificate.
A signature algorithm typically combines hash and public key algorithms together, such as sha256WithRSAEncryption or ecdsa-with-SHA256.
Source
int (read-only)
Default Value: 0
Returns the source (location or disposition) of a cryptographic primitive entity, such as a certificate, CRL, or OCSP response.
Subject
char* (read-only)
Default Value: ""
The common name of the certificate holder, typically an individual's name, a URL, an e-mail address, or a company name. This is part of a larger set of credentials available via SubjectRDN.
SubjectAlternativeName
char*
Default Value: ""
Returns or sets the value of the Subject Alternative Name extension of the certificate.
Subject alternative names are used to provide additional names that are impractical to store in the main SubjectRDN field. For example, it is often used to store all the domain names that a TLS certificate is authorized to protect.
The alternative names are provided as a list of CRLF-separated entries. Note that this differs from the behaviour used in earlier product versions, where the "|" character was used as the element separator.
SubjectKeyID
char*
Default Value:
Contains a unique identifier of the certificate's cryptographic key.
Subject Key Identifier is a certificate extension which allows a specific public key to be associated with a certificate holder. Typically, subject key identifiers of CA certificates are recorded as respective CA key identifiers in the subordinate certificates that they issue, which facilitates chain building.
The SubjectKeyID and CAKeyID fields of self-signed certificates typically contain identical values, as in that specific case, the issuer and the subject are the same entity.
SubjectRDN
char*
Default Value: ""
A list of Property=Value pairs that uniquely identify the certificate holder (subject).
Depending on the purpose of the certificate and the policies of the CA that issued it, the values included in the subject record may differ drastically and contain business or personal names, web URLs, email addresses, and other data.
Example: /C=US/O=Oranges and Apples, Inc./OU=Accounts Receivable/1.2.3.4.5=Value with unknown OID/CN=Margaret Watkins.
Valid
int (read-only)
Default Value: FALSE
Indicates whether or not the signature over the certificate or the request is valid and matches the public key contained in the CA certificate/request.
ValidFrom
char*
Default Value: ""
The time point at which the certificate becomes valid, in UTC.
ValidTo
char*
Default Value: ""
The time point at which the certificate expires, in UTC.
Constructors
Certificate()
Creates a new object with default field values.
ExternalCrypto Type
Specifies the parameters of external cryptographic calls.
Syntax
SecureBlackboxExternalCrypto (declared in secureblackbox.h)
Remarks
External cryptocalls are used in a Distributed Cryptography (DC) subsystem, which allows the delegation of security operations to the remote agent. For instance, it can be used to compute the signature value on the server, while retaining the client's private key locally.
Fields
AsyncDocumentID
char*
Default Value: ""
Specifies an optional document ID for SignAsyncBegin() and SignAsyncEnd() calls.
Use this property when working with multi-signature DCAuth requests and responses to uniquely identify documents signed within a larger batch. On the completion stage, this value helps the signing component identify the correct signature in the returned batch of responses.
If using batched requests, make sure to set this property to the same value on both the pre-signing (SignAsyncBegin) and completion (SignAsyncEnd) stages.
CustomParams
char*
Default Value: ""
Custom parameters to be passed to the signing service (uninterpreted).
Data
char*
Default Value: ""
Additional data to be included in the async state and mirrored back by the requestor.
ExternalHashCalculation
int
Default Value: FALSE
Specifies whether the message hash is to be calculated at the external endpoint. Please note that this mode is not supported by the DCAuth class.
If set to true, the class will pass a few kilobytes of to-be-signed data from the document to the OnExternalSign event. This only applies when SignExternal() is called.
HashAlgorithm
char*
Default Value: "SHA256"
Specifies the request's signature hash algorithm.
SB_HASH_ALGORITHM_SHA1 | SHA1 | |
SB_HASH_ALGORITHM_SHA224 | SHA224 | |
SB_HASH_ALGORITHM_SHA256 | SHA256 | |
SB_HASH_ALGORITHM_SHA384 | SHA384 | |
SB_HASH_ALGORITHM_SHA512 | SHA512 | |
SB_HASH_ALGORITHM_MD2 | MD2 | |
SB_HASH_ALGORITHM_MD4 | MD4 | |
SB_HASH_ALGORITHM_MD5 | MD5 | |
SB_HASH_ALGORITHM_RIPEMD160 | RIPEMD160 | |
SB_HASH_ALGORITHM_CRC32 | CRC32 | |
SB_HASH_ALGORITHM_SSL3 | SSL3 | |
SB_HASH_ALGORITHM_GOST_R3411_1994 | GOST1994 | |
SB_HASH_ALGORITHM_WHIRLPOOL | WHIRLPOOL | |
SB_HASH_ALGORITHM_POLY1305 | POLY1305 | |
SB_HASH_ALGORITHM_SHA3_224 | SHA3_224 | |
SB_HASH_ALGORITHM_SHA3_256 | SHA3_256 | |
SB_HASH_ALGORITHM_SHA3_384 | SHA3_384 | |
SB_HASH_ALGORITHM_SHA3_512 | SHA3_512 | |
SB_HASH_ALGORITHM_BLAKE2S_128 | BLAKE2S_128 | |
SB_HASH_ALGORITHM_BLAKE2S_160 | BLAKE2S_160 | |
SB_HASH_ALGORITHM_BLAKE2S_224 | BLAKE2S_224 | |
SB_HASH_ALGORITHM_BLAKE2S_256 | BLAKE2S_256 | |
SB_HASH_ALGORITHM_BLAKE2B_160 | BLAKE2B_160 | |
SB_HASH_ALGORITHM_BLAKE2B_256 | BLAKE2B_256 | |
SB_HASH_ALGORITHM_BLAKE2B_384 | BLAKE2B_384 | |
SB_HASH_ALGORITHM_BLAKE2B_512 | BLAKE2B_512 | |
SB_HASH_ALGORITHM_SHAKE_128 | SHAKE_128 | |
SB_HASH_ALGORITHM_SHAKE_256 | SHAKE_256 | |
SB_HASH_ALGORITHM_SHAKE_128_LEN | SHAKE_128_LEN | |
SB_HASH_ALGORITHM_SHAKE_256_LEN | SHAKE_256_LEN |
KeyID
char*
Default Value: ""
The ID of the pre-shared key used for DC request authentication.
Asynchronous DCAuth-driven communication requires that parties authenticate each other with a secret pre-shared cryptographic key. This provides an extra protection layer for the protocol and diminishes the risk of the private key becoming abused by foreign parties. Use this property to provide the pre-shared key identifier, and use KeySecret to pass the key itself.
The same KeyID/KeySecret pair should be used on the DCAuth side for the signing requests to be accepted.
Note: The KeyID/KeySecret scheme is very similar to the AuthKey scheme used in various Cloud service providers to authenticate users.
Example:
signer.ExternalCrypto.KeyID = "MainSigningKey";
signer.ExternalCrypto.KeySecret = "abcdef0123456789";
KeySecret
char*
Default Value: ""
The pre-shared key used for DC request authentication. This key must be set and match the key used by the DCAuth counterpart for the scheme to work.
Read more about configuring authentication in the KeyID topic.
Method
int
Default Value: 0
Specifies the asynchronous signing method. This is typically defined by the DC server capabilities and setup.
Available options:
asmdPKCS1 | 0 |
asmdPKCS7 | 1 |
Mode
int
Default Value: 0
Specifies the external cryptography mode.
Available options:
ecmDefault | The default value (0) |
ecmDisabled | Do not use DC or external signing (1) |
ecmGeneric | Generic external signing with the OnExternalSign event (2) |
ecmDCAuth | DCAuth signing (3) |
ecmDCAuthJSON | DCAuth signing in JSON format (4) |
PublicKeyAlgorithm
char*
Default Value: ""
Provide the public key algorithm here if the certificate is not available on the pre-signing stage.
SB_CERT_ALGORITHM_ID_RSA_ENCRYPTION | rsaEncryption | |
SB_CERT_ALGORITHM_MD2_RSA_ENCRYPTION | md2withRSAEncryption | |
SB_CERT_ALGORITHM_MD5_RSA_ENCRYPTION | md5withRSAEncryption | |
SB_CERT_ALGORITHM_SHA1_RSA_ENCRYPTION | sha1withRSAEncryption | |
SB_CERT_ALGORITHM_ID_DSA | id-dsa | |
SB_CERT_ALGORITHM_ID_DSA_SHA1 | id-dsa-with-sha1 | |
SB_CERT_ALGORITHM_DH_PUBLIC | dhpublicnumber | |
SB_CERT_ALGORITHM_SHA224_RSA_ENCRYPTION | sha224WithRSAEncryption | |
SB_CERT_ALGORITHM_SHA256_RSA_ENCRYPTION | sha256WithRSAEncryption | |
SB_CERT_ALGORITHM_SHA384_RSA_ENCRYPTION | sha384WithRSAEncryption | |
SB_CERT_ALGORITHM_SHA512_RSA_ENCRYPTION | sha512WithRSAEncryption | |
SB_CERT_ALGORITHM_ID_RSAPSS | id-RSASSA-PSS | |
SB_CERT_ALGORITHM_ID_RSAOAEP | id-RSAES-OAEP | |
SB_CERT_ALGORITHM_RSASIGNATURE_RIPEMD160 | ripemd160withRSA | |
SB_CERT_ALGORITHM_ID_ELGAMAL | elGamal | |
SB_CERT_ALGORITHM_SHA1_ECDSA | ecdsa-with-SHA1 | |
SB_CERT_ALGORITHM_RECOMMENDED_ECDSA | ecdsa-recommended | |
SB_CERT_ALGORITHM_SHA224_ECDSA | ecdsa-with-SHA224 | |
SB_CERT_ALGORITHM_SHA256_ECDSA | ecdsa-with-SHA256 | |
SB_CERT_ALGORITHM_SHA384_ECDSA | ecdsa-with-SHA384 | |
SB_CERT_ALGORITHM_SHA512_ECDSA | ecdsa-with-SHA512 | |
SB_CERT_ALGORITHM_EC | id-ecPublicKey | |
SB_CERT_ALGORITHM_SPECIFIED_ECDSA | ecdsa-specified | |
SB_CERT_ALGORITHM_GOST_R3410_1994 | id-GostR3410-94 | |
SB_CERT_ALGORITHM_GOST_R3410_2001 | id-GostR3410-2001 | |
SB_CERT_ALGORITHM_GOST_R3411_WITH_R3410_1994 | id-GostR3411-94-with-GostR3410-94 | |
SB_CERT_ALGORITHM_GOST_R3411_WITH_R3410_2001 | id-GostR3411-94-with-GostR3410-2001 | |
SB_CERT_ALGORITHM_SHA1_ECDSA_PLAIN | ecdsa-plain-SHA1 | |
SB_CERT_ALGORITHM_SHA224_ECDSA_PLAIN | ecdsa-plain-SHA224 | |
SB_CERT_ALGORITHM_SHA256_ECDSA_PLAIN | ecdsa-plain-SHA256 | |
SB_CERT_ALGORITHM_SHA384_ECDSA_PLAIN | ecdsa-plain-SHA384 | |
SB_CERT_ALGORITHM_SHA512_ECDSA_PLAIN | ecdsa-plain-SHA512 | |
SB_CERT_ALGORITHM_RIPEMD160_ECDSA_PLAIN | ecdsa-plain-RIPEMD160 | |
SB_CERT_ALGORITHM_WHIRLPOOL_RSA_ENCRYPTION | whirlpoolWithRSAEncryption | |
SB_CERT_ALGORITHM_ID_DSA_SHA224 | id-dsa-with-sha224 | |
SB_CERT_ALGORITHM_ID_DSA_SHA256 | id-dsa-with-sha256 | |
SB_CERT_ALGORITHM_SHA3_224_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-sha3-224 | |
SB_CERT_ALGORITHM_SHA3_256_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-sha3-256 | |
SB_CERT_ALGORITHM_SHA3_384_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-sha3-384 | |
SB_CERT_ALGORITHM_SHA3_512_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-sha3-512 | |
SB_CERT_ALGORITHM_SHA3_224_ECDSA | id-ecdsa-with-sha3-224 | |
SB_CERT_ALGORITHM_SHA3_256_ECDSA | id-ecdsa-with-sha3-256 | |
SB_CERT_ALGORITHM_SHA3_384_ECDSA | id-ecdsa-with-sha3-384 | |
SB_CERT_ALGORITHM_SHA3_512_ECDSA | id-ecdsa-with-sha3-512 | |
SB_CERT_ALGORITHM_SHA3_224_ECDSA_PLAIN | id-ecdsa-plain-with-sha3-224 | |
SB_CERT_ALGORITHM_SHA3_256_ECDSA_PLAIN | id-ecdsa-plain-with-sha3-256 | |
SB_CERT_ALGORITHM_SHA3_384_ECDSA_PLAIN | id-ecdsa-plain-with-sha3-384 | |
SB_CERT_ALGORITHM_SHA3_512_ECDSA_PLAIN | id-ecdsa-plain-with-sha3-512 | |
SB_CERT_ALGORITHM_ID_DSA_SHA3_224 | id-dsa-with-sha3-224 | |
SB_CERT_ALGORITHM_ID_DSA_SHA3_256 | id-dsa-with-sha3-256 | |
SB_CERT_ALGORITHM_BLAKE2S_128_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2s128 | |
SB_CERT_ALGORITHM_BLAKE2S_160_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2s160 | |
SB_CERT_ALGORITHM_BLAKE2S_224_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2s224 | |
SB_CERT_ALGORITHM_BLAKE2S_256_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2s256 | |
SB_CERT_ALGORITHM_BLAKE2B_160_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2b160 | |
SB_CERT_ALGORITHM_BLAKE2B_256_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2b256 | |
SB_CERT_ALGORITHM_BLAKE2B_384_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2b384 | |
SB_CERT_ALGORITHM_BLAKE2B_512_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2b512 | |
SB_CERT_ALGORITHM_BLAKE2S_128_ECDSA | id-ecdsa-with-blake2s128 | |
SB_CERT_ALGORITHM_BLAKE2S_160_ECDSA | id-ecdsa-with-blake2s160 | |
SB_CERT_ALGORITHM_BLAKE2S_224_ECDSA | id-ecdsa-with-blake2s224 | |
SB_CERT_ALGORITHM_BLAKE2S_256_ECDSA | id-ecdsa-with-blake2s256 | |
SB_CERT_ALGORITHM_BLAKE2B_160_ECDSA | id-ecdsa-with-blake2b160 | |
SB_CERT_ALGORITHM_BLAKE2B_256_ECDSA | id-ecdsa-with-blake2b256 | |
SB_CERT_ALGORITHM_BLAKE2B_384_ECDSA | id-ecdsa-with-blake2b384 | |
SB_CERT_ALGORITHM_BLAKE2B_512_ECDSA | id-ecdsa-with-blake2b512 | |
SB_CERT_ALGORITHM_BLAKE2S_128_ECDSA_PLAIN | id-ecdsa-plain-with-blake2s128 | |
SB_CERT_ALGORITHM_BLAKE2S_160_ECDSA_PLAIN | id-ecdsa-plain-with-blake2s160 | |
SB_CERT_ALGORITHM_BLAKE2S_224_ECDSA_PLAIN | id-ecdsa-plain-with-blake2s224 | |
SB_CERT_ALGORITHM_BLAKE2S_256_ECDSA_PLAIN | id-ecdsa-plain-with-blake2s256 | |
SB_CERT_ALGORITHM_BLAKE2B_160_ECDSA_PLAIN | id-ecdsa-plain-with-blake2b160 | |
SB_CERT_ALGORITHM_BLAKE2B_256_ECDSA_PLAIN | id-ecdsa-plain-with-blake2b256 | |
SB_CERT_ALGORITHM_BLAKE2B_384_ECDSA_PLAIN | id-ecdsa-plain-with-blake2b384 | |
SB_CERT_ALGORITHM_BLAKE2B_512_ECDSA_PLAIN | id-ecdsa-plain-with-blake2b512 | |
SB_CERT_ALGORITHM_ID_DSA_BLAKE2S_224 | id-dsa-with-blake2s224 | |
SB_CERT_ALGORITHM_ID_DSA_BLAKE2S_256 | id-dsa-with-blake2s256 | |
SB_CERT_ALGORITHM_EDDSA_ED25519 | id-Ed25519 | |
SB_CERT_ALGORITHM_EDDSA_ED448 | id-Ed448 | |
SB_CERT_ALGORITHM_EDDSA_ED25519_PH | id-Ed25519ph | |
SB_CERT_ALGORITHM_EDDSA_ED448_PH | id-Ed448ph | |
SB_CERT_ALGORITHM_EDDSA | id-EdDSA | |
SB_CERT_ALGORITHM_EDDSA_SIGNATURE | id-EdDSA-sig |
Constructors
ExternalCrypto()
Creates a new ExternalCrypto object with default field values.
MailAddress Type
A container for an e-mail addressee.
Syntax
SecureBlackboxMailAddress (declared in secureblackbox.h)
Remarks
This object is a container for an e-mail identity record. A typical e-mail address consists of an RFC822 e-mail address (john@doe.com), a friendly name (John Doe), and a group name (Officers).
Fields
Address
char*
Default Value: ""
Contains the e-mail address in the form of john@doe.com.
DisplayName
char*
Default Value: ""
Contains the friendly name of the user of this address, such as John Doe.
GroupName
char*
Default Value: ""
The name of the group this address belongs to.
Constructors
MailAddress(const char* lpszAddress)
Creates a new e-mail address object.
MailAddress(const char* lpszDisplayName, const char* lpszAddress)
Creates a new e-mail address object from an address and a display name.
MailAttachment Type
Represents an attachment to an e-mail message.
Syntax
SecureBlackboxMailAttachment (declared in secureblackbox.h)
Remarks
This object is a container for message attachments.
Fields
ContentSubtype
char*
Default Value: ""
Contains the content subtype of the attachment.
ContentType
char*
Default Value: ""
Contains the content type of the attachment.
CreationDate
char*
Default Value: ""
The creation date.
Data
char*
Default Value:
The content of the attachment.
Description
char*
Default Value: ""
Textual description of the attachment.
This property maps to the Content-Description e-mail header field. Although the field is optional, the ability to associate descriptive information with a given body is often desirable. One example is specifying the title of an image using this property.
FileName
char*
Default Value: ""
Specifies the name of the attachment file.
Handle
int64
Default Value: 0
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());
ID
char*
Default Value: ""
Contains the attachment's unique identifier.
ModificationDate
char*
Default Value: ""
Specifies the date and time of the file's last modification.
ReadDate
char*
Default Value: ""
Specifies the file's last read date.
Size
int64
Default Value: 0
The attachment's size in bytes.
Constructors
MailAttachment(const char* lpszContentType)
Creates an empty mail attachment object.
MailMessage Type
Represents an e-mail message.
Syntax
SecureBlackboxMailMessage (declared in secureblackbox.h)
Remarks
This object is a container for an e-mail message.
A message consists of a header and a body. The header, in turn, consists of several header fields. The names, syntax, and expected contents of the header fields are standardized.
The message body can contain anything you like (a message may not even have a body at all).
Fields
AttachmentCount
int (read-only)
Default Value: 0
Returns the number of attachments in this message.
Bcc
char*
Default Value: ""
The contents of the BCC header field.
The BCC header field contains the addresses of secondary recipients of the message whose addresses are not to be revealed to other recipients of the message. Mail servers remove the BCC header when processing the message and use its value for dispatching the message only.
Cc
char*
Default Value: ""
The value of the CC header field.
The CC field contains the addresses of secondary recipients of the message.
Comments
char*
Default Value: ""
Contains additional information about the message body.
Date
char*
Default Value: ""
The date and time when the message entered the mail delivery system.
This field contains the date and time at which the creator of the message posted the message to the mail delivery system.
The date is returned and accepted in UTC time zone.
DeliveryReceipt
int
Default Value: FALSE
Enables delivery notification.
From
char*
Default Value: ""
Contains the value of the From header field.
This field contains the address(es) of the message author(s). If the actual sender is not the author of the message, use Sender to specify the sender separately.
Handle
int64
Default Value: 0
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());
HtmlText
char*
Default Value: ""
The HTML version of the message.
ID
char*
Default Value: ""
The contents of the Message-ID header field.
This field contains a unique identifier that refers to a particular version of this message.
InReplyTo
char*
Default Value: ""
The value of the In-Reply-To header field.
A reply message should have the "In-Reply-To:" header field which may be used to identify the message (or messages) to which the new message is a reply.
Keywords
char*
Default Value: ""
The value of the Keywords header field.
This field can be used to add some important words and phrases that might be useful for the recipient.
Mailer
char* (read-only)
Default Value: ""
The name of the software that was used to send the message.
PlainText
char*
Default Value: ""
The plain text version of the message.
Priority
int
Default Value: 2
Specifies the message priority.
Available options:
mpLowest | 0 |
mpLow | 1 |
mpNormal | 2 |
mpHigh | 3 |
mpHighest | 4 |
ReadReceipt
int
Default Value: FALSE
Enables a read notification.
References
char*
Default Value: ""
The value of the References header field.
A reply message should include a "References:" header field which may be used to identify the "conversation thread". If the initial message is a reply itself, the References of the reply contain combined content of its "References:", "InReplyTo:" and "MessageID:" fields, subject to their presence in the original message.
ReplyTo
char*
Default Value: ""
The value of the Reply-To header field.
This field contains the addresses to which the replies to this message should be sent. This field is optional. If not specified, the replies must be sent to the addresses specified in the From field.
ReturnPath
char*
Default Value: ""
The value of the Return-Path header field.
This field contains the address to which this message shall be returned in case of unsuccessful delivery.
Sender
char*
Default Value: ""
The value of the Sender header field.
This field specifies the mailbox of the agent responsible for the actual transmission of this message. If the originator of the message can be indicated by a single mailbox and both the author and the transmitter are identical, the "Sender:" field is deemed excessive and should not be used.
SendTo
char*
Default Value: ""
The value of the To header field.
This field specifies the address(es) of the primary recipient(s) of the message.
Subject
char*
Default Value: ""
Contains the subject field of this message.
Constructors
MailMessage()
Creates a new empty mail message object.
MailSecuritySettings Type
Provides access to the new message security settings.
Syntax
SecureBlackboxMailSecuritySettings (declared in secureblackbox.h)
Remarks
Use this object to tune up the security setting for the created message.
Fields
ClaimedSigningTime
char*
Default Value: ""
Specifies the signing time from the signer's computer.
Use this property to specify the signature production time. The claimed time is not covered by the signature, may be forfeited or wrong, and as such is usually taken by verifiers for informational purposes only.
Encrypt
int
Default Value: FALSE
Whether to encrypt the message.
EncryptionAlgorithm
char*
Default Value: "AES128"
Specifies the encryption algorithm to be used.
SB_SYMMETRIC_ALGORITHM_RC4 | RC4 | |
SB_SYMMETRIC_ALGORITHM_DES | DES | |
SB_SYMMETRIC_ALGORITHM_3DES | 3DES | |
SB_SYMMETRIC_ALGORITHM_RC2 | RC2 | |
SB_SYMMETRIC_ALGORITHM_AES128 | AES128 | |
SB_SYMMETRIC_ALGORITHM_AES192 | AES192 | |
SB_SYMMETRIC_ALGORITHM_AES256 | AES256 | |
SB_SYMMETRIC_ALGORITHM_AES128_GCM | AES128-GCM | |
SB_SYMMETRIC_ALGORITHM_AES192_GCM | AES192-GCM | |
SB_SYMMETRIC_ALGORITHM_AES256_GCM | AES256-GCM |
HashAlgorithm
char*
Default Value: "SHA256"
Specifies the hash algorithm to be used.
SB_HASH_ALGORITHM_MD5 | MD5 | |
SB_HASH_ALGORITHM_SHA1 | SHA1 | |
SB_HASH_ALGORITHM_SHA256 | SHA256 | |
SB_HASH_ALGORITHM_SHA384 | SHA384 | |
SB_HASH_ALGORITHM_SHA512 | SHA512 | |
SB_HASH_ALGORITHM_SHA3_256 | SHA3_256 | |
SB_HASH_ALGORITHM_SHA3_384 | SHA3_384 | |
SB_HASH_ALGORITHM_SHA3_512 | SHA3_512 | |
SB_HASH_ALGORITHM_BLAKE2S_128 | BLAKE2S_128 | |
SB_HASH_ALGORITHM_BLAKE2S_160 | BLAKE2S_160 | |
SB_HASH_ALGORITHM_BLAKE2S_224 | BLAKE2S_224 | |
SB_HASH_ALGORITHM_BLAKE2S_256 | BLAKE2S_256 | |
SB_HASH_ALGORITHM_BLAKE2B_160 | BLAKE2B_160 | |
SB_HASH_ALGORITHM_BLAKE2B_256 | BLAKE2B_256 | |
SB_HASH_ALGORITHM_BLAKE2B_384 | BLAKE2B_384 | |
SB_HASH_ALGORITHM_BLAKE2B_512 | BLAKE2B_512 |
Sign
int
Default Value: FALSE
Whether to sign the message.
SignatureFormat
int
Default Value: 0
Specifies the signature format to use for the signed message.
Available options:
msMultipartSigned | 0 | |
msSignedData | 1 |
SignBeforeEncrypt
int
Default Value: TRUE
Specifies the order of encryption and signing operations.
SignMessageHeader
int
Default Value: FALSE
Specifies whether to include the message header in the signature calculation.
Constructors
MailSecuritySettings()
Creates a new MailSecuritySettings object.
StringNameValuePair Type
A simple name-value pair object.
Syntax
SecureBlackboxStringNameValuePair (declared in secureblackbox.h)
Remarks
The class represents a name-value string pair used in a variety of network components.
Fields
Category
char*
Default Value: ""
Specifies the string category of the contained value.
This property allows to check or set the category (or type) associated with the contained value. Depending on the format used to load or save the string, the category parameter may or may not be used.
For example, for ASN.1 property lists the category contains the ASN.1 tag of the contained data (OCTETSTRING, UTF8STRING, INTEGER, ...). For basic (name, value) pairs, such as HTTP headers, the category parameter is not used.
Format
int
Default Value: 0
Specifies the format (encoding) of the value contained in the Value property.
Use this property to check or set the format of the contained value. Remember to provide the actual value in the appropriate
format that matches this setting:
utils.NameValuePairs[0].Name = "key";
utils.NameValuePairs[0].Format = svfBinary;
utils.NameValuePairs[0].Name = "0a1b2c3d4e5f6071";
The following formats are currently supported:
svfText | 0 | The property contains text |
svfBinary | 1 | The property contains binary data. The Value property contains a hex encoding of it. |
Name
char*
Default Value: ""
The name element in a (name, value) pair.
Value
char*
Default Value: ""
The value element in a (name, value) pair.
Constructors
StringNameValuePair(const char* lpszName, const char* lpszValue)
Creates a name-value pair from a name and a value.
StringNameValuePair()
Creates an empty name-value object.
SecureBlackboxList Type
Syntax
SecureBlackboxList<T> (declared in secureblackbox.h)
Remarks
SecureBlackboxList is a generic class that is used to hold a collection of objects of type T, where T is one of the custom types supported by the MailWriter class.
Methods | |
GetCount |
This method returns the current size of the collection.
int GetCount() {}
|
SetCount |
This method sets the size of the collection. This method returns 0 if setting the size was successful; or -1 if the collection is ReadOnly. When adding additional objects to a collection call this method to specify the new size. Increasing the size of the collection preserves existing objects in the collection.
int SetCount(int count) {}
|
Get |
This method gets the item at the specified position. The index parameter specifies the index of the item in the collection. This method returns NULL if an invalid index is specified.
T* Get(int index) {}
|
Set |
This method sets the item at the specified position. The index parameter specifies the index of the item in the collection that is being set. This method returns -1 if an invalid index is specified. Note: Objects created using the new operator must be freed using the delete operator; they will not be automatically freed by the class.
T* Set(int index, T* value) {}
|
SecureBlackboxStream Type
Syntax
SecureBlackboxStream (declared in secureblackbox.h)
Remarks
The MailWriter class includes one or more API members that take a stream object as a parameter. To use such API members, create a concrete class that implements the SecureBlackboxStream interface and pass the MailWriter class an instance of that concrete class.
When implementing the SecureBlackboxStream interface's properties and methods, they must behave as described below. If the concrete class's implementation does not behave as expected, undefined behavior may occur.
Properties | |
CanRead |
Whether the stream supports reading.
bool CanRead() { return true; } |
CanSeek |
Whether the stream supports seeking.
bool CanSeek() { return true; } |
CanWrite |
Whether the stream supports writing.
bool CanWrite() { return true; } |
Length |
Gets the length of the stream, in bytes.
int64 GetLength() = 0; |
Methods | |
Close |
Closes the stream, releasing all resources currently allocated for it.
void Close() {} This method is called automatically when a SecureBlackboxStream object is deleted. |
Flush |
Forces all data held by the stream's buffers to be written out to storage.
int Flush() { return 0; } Must return 0 if flushing is successful; or -1 if an error occurs or the stream is closed. If the stream does not support writing, this method must do nothing and return 0. |
Read |
Reads a sequence of bytes from the stream and advances the current position within the stream by the number of bytes read.
int Read(void* buffer, int count) = 0; Buffer specifies the buffer to populate with data from the stream. Count specifies the number of bytes that should be read from the stream. Must return the total number of bytes read into Buffer; this may be less than Count if that many bytes are not currently available, or 0 if the end of the stream has been reached. Must return -1 if an error occurs, if reading is not supported, or if the stream is closed. |
Seek |
Sets the current position within the stream based on a particular point of origin.
int64 Seek(int64 offset, int seekOrigin) = 0; Offset specifies the offset in the stream to seek to, relative to SeekOrigin. Valid values for SeekOrigin are:
Must return the new position within the stream; or -1 if an error occurs, if seeking is not supported, or if the stream is closed (however, see note below). If -1 is returned, the current position within the stream must remain unchanged. Note: If the stream is not closed, it must always be possible to call this method with an Offset of 0 and a SeekOrigin of 1 to obtain the current position within the stream, even if seeking is not otherwise supported. |
Write |
Writes a sequence of bytes to the stream and advances the current position within the stream by the number of bytes written.
int Write(const void* buffer, int count) = 0; Buffer specifies the buffer with data to write to the stream. Count specifies the number of bytes that should be written to the stream. Must return the total number of bytes written to the stream; this may be less than Count if that many bytes could not be written. Must return -1 if an error occurs, if writing is not supported, or if the stream is closed. |
Config Settings (MailWriter Class)
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.MailWriter Config Settings
Base Config Settings
You can switch this property off to improve performance if your project only uses known, good private keys.
Supported values are:
off | No caching (default) | |
local | Local caching | |
global | Global caching |
This setting only applies to sessions negotiated with TLS version 1.3.
Supported values are:
file | File | |
console | Console | |
systemlog | System Log (supported for Android only) | |
debugger | Debugger (supported for VCL for Windows and .Net) |
Supported values are:
time | Current time | |
level | Level | |
package | Package name | |
module | Module name | |
class | Class name | |
method | Method name | |
threadid | Thread Id | |
contenttype | Content type | |
content | Content | |
all | All details |
Supported filter names are:
exclude-package | Exclude a package specified in the value | |
exclude-module | Exclude a module specified in the value | |
exclude-class | Exclude a class specified in the value | |
exclude-method | Exclude a method specified in the value | |
include-package | Include a package specified in the value | |
include-module | Include a module specified in the value | |
include-class | Include a class specified in the value | |
include-method | Include a method specified in the value |
none | No flush (caching only) | |
immediate | Immediate flush (real-time logging) | |
maxcount | Flush cached entries upon reaching LogMaxEventCount entries in the cache. |
Supported values are:
none | None (by default) | |
fatal | Severe errors that cause premature termination. | |
error | Other runtime errors or unexpected conditions. | |
warning | Use of deprecated APIs, poor use of API, 'almost' errors, other runtime situations that are undesirable or unexpected, but not necessarily "wrong". | |
info | Interesting runtime events (startup/shutdown). | |
debug | Detailed information on flow of through the system. | |
trace | More detailed information. |
The default value of this setting is 100.
none | No rotation | |
deleteolder | Delete older entries from the cache upon reaching LogMaxEventCount | |
keepolder | Keep older entries in the cache upon reaching LogMaxEventCount (newer entries are discarded) |
Supported values are:
none | No static DNS rules (default) | |
local | Local static DNS rules | |
global | Global static DNS rules |
This setting only applies to certificates originating from a Windows system store.
Trappable Errors (MailWriter Class)
Error Handling (C++)
Call the GetLastErrorCode() method to obtain the last called method's result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. Known error codes are listed below. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.
MailWriter Errors
1048577 | Invalid parameter (SB_ERROR_INVALID_PARAMETER) |
1048578 | Invalid configuration (SB_ERROR_INVALID_SETUP) |
1048579 | Invalid state (SB_ERROR_INVALID_STATE) |
1048580 | Invalid value (SB_ERROR_INVALID_VALUE) |
1048581 | Private key not found (SB_ERROR_NO_PRIVATE_KEY) |
1048582 | Cancelled by the user (SB_ERROR_CANCELLED_BY_USER) |
1048583 | The file was not found (SB_ERROR_NO_SUCH_FILE) |
1048584 | Unsupported feature or operation (SB_ERROR_UNSUPPORTED_FEATURE) |
1048585 | General error (SB_ERROR_GENERAL_ERROR) |
22020097 | Failed to assemble the mail message (SB_ERROR_MAIL_ASSEMBLY_FAILED) |
22020098 | Failed to assemble the mail message (SB_ERROR_MAIL_PARSING_FAILED) |
22020099 | No decryption certificate found (SB_ERROR_MAIL_NO_DECRYPTION_CERTIFICATE) |