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

Duplicate openssl dgst -md5 -sign myKey.pem something.txt | openssl enc -base64 -A

Demonstrates how to duplicate the creation of an RSA signature produced by this OpenSSL command:

openssl dgst -md5 -sign myKey.pem something.txt | openssl enc -base64 -A

Download 32-bit Chilkat RSA ActiveX (.msi)

Download All 32-bit Chilkat ActiveX Components (.zip)

Download All 64-bit Chilkat ActiveX Components (.zip)

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

...

procedure TForm1.Button1Click(Sender: TObject);
var
pkey: CHILKATCERTIFICATELib_TLB.IPrivateKey;
success: Integer;
pkeyXml: String;
rsa: TChilkatRsa;
strData: String;
base64Sig: String;

begin
pkey := TprivateKey.Create(Self).ControlInterface;

//  Load the private key from an RSA PEM file:
pkey.LoadPemFile('myKey.pem');

//  Get the private key in XML format:
pkeyXml := pkey.GetXml();

rsa := TChilkatRsa.Create(Self);

//  Any string argument automatically begins the 30-day trial.
success := rsa.UnlockComponent('30-day trial');
if (success <> 1) then
  begin
    Memo1.Lines.Add(rsa.LastErrorText);
    Exit;
  end;

//  Import the private key into the RSA component:
success := rsa.ImportPrivateKey(pkeyXml);
if (success <> 1) then
  begin
    Memo1.Lines.Add(rsa.LastErrorText);
    Exit;
  end;

//  OpenSSL uses BigEndian byte ordering:
rsa.LittleEndian := 0;

//  The resulting signature will be a Base64 string:
rsa.EncodingMode := 'base64';

//  For simplicity, we're not loading
//  the data to be signed from a file.  We are instead simply
//  using a literal string value.
strData := 'This is the text to be signed.';

//  Hash the input using MD5, and then sign the hash:
//  Other valid hash algorithm choices are "md2" and "sha-1".
base64Sig := rsa.SignStringENC(strData,'md5');

Memo1.Lines.Add(base64Sig);

ShowMessage('Success!');

end;

 

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

Mail Component · .NET Email Component · XML Parser