Delphi Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

Delphi Examples

Bounced Mail
Bz2
Character Encoding
CSV
DKIM / DomainKey
Digital Certificates
Digital Signatures
DH Key Exchange
DSA
Email
Email Object
FTP
HTML Conversion
HTTP
IMAP
Encryption
MHT / HTML Email
NTLM
POP3
RSA
S/MIME
SMTP
Socket
Spider
SFTP
SSH
SSH Key
SSH Tunnel
String
Tar
Upload
XML
XMP
Zip Compression

More Examples...
Amazon S3
Byte Array
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
Bzip2
LZW

Type Conversion

 

Article: Understanding COM References in Delphi

Verify and Unwrap PCKS7 Signed MIME

Demonstrates calling the Verify method to verify and unwrap PKCS7 signed MIME. 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.

Download Chilkat MIME ActiveX

uses
    Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
    Dialogs, StdCtrls,
    CHILKATMIMELib_TLB,
    OleCtrls;

...

procedure TForm1.Button1Click(Sender: TObject);
var
mime: CHILKATMIMELib_TLB.IChilkatMime;
success: Integer;
verified: Integer;

begin
mime := CoChilkatMime.Create();

success := mime.UnlockComponent('Anything for 30-day trial');
if (success = 0) then
  begin
    Memo1.Lines.Add(mime.LastErrorText);
    Exit;
  end;

//  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.

//  Load the signed MIME from a file...
success := mime.LoadMimeFile('signedMime.txt');
if (success = 0) then
  begin
    Memo1.Lines.Add(mime.LastErrorText);
    Exit;
  end;

//  Verify the signed MIME and restore the MIME
//  to the structure/content it had prior to signing.

verified := mime.Verify();
if (verified = 0) then
  begin
    Memo1.Lines.Add(mime.LastErrorText);
    Exit;
  end;

//  Examine the MIME after signature verification (i.e. "unwrapping")
Memo1.Lines.Add(mime.GetMime());


end;

 

© 2000-2010 Chilkat Software, Inc. All Rights Reserved.

Mail Component · .NET Email Component · XML Parser