Mime ActiveX Reference Documentation

Mime

Chilkat MIME allows you to easily create and manipulate MIME and S/MIME messages from within your applications.

Object Creation

(Visual Basic 6.0)
Dim obj As New ChilkatMime

(ASP)
set obj = Server.CreateObject("Chilkat_9_5_0.Mime")

(VBScript)
set obj = CreateObject("Chilkat_9_5_0.Mime")

(Delphi)
obj := TChilkatMime.Create(Self);

(FoxPro)
loObject = CreateObject('Chilkat_9_5_0.Mime')

(PowerBuilder)
lole_object = create oleobject
li_rc = lole_object.ConnectToNewObject("Chilkat_9_5_0.Mime")

(SQL Server)
EXEC @hr = sp_OACreate 'Chilkat_9_5_0.Mime', @obj OUT

(Javascript)
var obj = new ActiveXObject("Chilkat_9_5_0.Mime");

Properties

Boundary As String

The boundary string for a multipart MIME message.

It is the value of the boundary attribute of the Content-Type header field. For example, if the Content-Type header is this:

Content-Type: multipart/mixed; boundary="------------080707010302060306060800"
then the value of the Boundary property is "------------080707010302060306060800".

When building multipart MIME messages, the boundary is automatically generated by methods such as NewMultipartMixed, to be a unique and random string, so explicitly setting the boundary is usually not necessary.

(Classic ASP) Example Code: Create a Multipart-Mixed MIME Message with Auto-Generated Boundary and with Explicitly Set Boundary

(Visual FoxPro) Example Code: Create a Multipart-Mixed MIME Message with Auto-Generated Boundary and with Explicitly Set Boundary

(PowerBuilder) Example Code: Create a Multipart-Mixed MIME Message with Auto-Generated Boundary and with Explicitly Set Boundary

(SQL Server) Example Code: Create a Multipart-Mixed MIME Message with Auto-Generated Boundary and with Explicitly Set Boundary

(Visual Basic 6.0) Example Code: Create a Multipart-Mixed MIME Message with Auto-Generated Boundary and with Explicitly Set Boundary

(VBScript) Example Code: Create a Multipart-Mixed MIME Message with Auto-Generated Boundary and with Explicitly Set Boundary

Charset As String

The value of the "charset" attribute of the Content-Type header field. For example, if the Content-Type header is this:

Content-Type: text/plain; charset="iso-8859-1"
then the value of the Charset property is "iso-8859-1".

(Classic ASP) Example Code: Demonstrates the effect of setting the Charset property.

(Visual FoxPro) Example Code: Demonstrates the effect of setting the Charset property.

(PowerBuilder) Example Code: Demonstrates the effect of setting the Charset property.

(SQL Server) Example Code: Demonstrates the effect of setting the Charset property.

(Visual Basic 6.0) Example Code: Demonstrates the effect of setting the Charset property.

(VBScript) Example Code: Demonstrates the effect of setting the Charset property.

ContentType As String

The MIME content type, such as "text/plain", "text/html", "image/gif", "multipart/alternative", "multipart/mixed", etc.

It is the value of the Content-Type header field, excluding any attributes. For example, if the Content-Type header is this:

Content-Type: multipart/mixed; boundary="------------080707010302060306060800"
then the value of the ContentType property is "multipart/mixed".

(Classic ASP) Build a multipart/related MIME Message

(Visual FoxPro) Build a multipart/related MIME Message

(PowerBuilder) Build a multipart/related MIME Message

(SQL Server) Build a multipart/related MIME Message

(Visual Basic 6.0) Build a multipart/related MIME Message

(VBScript) Build a multipart/related MIME Message

(Classic ASP) The MIME Content-Type Header Field

(Visual FoxPro) The MIME Content-Type Header Field

(PowerBuilder) The MIME Content-Type Header Field

(SQL Server) The MIME Content-Type Header Field

(Visual Basic 6.0) The MIME Content-Type Header Field

(VBScript) The MIME Content-Type Header Field

CurrentDateTime As String (read-only)

Returns the current date/time in RFC 822 format.

(Classic ASP) Mime CurrentDateTime

(Visual FoxPro) Mime CurrentDateTime

(PowerBuilder) Mime CurrentDateTime

(SQL Server) Mime CurrentDateTime

(Visual Basic 6.0) Mime CurrentDateTime

(VBScript) Mime CurrentDateTime

DebugLogFilePath As String

If set to a file path, causes each Chilkat method or property call to automatically append it's LastErrorText to the specified log file. The information is appended such that if a hang or crash occurs, it is possible to see the context in which the problem occurred, as well as a history of all Chilkat calls up to the point of the problem. The VerboseLogging property can be set to provide more detailed information.

This property is typically used for debugging the rare cases where a Chilkat method call hangs or generates an exception that halts program execution (i.e. crashes). A hang or crash should generally never happen. The typical causes of a hang are:

  1. a timeout related property was set to 0 to explicitly indicate that an infinite timeout is desired,
  2. the hang is actually a hang within an event callback (i.e. it is a hang within the application code), or
  3. there is an internal problem (bug) in the Chilkat code that causes the hang.

Disposition As String

The value of the Content-Disposition header field, excluding any attributes. For example, if the Content-Disposition header is this:

Content-Disposition: attachment; filename="starfish.gif"
then the value of the Disposition property is "attachment".

(Classic ASP) MIME Content-Disposition Header Field

(Visual FoxPro) MIME Content-Disposition Header Field

(PowerBuilder) MIME Content-Disposition Header Field

(SQL Server) MIME Content-Disposition Header Field

(Visual Basic 6.0) MIME Content-Disposition Header Field

(VBScript) MIME Content-Disposition Header Field

Encoding As String

The value of the Content-Transfer-Encoding header field. Typical values are "base64", "quoted-printable", "7bit", "8bit", "binary", etc. For example, if the Content-Transfer-Encoding header is this:

Content-Transfer-Encoding: base64
then the value of the Encoding property is "base64".

(Classic ASP) MIME Content-Transfer-Encoding Header Field

(Visual FoxPro) MIME Content-Transfer-Encoding Header Field

(PowerBuilder) MIME Content-Transfer-Encoding Header Field

(SQL Server) MIME Content-Transfer-Encoding Header Field

(Visual Basic 6.0) MIME Content-Transfer-Encoding Header Field

(VBScript) MIME Content-Transfer-Encoding Header Field

Filename As String

The value of the "filename" attribute of the Content-Disposition header field. For example, if the Content-Disposition header is this:

Content-Disposition: attachment; filename="starfish.gif"
then the value of the Filename property is "starfish.gif".

(Classic ASP) MIME Content-Disposition Header Field

(Visual FoxPro) MIME Content-Disposition Header Field

(PowerBuilder) MIME Content-Disposition Header Field

(SQL Server) MIME Content-Disposition Header Field

(Visual Basic 6.0) MIME Content-Disposition Header Field

(VBScript) MIME Content-Disposition Header Field

LastBinaryResult As Variant (read-only)

Introduced in version 9.5.0.52

The binary data returned by the last (binary data returning) method called. Only available if Chilkat.Global.KeepBinaryResult is set to 1. This provides a means for obtaining large varbinary results in the SQL Server environment (where limitations exist in getting large amounts of data returned by method calls, but where temp tables can be used for binary properties).

LastErrorHtml As String (read-only)

Provides information in HTML format about the last method/property called. If a method call returns a value indicating failure, or behaves unexpectedly, examine this property to get more information.

LastErrorText As String (read-only)

Provides information in plain-text format about the last method/property called. If a method call returns a value indicating failure, or behaves unexpectedly, examine this property to get more information.

Concept of LastErrorText

LastErrorText Standard Information

LastErrorXml As String (read-only)

Provides information in XML format about the last method/property called. If a method call returns a value indicating failure, or behaves unexpectedly, examine this property to get more information.

LastMethodSuccess As Long

Introduced in version 9.5.0.52

Indicate whether the last method call succeeded or failed. A value of 1 indicates success, a value of 0 indicates failure. This property is automatically set for method calls. It is not modified by property accesses. The property is automatically set to indicate success for the following types of method calls:

  • Any method that returns a string.
  • Any method returning a Chilkat object, binary bytes, or a date/time.
  • Any method returning a standard boolean status value where success = 1 and failure = 0.
  • Any method returning an integer where failure is defined by a return value less than zero.

Note: Methods that do not fit the above requirements will always set this property equal to 1. For example, a method that returns no value (such as a "void" in C++) will technically always succeed.

LastStringResult As String (read-only)

Introduced in version 9.5.0.52

The string return value of the last (string returning) method called. Only available if Chilkat.Global.KeepStringResult is set to 1. This provides a means for obtaining large string results in the SQL Server environment (where limitations exist in getting long strings returned by method calls, but where temp tables can be used for string properties).

Long Strings Returned by ActiveX Methods in SQL Server

LastStringResultLen As Long (read-only)

Introduced in version 9.5.0.53

The length, in characters, of the string contained in the LastStringResult property.

Micalg As String

The value of the "micalg" attribute of the Content-Type header field. For example, if the Content-Type header is this:

Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg=sha1; 
  boundary="------------ms000908010507020408060303"
then the value of the Micalg property is "sha".

Note: The micalg attribute is only present in PKCS7 signed MIME. Setting the Micalg property has the effect of choosing the hash algorithm used w/ signing. Possible choices are "sha1", "md5", "sha256", "sha384", and "sha512". However, it is preferable to set the signing hash algorithm by setting the SigningHashAlg property instead.

Name As String

The value of the "name" attribute of the Content-Type header field. For example, if the Content-Type header is this:

Content-Type: image/gif; name="starfish.gif"
then the value of the Name property is "starfish.gif".

(Classic ASP) The MIME Content-Type Header Field

(Visual FoxPro) The MIME Content-Type Header Field

(PowerBuilder) The MIME Content-Type Header Field

(SQL Server) The MIME Content-Type Header Field

(Visual Basic 6.0) The MIME Content-Type Header Field

(VBScript) The MIME Content-Type Header Field

NumEncryptCerts As Long (read-only)

The number of certificates found when decrypting S/MIME. This property is set after UnwrapSecurity is called.

NumHeaderFields As Long (read-only)

The number of header fields. Header field names and values can be retrieved by index (starting at 0) by calling GetHeaderFieldName and GetHeaderFieldValue.

NumParts As Long (read-only)

MIME messages are composed of parts in a tree structure. The NumParts property contains the number of direct children. To traverse an entire MIME tree, one would recursively descend the tree structure by iterating from 0 to NumParts-1, calling GetPart to get each direct child MIME object. The traversal would continue by iterating over each child's parts, and so on.

NumSignerCerts As Long (read-only)

The number of certificates found when verifying signature(s). This property is set after UnwrapSecurity is called.

OaepHash As String

Introduced in version 9.5.0.67

Selects the hash algorithm for use within OAEP padding when encrypting MIME using RSAES-OAEP. The valid choices are "sha1", "sha256", "sha384", "sha512",

(Classic ASP) Encrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(Visual FoxPro) Encrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(PowerBuilder) Encrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(SQL Server) Encrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(Visual Basic 6.0) Encrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(VBScript) Encrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

OaepMgfHash As String

Introduced in version 9.5.0.71

Selects the MGF hash algorithm for use within OAEP padding when encrypting MIME using RSAES-OAEP. The valid choices are "sha1", "sha256", "sha384", "sha512", The default is "sha1".

OaepPadding As Long

Introduced in version 9.5.0.67

Selects the RSA encryption scheme when encrypting MIME. The default value is 0, which selects RSAES_PKCS1-V1_5. If set to 1, then RSAES_OAEP is used.

(Classic ASP) Encrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(Visual FoxPro) Encrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(PowerBuilder) Encrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(SQL Server) Encrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(Visual Basic 6.0) Encrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(VBScript) Encrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

Pkcs7CryptAlg As String

When the MIME is encrypted (using PKCS7 public-key encryption), this selects the underlying symmetric encryption algorithm. Possible values are: "aes", "des", "3des", and "rc2". The default value is "aes".

(Classic ASP) Encrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(Visual FoxPro) Encrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(PowerBuilder) Encrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(SQL Server) Encrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(Visual Basic 6.0) Encrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(VBScript) Encrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

Pkcs7KeyLength As Long

When the MIME is encrypted (using PKCS7 public-key encryption), this selects the key length of the underlying symmetric encryption algorithm. The possible values allowed depend on the Pkcs7CryptAlg property. For "aes", the key length may be 128, 192, or 256. For "3des" the key length must be 192. For "des" the key length must be 40. For "rc2" the key length can be 40, 56, 64, or 128.

Protocol As String

The value of the "protocol" attribute of the Content-Type header field. For example, if the Content-Type header is this:

Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg=sha1; 
  boundary="------------ms000908010507020408060303"
then the value of the Protocol property is "application/x-pkcs7-signature".

SigningAlg As String

Introduced in version 9.5.0.67

Selects the signature algorithm to be used when creating signed (PKCS7) MIME. The default value is "PKCS1-v1_5". This can be set to "RSASSA-PSS" (or simply "pss") to use the RSASSA-PSS signature scheme.

Note: This property only applies when signing with an RSA private key. It does not apply for ECC or DSA private keys.

(Classic ASP) Sign MIME using RSASSA-PSS with SHA256

(Visual FoxPro) Sign MIME using RSASSA-PSS with SHA256

(PowerBuilder) Sign MIME using RSASSA-PSS with SHA256

(SQL Server) Sign MIME using RSASSA-PSS with SHA256

(Visual Basic 6.0) Sign MIME using RSASSA-PSS with SHA256

(VBScript) Sign MIME using RSASSA-PSS with SHA256

SigningHashAlg As String

Selects the underlying hash algorithm used when creating signed (PKCS7) MIME. Possible values are "sha1", "sha256", "sha384", "sha512", "md5", and "md2".

UnwrapExtras As Long

Controls whether extra (informative) header fields are added to the MIME message when unwrapping security.

(Classic ASP) Decrypt S/MIME and Verify S/MIME Signatures

(Visual FoxPro) Decrypt S/MIME and Verify S/MIME Signatures

(PowerBuilder) Decrypt S/MIME and Verify S/MIME Signatures

(SQL Server) Decrypt S/MIME and Verify S/MIME Signatures

(Visual Basic 6.0) Decrypt S/MIME and Verify S/MIME Signatures

(VBScript) Decrypt S/MIME and Verify S/MIME Signatures

UseMmDescription As Long

Controls whether the boilerplate text "This is a multi-part message in MIME format." is used as the body content of a multipart MIME part.

(Classic ASP) Example Code: Create a Multipart-Mixed MIME Message (shows the difference when UseMmDescription is on/off).

(Visual FoxPro) Example Code: Create a Multipart-Mixed MIME Message (shows the difference when UseMmDescription is on/off).

(PowerBuilder) Example Code: Create a Multipart-Mixed MIME Message (shows the difference when UseMmDescription is on/off).

(SQL Server) Example Code: Create a Multipart-Mixed MIME Message (shows the difference when UseMmDescription is on/off).

(Visual Basic 6.0) Example Code: Create a Multipart-Mixed MIME Message (shows the difference when UseMmDescription is on/off).

(VBScript) Example Code: Create a Multipart-Mixed MIME Message (shows the difference when UseMmDescription is on/off).

UseXPkcs7 As Long

If 1, then the Content-Type header fields created by Chilkat will use "x-pkcs7" instead of simply "pkcs7" . For example:

Content-Type: multipart/signed;
	boundary="----=_NextPart_af8_0422_dbec3a60.7178e470";
	protocol="application/x-pkcs7-signature"; micalg=sha1

or

Content-Type: application/x-pkcs7-mime; name="smime.p7m"
If 0, then the "pcks7" is used. For example:
Content-Type: multipart/signed;
	boundary="----=_NextPart_af8_0422_dbec3a60.7178e470";
	protocol="application/pkcs7-signature"; micalg=sha1

or

Content-Type: application/pkcs7-mime; name="smime.p7m"
The default value of this property is 1, meaning that "x-" is used by default.

VerboseLogging As Long

If set to 1, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may contain more verbose information. The default value is 0. Verbose logging should only be used for debugging. The potentially large quantity of logged information may adversely affect peformance.

Version As String (read-only)

Version of the component/library, such as "9.5.0.63"

Methods

AddContentLength()

Computes the size of the MIME body and adds a Content-Length header field with the computed value. If the MIME body is non-multipart, the Content-Length is just the size of the content. If the MIME is multipart, then the Content-Length is the sum of all the sub-parts. Calling this method more than once causes the Content-Length header to be re-computed and updated.

(Classic ASP) Add Content-Length Header to a MIME Message

(Visual FoxPro) Add Content-Length Header to a MIME Message

(PowerBuilder) Add Content-Length Header to a MIME Message

(SQL Server) Add Content-Length Header to a MIME Message

(Visual Basic 6.0) Add Content-Length Header to a MIME Message

(VBScript) Add Content-Length Header to a MIME Message

AddDecryptCert(cert As ChilkatCert) As Long

Introduced in version 9.5.0.40

Makes a certificate available for decrypting if needed by methods that decrypt, such as UnwrapSecurity. This method may be called multiple times to make more than one certificate (and it's private key) available. Alternative methods for making certificates available are UseCertVault, AddPfxSourceFile, and AddPfxSourceData.

Returns 1 for success, 0 for failure.

AddDetachedSignature(cert As ChilkatCert) As Long

Signs the message using the certificate provided. If successful, the message is converted to "multipart/signed" and the original message will be contained in the first sub-part.

Returns 1 for success, 0 for failure.

(Classic ASP) Example Code: Create PKCS7 Detached Signature (S/MIME)

(Visual FoxPro) Example Code: Create PKCS7 Detached Signature (S/MIME)

(PowerBuilder) Example Code: Create PKCS7 Detached Signature (S/MIME)

(SQL Server) Example Code: Create PKCS7 Detached Signature (S/MIME)

(Visual Basic 6.0) Example Code: Create PKCS7 Detached Signature (S/MIME)

(VBScript) Example Code: Create PKCS7 Detached Signature (S/MIME)

(Classic ASP) Example: Add S/MIME Signature using PFX

(Visual FoxPro) Example: Add S/MIME Signature using PFX

(PowerBuilder) Example: Add S/MIME Signature using PFX

(SQL Server) Example: Add S/MIME Signature using PFX

(Visual Basic 6.0) Example: Add S/MIME Signature using PFX

(VBScript) Example: Add S/MIME Signature using PFX

(Classic ASP) Sign MIME using RSASSA-PSS with SHA256

(Visual FoxPro) Sign MIME using RSASSA-PSS with SHA256

(PowerBuilder) Sign MIME using RSASSA-PSS with SHA256

(SQL Server) Sign MIME using RSASSA-PSS with SHA256

(Visual Basic 6.0) Sign MIME using RSASSA-PSS with SHA256

(VBScript) Sign MIME using RSASSA-PSS with SHA256

AddDetachedSignature2(cert As ChilkatCert, ByVal transferHeaderFields As Long) As Long

Same as AddDetachedSignature, except an extra argument is provided to control whether header fields from the calling MIME object are transferred to the content part of the multipart/signed object. This method transforms the calling object into a multipart/signed MIME with two sub-parts. The first contains the original content of the calling object, and the second contains the digital signature.

Returns 1 for success, 0 for failure.

AddDetachedSignaturePk(cert As ChilkatCert, privateKey As PrivateKey) As Long

Adds a detached signature using a certificate and it's associated private key. This method would be used when the private key is external to the certificate -- for example, if a PFX/P12 file is not used, but instead a pair of .cer and .pem files are used (one for the certificate and one for the associated private key).

Returns 1 for success, 0 for failure.

(Classic ASP) Example Code for AddDetachedSignaturePk

(Visual FoxPro) Example Code for AddDetachedSignaturePk

(PowerBuilder) Example Code for AddDetachedSignaturePk

(SQL Server) Example Code for AddDetachedSignaturePk

(Visual Basic 6.0) Example Code for AddDetachedSignaturePk

(VBScript) Example Code for AddDetachedSignaturePk

AddDetachedSignaturePk2(cert As ChilkatCert, privateKey As PrivateKey, ByVal transferHeaderFields As Long) As Long

Same as AddDetachedSignaturePk, except an extra argument is provided to control whether header fields from the calling MIME object are transferred to the content part of the multipart/signed object. This method transforms the calling object into a multipart/signed MIME with two sub-parts. The first contains the original content of the calling object, and the second contains the digital signature.

Returns 1 for success, 0 for failure.

AddEncryptCert(cert As ChilkatCert) As Long

Adds a certificate to the object's internal list of certificates to be used when the EncryptN method is called. (See the EncryptN method for more information.) The internal list may be cleared by calling ClearEncryptCerts.

Returns 1 for success, 0 for failure.

AddHeaderField(name As String, value As String) As Long

Adds a header field to the MIME.

Returns 1 for success, 0 for failure.

(Classic ASP) Add, Remove, Update MIME Header Fields

(Visual FoxPro) Add, Remove, Update MIME Header Fields

(PowerBuilder) Add, Remove, Update MIME Header Fields

(SQL Server) Add, Remove, Update MIME Header Fields

(Visual Basic 6.0) Add, Remove, Update MIME Header Fields

(VBScript) Add, Remove, Update MIME Header Fields

AddPfxSourceData(pfxFileData As Variant, pfxPassword As String) As Long

Adds a PFX to the object's internal list of sources to be searched for certificates and private keys when decrypting . Multiple PFX sources can be added by calling this method once for each. (On the Windows operating system, the registry-based certificate stores are also automatically searched, so it is commonly not required to explicitly add PFX sources.)

The pfxFileData contains the bytes of a PFX file (also known as PKCS12 or .p12).

Returns 1 for success, 0 for failure.

AddPfxSourceFile(pfxFilePath As String, password As String) As Long

Adds a PFX file to the object's internal list of sources to be searched for certificates and private keys when decrypting. Multiple PFX files can be added by calling this method once for each. (On the Windows operating system, the registry-based certificate stores are also automatically searched, so it is commonly not required to explicitly add PFX sources.)

The pfxFilePath contains the bytes of a PFX file (also known as PKCS12 or .p12).

Returns 1 for success, 0 for failure.

AppendPart(mime As ChilkatMime) As Long

Appends a MIME message to the sub-parts of this message. Arbitrarily complex messages with unlimited nesting levels can be created. If the calling Mime object is not already multipart, it is automatically converted to multipart/mixed first.

Returns 1 for success, 0 for failure.

(Classic ASP) Append Part to MIME

(Visual FoxPro) Append Part to MIME

(PowerBuilder) Append Part to MIME

(SQL Server) Append Part to MIME

(Visual Basic 6.0) Append Part to MIME

(VBScript) Append Part to MIME

AppendPartFromFile(filename As String) As Long

Loads a file and creates a Mime message object using the file extension to determine the content type, and adds it as a sub-part to the calling object.

Returns 1 for success, 0 for failure.

AsnBodyToXml() As String

When the body of a MIME part contains PKCS7 (ASN.1 in DER format, base64-encoded), this method can be used to convert the ASN.1 to an XML format for inspection. Here is an example of how an ASN.1 body might look:

Content-Type: application/x-pkcs7-mime;
	name="smime.p7m"; smime-type="signed-data"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7m"

MIIXXAYJKoZIhvcNAQcCoIIXTTCCF0kCAQExCzAJBgUrDgMCGgUAMFoGCSqGSIb3DQEHAaBNBEtD
b250ZW50LVR5cGU6IHRleHQvcGxhaW4NCkNvbnRlbnQtVHJhbnNmZXItRW5jb2Rpbmc6IDdiaXQN
Cg0KdGhpcyBpcyBhIHRlc3SgghI/MIIE3jCCA8agAwIBAgICAwEwDQYJKoZIhvcNAQEFBQAwYzEL
...
The XML produced would look something like this:
<?xml version="1.0" encoding="utf-8" ?>
<sequence>
    <oid>1.2.840.113549.1.7.2</oid>
    <contextSpecific tag="0" constructed="1">
        <sequence>
            <int>01</int>
            <set>
                <sequence>
                    <oid>1.3.14.3.2.26</oid>
                    <null />
                </sequence>
            </set>
            <sequence>
                <oid>1.2.840.113549.1.7.1</oid>
                <contextSpecific tag="0" constructed="1">
...

Returns Nothing on failure

ClearEncryptCerts()

Clears the internal list of certificates added by previous calls to the AddEncryptCert method. (See the EncryptN method for information about encrypting using multiple certificates.)

ContainsEncryptedParts() As Long

Returns 1 if the MIME message contains encrypted parts.

Note: This method examines the MIME as-is. If UnwrapSecurity is called and it is successful, then the MIME should no longer contain encrypted parts, and this method would return 0.

Note: If a signed MIME message is then encrypted, then it is not possible to know that the MIME is both encrypted and signed until UnwrapSecurity is called. (In other words, it is not possible to know the contents of the encrypted MIME until it is decrypted.) Therefore, the ContainsSignedParts method would return 0.

(Classic ASP) Decrypt S/MIME and Verify S/MIME Signatures

(Visual FoxPro) Decrypt S/MIME and Verify S/MIME Signatures

(PowerBuilder) Decrypt S/MIME and Verify S/MIME Signatures

(SQL Server) Decrypt S/MIME and Verify S/MIME Signatures

(Visual Basic 6.0) Decrypt S/MIME and Verify S/MIME Signatures

(VBScript) Decrypt S/MIME and Verify S/MIME Signatures

ContainsSignedParts() As Long

Returns 1 if the MIME message contains signed parts.

Note: This method examines the MIME as-is. If UnwrapSecurity is called and it is successful, then the MIME should no longer contain signed parts, and this method would return 0.

Note: If a signed MIME message is then encrypted, then it is not possible to know that the MIME is both encrypted and signed until UnwrapSecurity is called. (In other words, it is not possible to know the contents of the encrypted MIME until it is decrypted.) Therefore, the ContainsSignedParts method would return 0.

Note: The same concept also applies to opaque signatures, such as with the MIME produced by calling ConvertToSigned.

(Classic ASP) Decrypt S/MIME and Verify S/MIME Signatures

(Visual FoxPro) Decrypt S/MIME and Verify S/MIME Signatures

(PowerBuilder) Decrypt S/MIME and Verify S/MIME Signatures

(SQL Server) Decrypt S/MIME and Verify S/MIME Signatures

(Visual Basic 6.0) Decrypt S/MIME and Verify S/MIME Signatures

(VBScript) Decrypt S/MIME and Verify S/MIME Signatures

Convert8Bit()

Changes the content-transfer-encoding to "base64" for all 8bit or binary MIME subparts. This allows for the MIME to be exported as a string via the GetMime method.

(Classic ASP) MIME Content-Transfer-Encoding Header Field

(Visual FoxPro) MIME Content-Transfer-Encoding Header Field

(PowerBuilder) MIME Content-Transfer-Encoding Header Field

(SQL Server) MIME Content-Transfer-Encoding Header Field

(Visual Basic 6.0) MIME Content-Transfer-Encoding Header Field

(VBScript) MIME Content-Transfer-Encoding Header Field

ConvertToMultipartAlt() As Long

Converts existing MIME to a multipart/alternative. This is accomplished by creating a new outermost multipart/alternative MIME part. The existing MIME is moved into the 1st (and only) sub-part of the new multipart/alternative enclosure. Header fields from the original top-level MIME part are transferred to the new top-level multipart/alternative header, except for Content-Type, Content-Transfer-Encoding, and Content-Disposition. For example, the following simple plain-text MIME is converted as follows:

Original:

MIME-Version: 1.0
Date: Sun, 11 Aug 2013 11:18:44 -0500
Message-ID: 
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
X-Priority: 3 (Normal)
Subject: this is the subject.
From: "Chilkat Software" 
To: "Chilkat Sales" 

This is the plain-text body.

After Converting:

MIME-Version: 1.0
Date: Sun, 11 Aug 2013 11:18:44 -0500
Message-ID: 
X-Priority: 3 (Normal)
Subject: this is the subject.
From: "Chilkat Software" 
To: "Chilkat Sales" 
Content-Type: multipart/alternative;
	boundary="------------040101040804050401050400_.ALT"

--------------040101040804050401050400_.ALT
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

This is the plain-text body.
--------------040101040804050401050400_.ALT--

Returns 1 for success, 0 for failure.

ConvertToMultipartMixed() As Long

Converts existing MIME to a multipart/mixed. This is accomplished by creating a new outermost multipart/mixed MIME part. The existing MIME is moved into the 1st (and only) sub-part of the new multipart/mixed enclosure. Header fields from the original top-level MIME part are transferred to the new top-level multipart/mixed header, except for Content-Type, Content-Transfer-Encoding, and Content-Disposition. For example, the following simple plain-text MIME is converted as follows:

Original:

MIME-Version: 1.0
Date: Sun, 11 Aug 2013 11:27:04 -0500
Message-ID: 
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
X-Priority: 3 (Normal)
Subject: this is the subject.
From: "Chilkat Software" 
To: "Chilkat Sales" 

This is the plain-text body.

After Converting:

MIME-Version: 1.0
Date: Sun, 11 Aug 2013 11:27:04 -0500
Message-ID: 
X-Priority: 3 (Normal)
Subject: this is the subject.
From: "Chilkat Software" 
To: "Chilkat Sales" 
Content-Type: multipart/mixed;
	boundary="------------050508060709030908040207"

--------------050508060709030908040207
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

This is the plain-text body.
--------------050508060709030908040207--

Returns 1 for success, 0 for failure.

(Classic ASP) Create Binary MIME

(Visual FoxPro) Create Binary MIME

(PowerBuilder) Create Binary MIME

(SQL Server) Create Binary MIME

(Visual Basic 6.0) Create Binary MIME

(VBScript) Create Binary MIME

ConvertToSigned(cert As ChilkatCert) As Long

Digitally signs a MIME message. The MIME is converted to an application/x-pkcs7-mime which is a PKCS7 signature that includes both the original MIME message and the signature. This is different than AddDetachedSignature, where the signature is appended to the MIME.

Note: This is commonly referred to as an "opaque" signature.

Returns 1 for success, 0 for failure.

(Classic ASP) Example Code: Create PKCS7 Attached/Opaque Signature (S/MIME)

(Visual FoxPro) Example Code: Create PKCS7 Attached/Opaque Signature (S/MIME)

(PowerBuilder) Example Code: Create PKCS7 Attached/Opaque Signature (S/MIME)

(SQL Server) Example Code: Create PKCS7 Attached/Opaque Signature (S/MIME)

(Visual Basic 6.0) Example Code: Create PKCS7 Attached/Opaque Signature (S/MIME)

(VBScript) Example Code: Create PKCS7 Attached/Opaque Signature (S/MIME)

(Classic ASP) Sign MIME using RSASSA-PSS with SHA256

(Visual FoxPro) Sign MIME using RSASSA-PSS with SHA256

(PowerBuilder) Sign MIME using RSASSA-PSS with SHA256

(SQL Server) Sign MIME using RSASSA-PSS with SHA256

(Visual Basic 6.0) Sign MIME using RSASSA-PSS with SHA256

(VBScript) Sign MIME using RSASSA-PSS with SHA256

ConvertToSignedPk(cert As ChilkatCert, privateKey As PrivateKey) As Long

Digitally signs the MIME to convert it to an "opaque" signed message using a certificate and it's associated private key. This method would be used when the private key is external to the certificate -- for example, if a PFX/P12 file is not used, but instead a pair of .cer and .pem files are used (one for the certificate and one for the associated private key).

Returns 1 for success, 0 for failure.

(Classic ASP) Example Code for ConvertToSignedPk

(Visual FoxPro) Example Code for ConvertToSignedPk

(PowerBuilder) Example Code for ConvertToSignedPk

(SQL Server) Example Code for ConvertToSignedPk

(Visual Basic 6.0) Example Code for ConvertToSignedPk

(VBScript) Example Code for ConvertToSignedPk

Decrypt() As Long

Decrypts PKCS7 encrypted MIME (also known as S/MIME). Information about the certificates required for decryption is always embedded within PKCS7 encrypted MIME. This method will automatically find and use the certificate + private key required from three possible sources:

  1. PFX files that were provided in one or more calls to AddPfxSourceData or AddPfxSourceFile.
  2. Certificates found in an XML certificate vault provided by calling the UseCertVault method.
  3. (On Windows systems) Certificates found in the system's registry-based certificate stores.

Returns 1 for success, 0 for failure.

(Classic ASP) Example Code: PKCS7 Decrypt MIME

(Visual FoxPro) Example Code: PKCS7 Decrypt MIME

(PowerBuilder) Example Code: PKCS7 Decrypt MIME

(SQL Server) Example Code: PKCS7 Decrypt MIME

(Visual Basic 6.0) Example Code: PKCS7 Decrypt MIME

(VBScript) Example Code: PKCS7 Decrypt MIME

(Classic ASP) Decrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(Visual FoxPro) Decrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(PowerBuilder) Decrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(SQL Server) Decrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(Visual Basic 6.0) Decrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(VBScript) Decrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

Decrypt2(cert As ChilkatCert, privateKey As PrivateKey) As Long

The same as Decrypt, but useful when the certificate and private key are available in separate files (as opposed to a single file such as a .pfx/.p12).

Returns 1 for success, 0 for failure.

(Classic ASP) Example Code for Decrypt2

(Visual FoxPro) Example Code for Decrypt2

(PowerBuilder) Example Code for Decrypt2

(SQL Server) Example Code for Decrypt2

(Visual Basic 6.0) Example Code for Decrypt2

(VBScript) Example Code for Decrypt2

(Classic ASP) Decrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(Visual FoxPro) Decrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(PowerBuilder) Decrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(SQL Server) Decrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(Visual Basic 6.0) Decrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(VBScript) Decrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

DecryptUsingCert(cert As ChilkatCert) As Long

Introduced in version 9.5.0.40

Decrypts PKCS7 encrypted MIME (also known as S/MIME) using a specific certificate.

Returns 1 for success, 0 for failure.

DecryptUsingPfxData(pfxData As Variant, password As String) As Long

Decrypts MIME using a specific PFX ( also known as PKCS12, which is a file format commonly used to store private keys with accompanying public key certificates, protected with a password-based symmetric key). This method allows the bytes of the PKCS12 file to be passed directly, thus allowing PKCS12's to be persisted and retrieved from non-file-based locations, such as in LDAP or a database.

Returns 1 for success, 0 for failure.

DecryptUsingPfxFile(pfxFilePath As String, pfxPassword As String) As Long

Decrypts MIME using a specific PFX file (also known as PKCS12) as the source for any required certificates and private keys. (Note: .pfx and .p12 files are both PKCS12 format.)

Returns 1 for success, 0 for failure.

(Classic ASP) PKCS7 Decrypt Using .pfx or .p12 File

(Visual FoxPro) PKCS7 Decrypt Using .pfx or .p12 File

(PowerBuilder) PKCS7 Decrypt Using .pfx or .p12 File

(SQL Server) PKCS7 Decrypt Using .pfx or .p12 File

(Visual Basic 6.0) PKCS7 Decrypt Using .pfx or .p12 File

(VBScript) PKCS7 Decrypt Using .pfx or .p12 File

Encrypt(cert As ChilkatCert) As Long

Encrypts the MIME to create PKCS7 encrypted MIME. A digital certificate (which always contains a public-key) is used to encrypt.

Returns 1 for success, 0 for failure.

(Classic ASP) Example Code: PKCS7 Encrypt MIME

(Visual FoxPro) Example Code: PKCS7 Encrypt MIME

(PowerBuilder) Example Code: PKCS7 Encrypt MIME

(SQL Server) Example Code: PKCS7 Encrypt MIME

(Visual Basic 6.0) Example Code: PKCS7 Encrypt MIME

(VBScript) Example Code: PKCS7 Encrypt MIME

(Classic ASP) Encrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(Visual FoxPro) Encrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(PowerBuilder) Encrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(SQL Server) Encrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(Visual Basic 6.0) Encrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

(VBScript) Encrypt MIME using RSAES-OAEP with SHA256 and AES-128 content encryption

EncryptN() As Long

Encrypt MIME using any number of digital certificates. Each certificate to be used must first be added by calling AddEncryptCert (once per certificate). See the example code below:

Returns 1 for success, 0 for failure.

(Classic ASP) Example: PKCS7 Encrypt using Multiple Certificates

(Visual FoxPro) Example: PKCS7 Encrypt using Multiple Certificates

(PowerBuilder) Example: PKCS7 Encrypt using Multiple Certificates

(SQL Server) Example: PKCS7 Encrypt using Multiple Certificates

(Visual Basic 6.0) Example: PKCS7 Encrypt using Multiple Certificates

(VBScript) Example: PKCS7 Encrypt using Multiple Certificates

ExtractPartsToFiles(dirPath As String) As CkStringArray

Recursively descends through the parts of a MIME message and extracts all parts having a filename to a file. The files are created in dirPath. Returns a (Ck)StringArray object containing the names of the files created. The filenames are obtained from the "filename" attribute of the content-disposition header. If a filename does not exist, then the MIME part is not saved to a file.

Returns Nothing on failure

(Classic ASP) Extract Files from MIME

(Visual FoxPro) Extract Files from MIME

(PowerBuilder) Extract Files from MIME

(SQL Server) Extract Files from MIME

(Visual Basic 6.0) Extract Files from MIME

(VBScript) Extract Files from MIME

FindIssuer(cert As ChilkatCert) As ChilkatCert

Finds and returns the issuer certificate. If the certificate is a root or self-issued, then the certificate returned is a copy of the caller certificate.

Returns Nothing on failure

GetBodyBd(binDat As ChilkatBinData) As Long

Introduced in version 9.5.0.67

Returns the body of the MIME message in a BinData object.

Returns 1 for success, 0 for failure.

GetBodyBinary() As Variant

Returns the body of the MIME message as a block of binary data. The body is automatically converted from its encoding type, such as base64 or quoted-printable, before being returned.

Returns a zero-length byte array (as a Variant) on failure.
An empty array will have a UBound of -1 meaning 0 elements.

(Classic ASP) Get the Binary Bytes of a MIME Body or Sub-Part Body

(Visual FoxPro) Get the Binary Bytes of a MIME Body or Sub-Part Body

(PowerBuilder) Get the Binary Bytes of a MIME Body or Sub-Part Body

(SQL Server) Get the Binary Bytes of a MIME Body or Sub-Part Body

(Visual Basic 6.0) Get the Binary Bytes of a MIME Body or Sub-Part Body

(VBScript) Get the Binary Bytes of a MIME Body or Sub-Part Body

GetBodyDecoded() As String

Returns the body of the MIME message as a string. The body is automatically converted from its encoding type, such as base64 or quoted-printable, before being returned.

Returns Nothing on failure

(Classic ASP) Example Code: GetBodyEncoded / GetBodyDecoded

(Visual FoxPro) Example Code: GetBodyEncoded / GetBodyDecoded

(PowerBuilder) Example Code: GetBodyEncoded / GetBodyDecoded

(SQL Server) Example Code: GetBodyEncoded / GetBodyDecoded

(Visual Basic 6.0) Example Code: GetBodyEncoded / GetBodyDecoded

(VBScript) Example Code: GetBodyEncoded / GetBodyDecoded

(Classic ASP) Example Code: MIME Body vs. Sub-Parts

(Visual FoxPro) Example Code: MIME Body vs. Sub-Parts

(PowerBuilder) Example Code: MIME Body vs. Sub-Parts

(SQL Server) Example Code: MIME Body vs. Sub-Parts

(Visual Basic 6.0) Example Code: MIME Body vs. Sub-Parts

(VBScript) Example Code: MIME Body vs. Sub-Parts

GetBodyEncoded() As String

Returns the body of the MIME message as a String. The body is explicitly not decoded from it's encoding type, so if it was represented in Base64, you will get the Base64 encoded body, as an example.

Returns Nothing on failure

(Classic ASP) Example Code: GetBodyEncoded / GetBodyDecoded

(Visual FoxPro) Example Code: GetBodyEncoded / GetBodyDecoded

(PowerBuilder) Example Code: GetBodyEncoded / GetBodyDecoded

(SQL Server) Example Code: GetBodyEncoded / GetBodyDecoded

(Visual Basic 6.0) Example Code: GetBodyEncoded / GetBodyDecoded

(VBScript) Example Code: GetBodyEncoded / GetBodyDecoded

(Classic ASP) Example Code: MIME Body vs. Sub-Parts

(Visual FoxPro) Example Code: MIME Body vs. Sub-Parts

(PowerBuilder) Example Code: MIME Body vs. Sub-Parts

(SQL Server) Example Code: MIME Body vs. Sub-Parts

(Visual Basic 6.0) Example Code: MIME Body vs. Sub-Parts

(VBScript) Example Code: MIME Body vs. Sub-Parts

(Classic ASP) MIME Content-Transfer-Encoding Header Field

(Visual FoxPro) MIME Content-Transfer-Encoding Header Field

(PowerBuilder) MIME Content-Transfer-Encoding Header Field

(SQL Server) MIME Content-Transfer-Encoding Header Field

(Visual Basic 6.0) MIME Content-Transfer-Encoding Header Field

(VBScript) MIME Content-Transfer-Encoding Header Field

GetEncryptCert(ByVal index As Long) As ChilkatCert

Returns the Nth certificate found when decrypting. The EncryptCerts property contains the number of certificates.

Returns Nothing on failure

(Classic ASP) Decrypt S/MIME and Verify S/MIME Signatures

(Visual FoxPro) Decrypt S/MIME and Verify S/MIME Signatures

(PowerBuilder) Decrypt S/MIME and Verify S/MIME Signatures

(SQL Server) Decrypt S/MIME and Verify S/MIME Signatures

(Visual Basic 6.0) Decrypt S/MIME and Verify S/MIME Signatures

(VBScript) Decrypt S/MIME and Verify S/MIME Signatures

GetEntireBody() As String

Returns the entire MIME body, including all sub-parts.

Returns Nothing on failure

(Classic ASP) GetEntireHead and GetEntireBody

(Visual FoxPro) GetEntireHead and GetEntireBody

(PowerBuilder) GetEntireHead and GetEntireBody

(SQL Server) GetEntireHead and GetEntireBody

(Visual Basic 6.0) GetEntireHead and GetEntireBody

(VBScript) GetEntireHead and GetEntireBody

GetEntireHead() As String

Returns the MIME header.

Returns Nothing on failure

(Classic ASP) GetEntireHead and GetEntireBody

(Visual FoxPro) GetEntireHead and GetEntireBody

(PowerBuilder) GetEntireHead and GetEntireBody

(SQL Server) GetEntireHead and GetEntireBody

(Visual Basic 6.0) GetEntireHead and GetEntireBody

(VBScript) GetEntireHead and GetEntireBody

GetHeaderField(fieldName As String) As String

Returns the value of a MIME header field. fieldName is case-insensitive.

Returns Nothing on failure

(Classic ASP) Get the Value of a MIME Header Field

(Visual FoxPro) Get the Value of a MIME Header Field

(PowerBuilder) Get the Value of a MIME Header Field

(SQL Server) Get the Value of a MIME Header Field

(Visual Basic 6.0) Get the Value of a MIME Header Field

(VBScript) Get the Value of a MIME Header Field

GetHeaderFieldAttribute(name As String, attrName As String) As String

Parses a MIME header field and returns the value of an attribute. MIME header fields w/ attributes are formatted like this:

Header-Name:  value;  attrName1="value1"; attrName2="value2"; ....  attrNameN="valueN"
Semi-colons separate attribute name=value pairs. The Content-Type header field often contains attributes. Here is an example:
Content-Type: multipart/signed;
	protocol="application/x-pkcs7-signature";
	micalg=SHA1;
	boundary="----=_NextPart_000_0000_01CB03E4.D0BAF010"
In the above example, to access the value of the "protocol" attribute, call GetHeaderFieldAttribute("Content-Type", "protocol");

Returns Nothing on failure

(Classic ASP) Example Code: Parse MIME Header Fields

(Visual FoxPro) Example Code: Parse MIME Header Fields

(PowerBuilder) Example Code: Parse MIME Header Fields

(SQL Server) Example Code: Parse MIME Header Fields

(Visual Basic 6.0) Example Code: Parse MIME Header Fields

(VBScript) Example Code: Parse MIME Header Fields

GetHeaderFieldName(ByVal index As Long) As String

Returns the Nth MIME header field name.

Returns Nothing on failure

GetHeaderFieldValue(ByVal index As Long) As String

Returns the Nth MIME header field value.

Returns Nothing on failure

GetMime() As String

Returns a string containing the complete MIME message, including all sub-parts.

Returns Nothing on failure

GetMimeBd(bindat As ChilkatBinData) As Long

Introduced in version 9.5.0.62

Appends the MIME to a BinData object.

Returns 1 for success, 0 for failure.

(Classic ASP) Create Binary MIME

(Visual FoxPro) Create Binary MIME

(PowerBuilder) Create Binary MIME

(SQL Server) Create Binary MIME

(Visual Basic 6.0) Create Binary MIME

(VBScript) Create Binary MIME

GetMimeBytes() As Variant

Returns a byte array containing the complete MIME message, including all sub-parts.

Returns a zero-length byte array (as a Variant) on failure.
An empty array will have a UBound of -1 meaning 0 elements.

(Classic ASP) MIME -- Convert Base64 to Binary

(Visual FoxPro) MIME -- Convert Base64 to Binary

(PowerBuilder) MIME -- Convert Base64 to Binary

(SQL Server) MIME -- Convert Base64 to Binary

(Visual Basic 6.0) MIME -- Convert Base64 to Binary

(VBScript) MIME -- Convert Base64 to Binary

(Classic ASP) MIME Content-Transfer-Encoding Header Field

(Visual FoxPro) MIME Content-Transfer-Encoding Header Field

(PowerBuilder) MIME Content-Transfer-Encoding Header Field

(SQL Server) MIME Content-Transfer-Encoding Header Field

(Visual Basic 6.0) MIME Content-Transfer-Encoding Header Field

(VBScript) MIME Content-Transfer-Encoding Header Field

GetMimeSb(sb As ChilkatStringBuilder) As Long

Introduced in version 9.5.0.62

Appends the MIME to a StringBuilder object.

Returns 1 for success, 0 for failure.

(Classic ASP) Create Binary MIME

(Visual FoxPro) Create Binary MIME

(PowerBuilder) Create Binary MIME

(SQL Server) Create Binary MIME

(Visual Basic 6.0) Create Binary MIME

(VBScript) Create Binary MIME

GetPart(ByVal index As Long) As ChilkatMime

Returns the Nth sub-part of the MIME message. Indexing begins at 0.

Returns Nothing on failure

GetSignatureSigningTime(ByVal index As Long) As Date

This method is deprecated. It will be removed in a future version.

Returns the signature signing date/time for the Nth signature. The number of signatures (i.e. signer certs) is indicated by the NumSignerCerts property. The HasSignatureSigningTime method may be called to determine if a signature timestamp is available. The index of the 1st signature signing time is 0.

GetSignatureSigningTimeStr(ByVal index As Long) As String

The same as the GetSignatureSigningTime method, but returns tjhe date/time in RFC822 string format.

Returns Nothing on failure

GetSignerCert(ByVal index As Long) As ChilkatCert

Returns the Nth digital certificate used to sign the MIME message. Indexing begins at 0.

Returns Nothing on failure

(Classic ASP) Decrypt S/MIME and Verify S/MIME Signatures

(Visual FoxPro) Decrypt S/MIME and Verify S/MIME Signatures

(PowerBuilder) Decrypt S/MIME and Verify S/MIME Signatures

(SQL Server) Decrypt S/MIME and Verify S/MIME Signatures

(Visual Basic 6.0) Decrypt S/MIME and Verify S/MIME Signatures

(VBScript) Decrypt S/MIME and Verify S/MIME Signatures

GetSignerCertChain(ByVal index As Long) As ChilkatCertChain

Introduced in version 9.5.0.40

Returns the full certificate chain for the Nth certificate used to sign the MIME message. Indexing begins at 0.

Returns Nothing on failure

GetStructure(fmt As String) As String

Introduced in version 9.5.0.56

Returns a string summarizing the MIME structure. The output format is specified by fmt and can be "text" or "xml".

Returns Nothing on failure

(Classic ASP) Examing the MIME Nesting Structure

(Visual FoxPro) Examing the MIME Nesting Structure

(PowerBuilder) Examing the MIME Nesting Structure

(SQL Server) Examing the MIME Nesting Structure

(Visual Basic 6.0) Examing the MIME Nesting Structure

(VBScript) Examing the MIME Nesting Structure

GetXml() As String

Converts the MIME (or S/MIME) message to XML and returns the XML as a string.

Returns Nothing on failure

(Classic ASP) Convert MIME to XML

(Visual FoxPro) Convert MIME to XML

(PowerBuilder) Convert MIME to XML

(SQL Server) Convert MIME to XML

(Visual Basic 6.0) Convert MIME to XML

(VBScript) Convert MIME to XML

HasSignatureSigningTime(ByVal index As Long) As Long

Returns 1 if the Nth signature included a timestamp that recorded the signing time. The number of signatures (i.e. signer certs) is indicated by the NumSignerCerts property. (In most cases, the number of signer certs is 1.) The signing time can be obtained via the GetSignatureSigningTime or GetSignatureSigningTimeStr methods. The index of the 1st signature signing time is 0.

IsApplicationData() As Long

Return 1 if the MIME message contains application data, otherwise returns 0.

IsAttachment() As Long

Return 1 if this MIME message is an attachment, otherwise returns 0. A MIME message is considered an attachment if the Content-Disposition header field contains the value "attachment".

IsAudio() As Long

Return 1 if the MIME message contains audio data, otherwise returns 0.

IsEncrypted() As Long

Returns 1 if the MIME message is PKCS7 encrypted, otherwise returns 0.

IsHtml() As Long

Return 1 if the MIME body is HTML, otherwise returns 0.

IsImage() As Long

Return 1 if the MIME message contains image data, otherwise returns 0.

IsMultipart() As Long

Return 1 if the MIME message is multipart (multipart/mixed, multipart/related, multipart/alternative, etc.), otherwise returns 0.

IsMultipartAlternative() As Long

Return 1 if the MIME message is multipart/alternative, otherwise returns 0.

IsMultipartMixed() As Long

Return true if the MIME message is multipart/mixed, otherwise returns 0.

IsMultipartRelated() As Long

Return 1 if the MIME message is multipart/related, otherwise returns 0.

IsPlainText() As Long

Return 1 if the MIME message body is plain text, otherwise returns 0.

IsSigned() As Long

Return 1 if the MIME message is PKCS7 digitally signed, otherwise returns 0.

IsText() As Long

Return 1 if the MIME message body is any text content type, such as text/plain, text/html, text/xml, etc., otherwise returns 0.

IsUnlocked() As Long

Returns 1 if the component is already unlocked, otherwise returns 0.

IsVideo() As Long

Return 1 if the MIME message contains video data, otherwise returns 0.

IsXml() As Long

Return 1 if the MIME message body is XML, otherwise returns 0.

LastJsonData() As ChilkatJsonObject

Introduced in version 9.5.0.69

Provides information about what transpired in the last method called on this object instance. For many methods, there is no information. However, for some methods, details about what occurred can be obtained by getting the LastJsonData right after the method call returns. For example, after calling UnwrapSecurity, the LastJsonData will return JSON with details about the algorithms used for signature verification and decryption.

Returns Nothing on failure

LoadMime(mimeMsg As String) As Long

Discards the current contents of the MIME object and loads a new MIME message from a string.

Returns 1 for success, 0 for failure.

LoadMimeBd(bindat As ChilkatBinData) As Long

Introduced in version 9.5.0.62

Discards the current contents of the MIME object and loads a new MIME message from a BinData object.

Returns 1 for success, 0 for failure.

LoadMimeBytes(binData As Variant) As Long

Loads a MIME document from an in-memory byte array.

Returns 1 for success, 0 for failure.

LoadMimeFile(fileName As String) As Long

Discards the current contents of the MIME object and loads a new MIME message from a file.

Returns 1 for success, 0 for failure.

LoadMimeSb(sb As ChilkatStringBuilder) As Long

Introduced in version 9.5.0.62

Discards the current contents of the MIME object and loads a new MIME message from a StringBuilder.

Returns 1 for success, 0 for failure.

(Classic ASP) Load MIME Object from Email Object

(Visual FoxPro) Load MIME Object from Email Object

(PowerBuilder) Load MIME Object from Email Object

(SQL Server) Load MIME Object from Email Object

(Visual Basic 6.0) Load MIME Object from Email Object

(VBScript) Load MIME Object from Email Object

LoadXml(xml As String) As Long

Converts XML to MIME and replaces the MIME object's contents with the converted XML.

Returns 1 for success, 0 for failure.

LoadXmlFile(fileName As String) As Long

Converts XML to MIME and replaces the MIME object's contents with the converted XML.

Returns 1 for success, 0 for failure.

NewMessageRfc822(mimeObject As ChilkatMime) As Long

Clears the Mime object and initializes it such that the header contains a "content-type: message/rfc822" line and the body is the MIME text of the Mime object passed to the method.

Returns 1 for success, 0 for failure.

NewMultipartAlternative() As Long

Discards the current MIME message header fields and contents, if any, an initializes the MIME object to be an empty mulipart/alternative message.

Returns 1 for success, 0 for failure.

(Classic ASP) Create multipart/alternative MIME

(Visual FoxPro) Create multipart/alternative MIME

(PowerBuilder) Create multipart/alternative MIME

(SQL Server) Create multipart/alternative MIME

(Visual Basic 6.0) Create multipart/alternative MIME

(VBScript) Create multipart/alternative MIME

NewMultipartMixed() As Long

Discards the current MIME message header fields and contents, if any, an initializes the MIME object to be an empty mulipart/mixed message.

Returns 1 for success, 0 for failure.

(Classic ASP) Example Code: Create a Multipart-Mixed MIME Message

(Visual FoxPro) Example Code: Create a Multipart-Mixed MIME Message

(PowerBuilder) Example Code: Create a Multipart-Mixed MIME Message

(SQL Server) Example Code: Create a Multipart-Mixed MIME Message

(Visual Basic 6.0) Example Code: Create a Multipart-Mixed MIME Message

(VBScript) Example Code: Create a Multipart-Mixed MIME Message

NewMultipartRelated() As Long

Discards the current MIME message header fields and contents, if any, an initializes the MIME object to be an empty mulipart/related message.

Returns 1 for success, 0 for failure.

(Classic ASP) Build a multipart/related MIME Message

(Visual FoxPro) Build a multipart/related MIME Message

(PowerBuilder) Build a multipart/related MIME Message

(SQL Server) Build a multipart/related MIME Message

(Visual Basic 6.0) Build a multipart/related MIME Message

(VBScript) Build a multipart/related MIME Message

RemoveHeaderField(fieldName As String, ByVal bAllOccurrences As Long)

Removes a header field from the MIME header. If bAllOccurrences is 1, then all occurrences of the header field are removed. Otherwise, only the 1st occurrence is removed.

(Classic ASP) Add, Remove, Update MIME Header Fields

(Visual FoxPro) Add, Remove, Update MIME Header Fields

(PowerBuilder) Add, Remove, Update MIME Header Fields

(SQL Server) Add, Remove, Update MIME Header Fields

(Visual Basic 6.0) Add, Remove, Update MIME Header Fields

(VBScript) Add, Remove, Update MIME Header Fields

RemovePart(ByVal index As Long) As Long

Removes the Nth subpart from the MIME message.

Returns 1 for success, 0 for failure.

SaveBody(filename As String) As Long

Saves the MIME message body to a file. If the body is base64 or quoted-printable encoded, it is automatically decoded.

Returns 1 for success, 0 for failure.

(Classic ASP) Save a MIME Body to a File

(Visual FoxPro) Save a MIME Body to a File

(PowerBuilder) Save a MIME Body to a File

(SQL Server) Save a MIME Body to a File

(Visual Basic 6.0) Save a MIME Body to a File

(VBScript) Save a MIME Body to a File

(Classic ASP) Extract Files from Binary SOAP MTOM MIME

(Visual FoxPro) Extract Files from Binary SOAP MTOM MIME

(PowerBuilder) Extract Files from Binary SOAP MTOM MIME

(SQL Server) Extract Files from Binary SOAP MTOM MIME

(Visual Basic 6.0) Extract Files from Binary SOAP MTOM MIME

(VBScript) Extract Files from Binary SOAP MTOM MIME

SaveMime(filename As String) As Long

Saves the MIME message to a file, in MIME format. (This is the same as the .EML format used by Microsoft Outlook Express.)

Returns 1 for success, 0 for failure.

SaveXml(filename As String) As Long

Converts the MIME message to XML and saves to an XML file.

Returns 1 for success, 0 for failure.

SetBody(str As String)

Sets the MIME body content to a text string.

(Classic ASP) Example Code: MIME SetBody

(Visual FoxPro) Example Code: MIME SetBody

(PowerBuilder) Example Code: MIME SetBody

(SQL Server) Example Code: MIME SetBody

(Visual Basic 6.0) Example Code: MIME SetBody

(VBScript) Example Code: MIME SetBody

SetBodyFromBinary(binData As Variant) As Long

Sets the MIME message body from a byte array.

Returns 1 for success, 0 for failure.

(Classic ASP) Build a multipart/related MIME Message

(Visual FoxPro) Build a multipart/related MIME Message

(PowerBuilder) Build a multipart/related MIME Message

(SQL Server) Build a multipart/related MIME Message

(Visual Basic 6.0) Build a multipart/related MIME Message

(VBScript) Build a multipart/related MIME Message

SetBodyFromEncoded(encoding As String, str As String) As Long

Sets the MIME message body from a Base64 or Quoted-Printable encoded string.

Returns 1 for success, 0 for failure.

(Classic ASP) MIME Content-Transfer-Encoding Header Field

(Visual FoxPro) MIME Content-Transfer-Encoding Header Field

(PowerBuilder) MIME Content-Transfer-Encoding Header Field

(SQL Server) MIME Content-Transfer-Encoding Header Field

(Visual Basic 6.0) MIME Content-Transfer-Encoding Header Field

(VBScript) MIME Content-Transfer-Encoding Header Field

SetBodyFromFile(fileName As String) As Long

Sets the MIME message body from the contents of a file. Note: A MIME message consists of a header and a body. The body may itself be a MIME message that consists of a header and body, etc. This method loads the contents of a file into the body of a MIME message, without replacing the header.

The Content-Type and Content-Transfer-Encoding header fields are automatically updated to match the type of content loaded (based on file extension). If your application requires the MIME to have a specific Content-Type and/or Content-Transfer-Encoding, set the ContentType and Encoding properties after calling this method (not before).

Returns 1 for success, 0 for failure.

(Classic ASP) Set MIME Body from File

(Visual FoxPro) Set MIME Body from File

(PowerBuilder) Set MIME Body from File

(SQL Server) Set MIME Body from File

(Visual Basic 6.0) Set MIME Body from File

(VBScript) Set MIME Body from File

SetBodyFromHtml(str As String) As Long

Sets the MIME message body from a string containing HTML. The Content-Type header is added or updated to the value "text/html".

If 8bit (non-us-ascii) characters are present, and if the Charset property was not previously set, then the "charset" attribute is automatically added to the Content-Type header using the default value of "utf-8". This can be changed at any time by setting the Charset property.

If the Encoding property was not previously set, then the Content-Transfer-Encoding header is automatically added. It will be set to "7bit" or "8bit" depending on whether the HTML body contains 8-bit non-us-ascii characters.

To set the MIME body with no intentional side-effects, use SetBody instead.

Returns 1 for success, 0 for failure.

(Classic ASP) Example Code: Create MIME Containing HTML

(Visual FoxPro) Example Code: Create MIME Containing HTML

(PowerBuilder) Example Code: Create MIME Containing HTML

(SQL Server) Example Code: Create MIME Containing HTML

(Visual Basic 6.0) Example Code: Create MIME Containing HTML

(VBScript) Example Code: Create MIME Containing HTML

(Classic ASP) Build a multipart/related MIME Message

(Visual FoxPro) Build a multipart/related MIME Message

(PowerBuilder) Build a multipart/related MIME Message

(SQL Server) Build a multipart/related MIME Message

(Visual Basic 6.0) Build a multipart/related MIME Message

(VBScript) Build a multipart/related MIME Message

SetBodyFromPlainText(str As String) As Long

Sets the MIME message body from a string containing plain-text. The Content-Type header is added or updated to the value "text/plain".

If 8bit (non-us-ascii) characters are present, and if the Charset property was not previously set, then the "charset" attribute is automatically added to the Content-Type header using the default value of "utf-8". This can be changed at any time by setting the Charset property.

If the Encoding property was not previously set, then the Content-Transfer-Encoding header is automatically added. It will be set to "7bit" or "8bit" depending on whether the plain-text body contains 8-bit non-us-ascii characters.

To set the MIME body with no intentional side-effects, use SetBody instead.

Returns 1 for success, 0 for failure.

(Classic ASP) Example Code: Create MIME Containing Plain-Text

(Visual FoxPro) Example Code: Create MIME Containing Plain-Text

(PowerBuilder) Example Code: Create MIME Containing Plain-Text

(SQL Server) Example Code: Create MIME Containing Plain-Text

(Visual Basic 6.0) Example Code: Create MIME Containing Plain-Text

(VBScript) Example Code: Create MIME Containing Plain-Text

SetBodyFromXml(str As String) As Long

Sets the MIME message body from a string containing XML. The Content-Type header is added or updated to the value "text/xml".

If 8bit (non-us-ascii) characters are present, and if the Charset property was not previously set, then the "charset" attribute is automatically added to the Content-Type header using the default value of "utf-8". This can be changed at any time by setting the Charset property.

If the Encoding property was not previously set, then the Content-Transfer-Encoding header is automatically added. It will be set to "7bit" or "8bit" depending on whether the plain-text body contains 8-bit non-us-ascii characters.

To set the MIME body with no intentional side-effects, use SetBody instead.

Returns 1 for success, 0 for failure.

(Classic ASP) Example Code: Create MIME Containing XML

(Visual FoxPro) Example Code: Create MIME Containing XML

(PowerBuilder) Example Code: Create MIME Containing XML

(SQL Server) Example Code: Create MIME Containing XML

(Visual Basic 6.0) Example Code: Create MIME Containing XML

(VBScript) Example Code: Create MIME Containing XML

SetCSP(csp As ChilkatCsp) As Long

(Only applies to the Microsoft Windows OS) Sets the Cryptographic Service Provider (CSP) to be used for encryption / signing, or decryption / signature verification.

This is not commonly used becaues the default Microsoft CSP is typically appropriate. One instance where SetCSP is necessary is when using the Crypto-Pro CSP for the GOST R 34.10-2001 and GOST R 34.10-94 providers.

Returns 1 for success, 0 for failure.

SetHeaderField(name As String, value As String) As Long

Adds or replaces a MIME message header field. If the field already exists, it is automatically replaced. Otherwise it is added. Pass zero-length value to remove the header field.

Returns 1 for success, 0 for failure.

(Classic ASP) Add, Remove, Update MIME Header Fields

(Visual FoxPro) Add, Remove, Update MIME Header Fields

(PowerBuilder) Add, Remove, Update MIME Header Fields

(SQL Server) Add, Remove, Update MIME Header Fields

(Visual Basic 6.0) Add, Remove, Update MIME Header Fields

(VBScript) Add, Remove, Update MIME Header Fields

SetVerifyCert(cert As ChilkatCert) As Long

Allows a certificate to be explicitly specified for verifying a signature.

Returns 1 for success, 0 for failure.

UnlockComponent(unlockCode As String) As Long

Unlocks the component allowing for the full functionality to be used. If this method unexpectedly returns 0, examine the contents of the LastErrorText property to determine the reason for failure.

Returns 1 for success, 0 for failure.

Diagnosing UnlockComponent Problems

UnlockComponent LastErrorText shows exact string passed to it.

Verify UnlockComponent Success w/ Purchased Unlock Code

LastErrorText Standard Information

UnwrapSecurity() As Long

Decrypts and/or verifies all digital signatures contained within the MIME message, and returns 1 if all decryptions and verifications succeeded. Otherwise returns 0. After unwrapping, the information regarding security and certificates can be obtained by the methods GetSignerCert and GetEncryptCert, and the properties NumEncryptCerts and NumSignerCerts.

The MIME is restored to the original structure/content prior to all signing and/or encryption.

The difference between UnwrapSecurity and methods such as Verify or Decrypt is that UnwrapSecurity will recursively traverse the MIME to decrypt and/or verify all parts. Also, UnwrapSecurity will unwrap layers until no further encrypted/signed content is found. For example, if a MIME message was encrypted and then subsequently signed, then UnwrapSecurity will verify and unwrap the detached signature/signed-data layer, and then decrypt the "enveloped data".

Returns 1 for success, 0 for failure.

(Classic ASP) Decrypt S/MIME and Verify S/MIME Signatures

(Visual FoxPro) Decrypt S/MIME and Verify S/MIME Signatures

(PowerBuilder) Decrypt S/MIME and Verify S/MIME Signatures

(SQL Server) Decrypt S/MIME and Verify S/MIME Signatures

(Visual Basic 6.0) Decrypt S/MIME and Verify S/MIME Signatures

(VBScript) Decrypt S/MIME and Verify S/MIME Signatures

UrlEncodeBody(charset As String)

URL encodes the MIME body. The charset is important. For example, consider this MIME:

Content-Type: text/plain
Content-Transfer-Encoding: 8bit

Société
If the charset is set to "utf-8", then the following is produced:
Content-Type: text/plain
Content-Transfer-Encoding: 8bit

Soci%C3%A9t%C3%A9
However, if the charset is set to "ansi", then the following is the result:
Content-Type: text/plain
Content-Transfer-Encoding: 8bit

Soci%E9t%E9

UseCertVault(vault As ChilkatXmlCertVault) As Long

Adds an XML certificate vault to the object's internal list of sources to be searched for certificates and private keys when encrypting/decrypting or signing/verifying. Unlike the AddPfxSourceData and AddPfxSourceFile methods, only a single XML certificate vault can be used. If UseCertVault is called multiple times, only the last certificate vault will be used, as each call to UseCertVault will replace the certificate vault provided in previous calls.

Returns 1 for success, 0 for failure.

Verify() As Long

Verifies PKCS7 signed MIME and "unwraps" the signature. The MIME is restored to the original structure that it would have originally had prior to signing. The Verify method works with both detached signatures, as well as opaque/attached signatures.

A PKCS7 signature usually embeds both the signing certificate with its public key. Therefore, it is usually possible to verify a signature without the need to already have the certificate installed. If the signature does not embed the certificate, the Verify method will automatically locate and use the certificate if it was correctly pre-installed on the computer.

Returns 1 for success, 0 for failure.

(Classic ASP) Example Code: Verify and Unwrap PCKS7 Signed MIME

(Visual FoxPro) Example Code: Verify and Unwrap PCKS7 Signed MIME

(PowerBuilder) Example Code: Verify and Unwrap PCKS7 Signed MIME

(SQL Server) Example Code: Verify and Unwrap PCKS7 Signed MIME

(Visual Basic 6.0) Example Code: Verify and Unwrap PCKS7 Signed MIME

(VBScript) Example Code: Verify and Unwrap PCKS7 Signed MIME