CkMime class final

Build, parse, modify, serialize, secure, and inspect MIME and S/MIME data.

Mime provides low-level MIME and S/MIME handling for applications that need direct control over MIME structure, headers, body content, encodings, multipart relationships, attachments, and PKCS7/CMS security layers. It can load, create, inspect, modify, serialize, and save MIME messages; build multipart structures; manage headers and content-transfer encodings; extract attachments; convert MIME to and from XML; and sign, verify, encrypt, decrypt, or unwrap S/MIME content.

Create and load MIME

Build MIME content programmatically or load existing MIME from strings, files, byte data, or other application sources.

Headers and body content

Read, add, replace, or remove MIME headers, set body content, and control content types, charsets, and transfer encodings.

Multipart structures

Create and inspect multipart MIME trees such as mixed, alternative, related, signed, encrypted, and nested MIME structures.

Attachments and parts

Add, locate, extract, remove, or inspect MIME parts and attachments, including filenames and encoded body data.

S/MIME security

Sign, verify, encrypt, decrypt, unwrap, and inspect PKCS7/CMS S/MIME layers using certificates and private keys.

Serialization and XML

Emit MIME text, save MIME to files, or convert MIME to and from XML for structured inspection, transformation, or storage.

Common pattern: Use Mime when an application needs low-level control over MIME parts, headers, encodings, multipart layout, or S/MIME security. For ordinary email composition and message-level operations, use Email; use Mime when you need to work closer to the raw MIME structure.

Initial state: A new Mime object has no headers or child parts. Its string serialization consists only of the blank header/body separator (CRLF CRLF) until content is added.

MIME parsing is semantic, not byte-preserving. Loading and reserializing can unfold headers, normalize parameter quoting and transfer encodings, use CRLF for generated headers and multipart framing, and discard multipart preamble or epilogue text. Use byte-oriented methods such as loadMimeBd and getMimeBd when arbitrary 8-bit bytes or embedded NUL bytes must be preserved.

For an extended overview, see Mime Class Overview.

A CkMime owns a native Chilkat object. It is released automatically when the Dart object is garbage collected, or immediately by dispose. Use it only from the isolate that created it.

Implemented types

Constructors

CkMime()
Creates a new CkMime object.

Properties

boundary ↔ String
Gets or sets the raw boundary token used by a multipart MIME entity. Do not include surrounding quotation marks.
getter/setter pair
charset ↔ String
Gets or sets the charset parameter of the Content-Type header field.
getter/setter pair
cmsOptions ↔ String
Gets or sets a JSON string containing advanced CMS/PKCS #7 signing and validation options. The default is an empty string, which selects normal behavior. A valid empty JSON object may also be supplied as {}.
getter/setter pair
contentType ↔ String
Gets or sets the MIME media type of the current part, excluding all parameters. Supply a value such as text/plain, text/html, application/pdf, or multipart/mixed; do not include charset, boundary, or other parameters in this property.
getter/setter pair
currentDateTime → String
Returns the current local date and time formatted as an Internet message date, including the numeric UTC offset. For example:
no setter
debugLogFilePath ↔ String
If set to a file path, this property logs the LastErrorText of each Chilkat method or property call to the specified file. This logging helps identify the context and history of Chilkat calls leading up to any crash or hang, aiding in debugging.
getter/setter pair
disposition ↔ String
Gets or sets the disposition value from the Content-Disposition header field, excluding parameters such as filename.
getter/setter pair
encoding ↔ String
Gets or sets the value of the Content-Transfer-Encoding header field for the current part. Common values include base64, quoted-printable, 7bit, 8bit, and binary.
getter/setter pair
filename ↔ String
Gets or sets the filename parameter of the Content-Disposition header field. The value is a receiver-facing filename, not a local filesystem path.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
isDisposed → bool
Whether dispose has been called on this object.
no setter
lastErrorHtml → String
Provides HTML-formatted information about the last called method or property. If a method call fails or behaves unexpectedly, check this property for details. Note that information is available regardless of the method call's success.
no setter
lastErrorText → String
Provides plain text information about the last called method or property. If a method call fails or behaves unexpectedly, check this property for details. Note that information is available regardless of the method call's success.
no setter
lastErrorXml → String
Provides XML-formatted information about the last called method or property. If a method call fails or behaves unexpectedly, check this property for details. Note that information is available regardless of the method call's success.
no setter
lastMethodSuccess ↔ bool
Indicates the success or failure of the most recent method call: true means success, false means failure. This property remains unchanged by property setters or getters. This method is present to address challenges in checking for null or Nothing returns in certain programming languages. Note: This property does not apply to methods that return integer values or to boolean-returning methods where the boolean does not indicate success or failure.
getter/setter pair
micalg ↔ String
Gets or sets the micalg parameter of a multipart/signed Content-Type header field.
getter/setter pair
name ↔ String
Gets or sets the name parameter of the Content-Type header field. For attachments, filename is generally the primary receiver-facing name.
getter/setter pair
numDecryptCerts → int
Returns the number of recipient or decryption certificates currently recorded by the most recent S/MIME encryption, decryption, or security-unwrapping operation. A new object returns 0. A successful single-recipient encrypt records 1, and successful decryption records the certificate whose private key was used.
no setter
numHeaderFields → int
Returns the number of header-field occurrences in the current part. Duplicate names count separately and retain their order. Valid indexes range from 0 through NumHeaderFields - 1 for use with getHeaderFieldName and getHeaderFieldValue.
no setter
numParts → int
Returns the number of direct child parts. It does not include deeper descendants. Iterate from 0 through NumParts - 1 and call partAt to traverse the tree.
no setter
numSignerCerts → int
Returns the number of signer certificates currently recorded by the most recent S/MIME signing, signature-verification, or security-unwrapping operation. A new object returns 0. A single-certificate signing method records 1; verify and unwrapSecurity replace the count with the signer results from that operation.
no setter
oaepHash ↔ String
Gets or sets the hash algorithm used by RSAES-OAEP when encrypting the CMS content-encryption key. Supported values are sha1, sha256, sha384, and sha512. The default is sha256. An empty or unrecognized value leaves the current valid setting unchanged.
getter/setter pair
oaepMgfHash ↔ String
Gets or sets the hash algorithm used by the MGF1 mask generation function within RSAES-OAEP. Supported values are sha1, sha256, sha384, and sha512. The default is sha256. An empty or unrecognized value leaves the current valid setting unchanged.
getter/setter pair
oaepPadding ↔ bool
Selects the RSA key-transport padding used when creating encrypted MIME. The default is false, which uses RSAES-PKCS1-v1_5. Set to true to use RSAES-OAEP.
getter/setter pair
pkcs7CryptAlg ↔ String
Gets or sets the symmetric content-encryption algorithm used when creating CMS/PKCS #7 encrypted MIME. Supported input values are aes, aes-gcm, des, 3des, and rc2. The default is aes. The aes-gcm option was added in version 10.0.0.
getter/setter pair
pkcs7KeyLength ↔ int
Gets or sets the content-encryption key length, in bits, used when creating CMS/PKCS #7 encrypted MIME. The default is 128.
getter/setter pair
protocol ↔ String
Gets or sets the protocol parameter of the Content-Type header field. This parameter is commonly used by multipart/signed to identify the media type of the detached signature part.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
signingAlg ↔ String
Gets or sets the RSA signature scheme used when creating CMS/PKCS #7 signed MIME. The default and normalized PKCS #1 v1.5 value is PKCS1-V1_5. Set the property to RSASSA-PSS or pss to use RSASSA-PSS; the getter returns RSASSA-PSS.
getter/setter pair
signingHashAlg ↔ String
Gets or sets the message-digest algorithm used when creating CMS/PKCS #7 signatures. The default is sha256. Supported values are sha1, sha256, sha384, sha512, md5, and md2. Names are case-insensitive and are returned in lowercase.
getter/setter pair
uncommonOptions ↔ String
Gets or sets a semicolon-delimited or implementation-specific option string used for uncommon compatibility requirements. The default is the empty string, and normal applications should leave it empty. Options placed here may be version-specific and should be used only when directed by Chilkat documentation or support.
getter/setter pair
unwrapExtras ↔ bool
Controls whether unwrapSecurity adds informative header fields describing the security layers removed. The default is true.
getter/setter pair
useMmDescription ↔ bool
Controls whether Chilkat uses the conventional multipart preamble text This is a multi-part message in MIME format. when serializing a multipart entity. The default is false. The preamble is meaningful only when the multipart has content and is ignored by MIME-aware readers.
getter/setter pair
useXPkcs7 ↔ bool
Controls whether newly created S/MIME media types use the historical x-pkcs7 names.
getter/setter pair
verboseLogging ↔ bool
If set to true, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may contain more verbose information. The default value is false. Verbose logging should only be used for debugging. The potentially large quantity of logged information may adversely affect peformance.
getter/setter pair
version → String
Version of the component/library, such as "10.1.0"
no setter

Methods

addContentLength() → void
Computes the byte length of the current entity's serialized MIME body and adds or updates its Content-Length header. The count is based on the transfer-encoded serialized body, not the decoded payload.
addDecryptCert(CkCert cert) → void
Adds cert to the internal collection of certificates available for S/MIME decryption. The certificate must have access to its corresponding private key. Call this method once for each candidate certificate.
addDetachedSignature(CkCert cert) → void
Creates an S/MIME detached signature using cert. The certificate itself must have access to its private key. On success, the current object becomes a multipart/signed entity with two direct children:
addDetachedSignature2(CkCert cert, bool transferHeaderFields) → void
Creates the same detached multipart/signed structure as addDetachedSignature. cert is the signing certificate and must have access to its private key.
addDetachedSignaturePk(CkCert cert, CkPrivateKey privateKey) → void
Creates a detached S/MIME signature using cert as the signer certificate and privateKey as its associated private key. Use this method when the certificate and private key are supplied separately.
addDetachedSignaturePk2(CkCert cert, CkPrivateKey privateKey, bool transferHeaderFields) → void
Creates a detached S/MIME signature using the certificate in cert and the corresponding private key in privateKey. transferHeaderFields controls placement of the existing message header fields:
addEncryptCert(CkCert cert) → void
Adds cert to the internal recipient-certificate list used by encryptN. Call this method once for each intended recipient. Encryption uses the public key in each certificate, so recipient private keys are not required at encryption time.
addHeaderField(String name, String value) → void
Appends a new header field named by name with the value in value. Existing fields having the same case-insensitive name are preserved. An empty value creates a legal empty-valued field.
addPfxSourceBd(CkBinData bd, String password) → void
Adds the PKCS #12/PFX bytes in bd to the internal collection of credential sources used by later S/MIME decryption operations. password is the password protecting the PFX data. Call the method once for each PFX source that should be searched.
addPfxSourceFile(String pfxFilePath, String password) → void
Adds the PFX/P12 file at the local filesystem path in pfxFilePath to the internal collection of credential sources used by later S/MIME decryption operations. password is the password protecting the file. Call the method once for each PFX source that should be searched.
appendPart(CkMime mime) → void
Appends a copy of mime as the last direct child. Chilkat does not retain a reference to mime, so later changes to mime do not affect the appended part. The same source object may be appended more than once.
appendPartFromFile(String filename) → void
Reads the local file at filename, creates an attachment part, and appends it. Filename-extension matching is case-insensitive.
asnBodyToXml() → String
Parses the current part's decoded body as ASN.1 DER and returns an XML representation of the ASN.1 structure. This is primarily useful for inspecting CMS/PKCS #7 bodies such as application/pkcs7-mime or application/x-pkcs7-mime.
clearEncryptCerts() → void
Clears the internal recipient-certificate list populated by addEncryptCert. A subsequent call to encryptN requires certificates to be added again.
containsEncryptedParts() → bool
Returns true if the currently visible MIME tree contains a CMS/PKCS #7 encrypted entity. Both application/pkcs7-mime and application/x-pkcs7-mime forms are recognized.
containsSignedParts() → bool
Returns true if the currently visible MIME tree contains a complete detached or opaque CMS/PKCS #7 signed entity. A standalone application/pkcs7-signature or application/x-pkcs7-signature leaf part is not by itself classified as a signed message.
convert8Bit() → void
Recursively converts every part whose Content-Transfer-Encoding is 8bit or binary to base64. Both the child object's Encoding property and the serialized header are updated. Parts using 7bit or another encoding are unchanged.
convertToMultipartAlt() → void
Wraps the current entity in a new outer multipart/alternative entity. The original entity becomes the first and initially only child.
convertToMultipartMixed() → void
Wraps the current entity in a new outer multipart/mixed entity. The original entity becomes the first and initially only child.
convertToSigned(CkCert cert) → void
Creates an opaque (attached) S/MIME signature using cert. The certificate itself must have access to its private key. On success, the current MIME entity is replaced by CMS/PKCS #7 signed-data containing both the original MIME bytes and the signature.
convertToSignedPk(CkCert cert, CkPrivateKey privateKey) → void
Creates an opaque (attached) S/MIME signature using cert as the signer certificate and privateKey as its associated private key. Use this method when the certificate and private key are supplied separately.
decrypt() → void
Decrypts the current CMS/PKCS #7 encrypted MIME entity and replaces it with the recovered MIME content. Chilkat identifies the intended recipient from the CMS recipient information and searches configured credential sources for the matching certificate and private key.
decrypt2(CkCert cert, CkPrivateKey privateKey) → void
Decrypts the current CMS/PKCS #7 encrypted MIME entity using the certificate in cert and its associated private key in privateKey. On success, the encrypted wrapper is replaced by the recovered MIME content, the decryption certificate is available through lastDecryptCert, and operation details are available through getLastJsonData. On failure, the encrypted MIME remains unchanged.
decryptUsingCert(CkCert cert) → void
Decrypts the current CMS/PKCS #7 encrypted MIME entity using cert. The certificate must have access to its corresponding private key; a public-only certificate is insufficient. On success, the encrypted wrapper is replaced by the recovered MIME content and cert is recorded in the decryption results. On failure, the encrypted MIME remains unchanged.
decryptUsingPfxFile(String pfxFilePath, String pfxPassword) → void
Decrypts the current CMS/PKCS #7 encrypted MIME entity using certificates and private keys from the PFX/P12 file at the local filesystem path in pfxFilePath. pfxPassword is the password protecting the file.
dispose() → void
Releases the native object now instead of waiting for garbage collection.
encrypt(CkCert cert) → void
Encrypts the current MIME entity for the recipient certificate in cert and replaces it with CMS/PKCS #7 encrypted S/MIME. cert must be RSA-based. Only the recipient's public key is needed to encrypt; the matching private key is required later to decrypt.
encryptN() → void
Encrypts the current MIME entity for every certificate previously added with addEncryptCert. Each recipient receives independently protected access to the same encrypted content.
getBodyBd(CkBinData binDat) → void
Replaces the contents of binDat with the decoded body bytes of the current part. Existing bytes in binDat are discarded. Base64 and quoted-printable are decoded. MIME headers, multipart boundaries, and child parts are not included.
getBodyDecoded() → String
Returns the decoded body as text. Chilkat first decodes the Content-Transfer-Encoding and then interprets text according to the declared charset.
getBodyEncoded() → String
Returns the current part's transfer-encoded body text without decoding Base64 or quoted-printable. The returned value is Chilkat's normalized serialization of the body, not necessarily the exact text that appeared in the loaded MIME. For example, Base64 padding and line wrapping or quoted-printable spelling may be regenerated.
getDecryptCertInfo(CkJsonObject certInfo) → void
Examines the current encrypted S/MIME entity and writes recipient-certificate identifiers to the JsonObject in certInfo. This can be used to identify which certificate and private key must be made available before calling decrypt or unwrapSecurity. A typical result is:
getEntireBody() → String
Returns the complete serialized body of the current MIME entity. For multipart MIME, this includes boundary delimiters, each child part's headers and body, and the closing boundary. The current entity's own header fields are not included.
getEntireHead() → String
Returns the complete serialized header section of the current MIME entity. The body and any multipart child content are not included.
getHeaderField(String fieldName) → String
Returns the value of the first header field whose name matches fieldName case-insensitively. Duplicate later occurrences are not combined. Returns null when no matching field exists.
getHeaderFieldAttribute(String name, String attrName) → String
Returns an attribute value parsed from the first header field named by name. Both the header name and attrName attribute name are matched case-insensitively. Surrounding quotation marks are removed, and semicolons inside a quoted value are handled as part of the value.
getHeaderFieldName(int index) → String
Returns the name of the header-field occurrence at zero-based index. Header order and original casing are preserved for ordinary loaded headers. Use numHeaderFields to determine the valid range.
getHeaderFieldValue(int index) → String
Returns the unfolded value of the header-field occurrence at zero-based index. Continuation lines are combined into a single value. Use numHeaderFields to determine the valid range.
getLastJsonData(CkJsonObject json) → void
Copies structured details from the most recent operation into json when such details are available. Many methods do not produce JSON data.
getMime() → String
Serializes and returns the complete MIME entity, including headers, body, multipart boundaries, and all descendants.
getMimeBd(CkBinData bindat) → void
Serializes the complete MIME entity and appends its bytes to bindat. Existing BinData bytes are preserved. Use this method when arbitrary binary body bytes must not pass through a text string.
getMimeSb(CkStringBuilder sb) → void
Serializes the complete MIME entity and appends it to sb. Existing StringBuilder content is preserved.
getSignatureSigningTimeStr(int index) → String
Returns the CMS signingTime signed attribute for the signer at zero-based index, formatted as an RFC 822-style date string in GMT. For example:
getStructure(String fmt) → String
Returns a concise MIME-tree summary. fmt is case-insensitive. The value xml selects XML output; all other values, including text, an empty string, or an unrecognized value, select the indented text format.
getXml() → String
Converts the MIME tree to Chilkat's XML representation and returns it as a string. Header names become XML element names, structured header parameters become XML attributes, duplicate headers become repeated elements, multipart children are nested in subpart elements, and binary bodies are represented in an encoded textual form.
hasSignatureSigningTime(int index) → bool
Returns true if the signer at zero-based index has a CMS signingTime signed attribute. Use numSignerCerts for the signer count and getSignatureSigningTimeStr to retrieve the value.
isApplicationData() → bool
Returns true when contentType begins with application/. It returns false for an empty or malformed media type.
isAttachment() → bool
Returns true when the current part's disposition value is attachment, matched case-insensitively. Parameters such as filename do not affect the test. An inline part remains non-attachment even when it has a filename.
isAudio() → bool
Returns true when contentType begins with audio/.
isEncrypted() → bool
Returns true when the current MIME entity is a CMS/PKCS #7 encrypted S/MIME wrapper. Both application/pkcs7-mime and application/x-pkcs7-mime forms are recognized. To search the visible MIME tree rather than only the current entity, use containsEncryptedParts.
isHtml() → bool
Returns true when contentType is text/html. The ContentType property must contain only the media type; set parameters such as charset separately.
isImage() → bool
Returns true when contentType begins with image/, including values such as image/svg+xml.
isMultipart() → bool
Returns true when contentType begins with multipart/.
isMultipartAlternative() → bool
Returns true when contentType is multipart/alternative.
isMultipartMixed() → bool
Returns true when contentType is multipart/mixed.
isMultipartRelated() → bool
Returns true when contentType is multipart/related.
isPlainText() → bool
Returns true when contentType is text/plain.
isSigned() → bool
Returns true when the current MIME entity is a complete CMS/PKCS #7 signed S/MIME wrapper, including detached multipart/signed and opaque signed-data forms. A standalone application/pkcs7-signature or application/x-pkcs7-signature leaf part is not by itself classified as a signed message. To search the visible MIME tree, use containsSignedParts.
isText() → bool
Returns true when contentType begins with text/.
isVideo() → bool
Returns true when contentType begins with video/.
isXml() → bool
Returns true only for text/xml or application/xml. It does not classify structured-suffix media types such as application/soap+xml, application/atom+xml, or image/svg+xml as XML.
lastDecryptCert(int index, CkCert cert) → void
Loads into cert the decryption certificate at zero-based index from the most recent successful decryption or security-unwrapping operation. Valid indexes range from 0 through numDecryptCerts - 1. The returned certificate has access to the private key used for decryption.
lastSignerCert(int index, CkCert cert) → void
Loads into cert the signer certificate at zero-based index from the most recent successful signature-verification or security-unwrapping operation. Valid indexes range from 0 through numSignerCerts - 1. The returned certificate normally contains only the public key; it does not gain access to the signer's private key.
loadMime(String mimeMsg) → void
Parses the complete MIME text in mimeMsg and replaces the current object's headers, body, and multipart tree. A successful call always replaces the previous MIME.
loadMimeBd(CkBinData bindat) → void
Parses complete MIME bytes from bindat and replaces the current MIME on success. This is the preferred loader when the MIME can contain arbitrary 8-bit body bytes or embedded NUL bytes. Parsing tolerance and serialization normalization are the same as loadMime.
loadMimeFile(String fileName) → void
Reads and parses the complete MIME entity from the local file at fileName. A successful call replaces the current MIME. If the file cannot be opened, the method returns false and preserves the existing object unchanged.
loadMimeSb(CkStringBuilder sb) → void
Parses complete MIME text from sb and replaces the current MIME on success. Parsing tolerance and serialization normalization are the same as loadMime.
loadXml(String xml) → void
Reconstructs a MIME tree from Chilkat's MIME XML in xml. On success, the current object is replaced. If the XML is invalid, the method returns false and preserves the existing MIME unchanged.
loadXmlFile(String fileName) → void
Reads Chilkat MIME XML from the local file at fileName and reconstructs the MIME tree. On success, the current object is replaced. If the file cannot be opened or the XML is invalid, the method returns false and preserves the existing MIME unchanged. Header names are normalized to lowercase during reconstruction.
newMessageRfc822(CkMime mimeObject) → void
Clears the current object and initializes it as message/rfc822. Its body is a serialized copy of mimeObject at the time of the call. Later modifications to mimeObject do not change the embedded message.
newMultipartAlternative() → void
Initializes an empty multipart/alternative entity. Clears all existing headers, body content, and child parts. The new object contains only a multipart Content-Type with an automatically generated boundary, has zero parts, and does not automatically add MIME-Version.
newMultipartMixed() → void
Initializes an empty multipart/mixed entity. Clears all existing headers, body content, and child parts. The new object contains only a multipart Content-Type with an automatically generated boundary, has zero parts, and does not automatically add MIME-Version.
newMultipartRelated() → void
Initializes an empty multipart/related entity. Clears all existing headers, body content, and child parts. The new object contains only a multipart Content-Type with an automatically generated boundary, has zero parts, and does not automatically add MIME-Version.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
partAt(int index, CkMime subPart) → void
Provides live access to the direct child at zero-based index through subPart. Modifying subPart after a successful call modifies the child stored in the parent MIME tree.
partsToFiles(String path, CkStringTable st) → void
Recursively traverses the MIME tree and saves each part having a nonempty filename parameter to the existing directory in path. A name parameter alone is not used as a fallback. The disposition may be attachment or inline; a filename is what controls extraction.
removeHeaderField(String fieldName, bool bAllOccurrences) → void
Removes fields whose name matches fieldName case-insensitively. If bAllOccurrences is false, only the first matching occurrence is removed. If bAllOccurrences is true, all matching occurrences are removed. Remaining fields retain their relative order.
removePart(int index) → void
Removes the direct child at zero-based index. Valid indexes range from 0 through numParts - 1. An out-of-range index returns false and leaves the tree unchanged.
saveBody(String filename) → void
Writes the decoded body bytes of the current part to the local path in filename. Base64 and quoted-printable are decoded. MIME headers and multipart framing are not written.
saveMime(String filename) → void
Serializes the complete MIME entity and writes it to the local path in filename, including headers, body, multipart boundaries, and all descendants.
saveXml(String filename) → void
Writes Chilkat's MIME XML representation to the local path in filename. The file can be loaded by loadXmlFile.
setBody(String str) → void
Sets the current part's body from str while preserving existing content headers such as Content-Type, charset, and Content-Transfer-Encoding.
setBodyBd(CkBinData bd) → void
Sets the decoded body bytes from bd, changes Content-Transfer-Encoding to base64, and preserves the bytes exactly. It does not set a Content-Type, disposition, filename, or name; set those separately when needed.
setBodyFromEncoded(String encoding, String str) → void
Sets the body from transfer-encoded text. encoding must be base64 or quoted-printable; other values, including 7bit, 8bit, binary, an unknown name, or an empty string, cause failure.
setBodyFromFile(String fileName) → void
Reads the local file at fileName and replaces the current part's body and content headers according to the filename extension.
setBodyFromHtml(String str) → void
Sets str as HTML and changes the media type to text/html. For ASCII input, Chilkat uses Content-Transfer-Encoding: 7bit and does not add a charset. Existing unrelated headers are preserved.
setBodyFromPlainText(String str) → void
Sets str as plain text. For ASCII input, Chilkat sets Content-Type: text/plain; format=flowed and Content-Transfer-Encoding: 7bit without a charset. For non-ASCII UTF-8 input, it sets charset=utf-8 and uses 8bit. Existing unrelated headers are preserved.
setBodyFromXml(String str) → void
Sets str as XML, changes the media type to text/xml, and selects a transfer encoding appropriate for the text. For ASCII input, Chilkat uses 7bit and does not add a charset.
setHeaderField(String name, String value) → void
Sets one header field named by name. Matching is case-insensitive. All existing occurrences are removed and one replacement is inserted. If no field exists, a new one is added. Passing an empty value removes all matching occurrences rather than creating an empty-valued field.
setVerifyCert(CkCert cert) → void
Supplies cert as a signer-certificate fallback for subsequent signature verification. This is useful when the CMS/PKCS #7 signature does not embed the signer certificate and Chilkat cannot otherwise locate it. Only the public key is required.
toString() → String
A string representation of this object.
override
unwrapSecurity() → void
Removes supported S/MIME security layers and restores the underlying MIME content. It handles both common layer orders: a message signed and then encrypted, and a message encrypted and then signed. It continues through nested top-level layers until no additional supported security wrapper remains.
urlEncodeBody(String charset) → void
Replaces the current body with an application/x-www-form-urlencoded-style representation using the character set named by charset. Spaces become +, a literal plus becomes %2B, non-ASCII bytes become %HH sequences, and separators such as & and = remain unchanged.
useCertVault(CkXmlCertVault vault) → void
Sets vault as the certificate vault used to locate certificates and private keys for S/MIME encryption, decryption, signing, and verification. Only one vault is active; each call replaces the previously configured vault.
verify() → void
Verifies the current CMS/PKCS #7 signed MIME entity and removes the signature wrapper. Both detached multipart/signed messages and opaque CMS signed-data are supported. The method works with signed MIME loaded from serialized input as well as MIME signed by the current object.

Operators

operator ==(Object other) → bool
The equality operator.
inherited