CryptoMessage Object
Overview
Member List
Properties
Methods
Adds a recipient certificate to the message when this CryptoMessage object is to be used for sending encrypted mail or generating PKCS#7 envelopes. This method can be called as many times as there are message recipients.
Usage:
Msg.AddRecipientCert CertRelated Section: 5.2 CryptoMessage Object.
Decrypts a specified PKCS#7 envelope using the specified private key context name. The latter can be obtained via Cert.PrivateKeyContext.ContainerName. If Context is an empty string, all certificate contexts in the MY store will be tried until a match is found. If there is no match, an error will be thrown.
Returns value: a decrypted string of text.
Usage:
EncrText = Msg.DecryptText(EncrText, "")Related Section: 9.2 Encrypting & Decrypting Text Directly with Certificates.
Encrypts a specified text string with one or more certificates specified by AddRecipientCert.
Returns value: a Base64-encoded PKCS#7 envelope (encrypted message).
Usage:
EncrText = Msg.EncryptText("secret")Related Section: 9.2 Encrypting & Decrypting Text Directly with Certificates.
Sets the signer certificate for the message when this CryptoMessage object is to be used for sending signed mail or generating detached PKCS#7 signatures
Usage:
Msg.SetSignerCert CertRelated Section: 5.4 Signed Email
Computes the detached PKCS#7 signature of the specified file using a certificate specified by SetSignerCert. Signatures are based on the SHA hash function.
Returns value: a Base64-encoded PKCS#7 signature blob.
Usage:
Signature = Msg.SignFile("c:\path\myfile.ext")Related Section: 9.4 Generating and Verifying Detached PKCS#7 Signatures.
Computes the detached PKCS#7 signature of the specified SHA1 value using a certificate specified by SetSignerCert. Currently, only 20-byte values are supported as the input. Introduced in Version 2.9 to implement the client-side signing of server-side data.
Returns value: a CryptoBlob object populated with the PKCS#7 signature data.
Usage:
Set SigBlob = Msg.SignHash(HashBlob)Related Section: 9.4.3 Client-Side Signing of Server-Side Data.
Computes the detached PKCS#7 signature of the specified text string using a certificate specified by SetSignerCert. Signatures are based on the SHA hash function.
Returns value: a Base64-encoded PKCS#7 signature blob.
Usage:
Signature = Msg.SignText("some text")Related Section: 9.4 Generating and Verifying Detached PKCS#7 Signatures.
Verifies a detached PKCS#7 signature specified by Signature against a hash value contained in Hash and a public key contained in Cert.
Returns value: True if the signature is verified, or False otherwise.
Usage:
Set Cert = CM.ImportCertFromFile("c:\mycert.cer")
Set Hash = Context.CreateHash ' SHA by default
Hash.AddText "secret"
SignatureValid = Msg.VerifySignature(Signature, Hash, Cert)Related Section: 9.4 Generating and Verifying Detached PKCS#7 Signatures.