C# Examples

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

C# Examples

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


More Examples...
Amazon S3
NTLM
FileAccess
RSS
Atom
String
Byte Array
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

 

 

 

 

 

 

Verify Java Signature

Demonstrates how to verify a digital signature produced by Java.
The Java code that produces a digital signature that can be verified with
this Chilkat example is found at: http://www.cknotes.com/?p=283

Download Chilkat .NET for 4.0 Framework

Download Chilkat .NET for 64-bit 4.0 Framework (x64)

Download Chilkat .NET for 2.0 / 3.5 Framework

Download Chilkat .NET for 64-bit 2.0 / 3.5 Framework (x64)

Download Chilkat .NET for 1.0 / 1.1 Framework

Chilkat.PublicKey pubKey = new Chilkat.PublicKey();

bool success;

//  Load an RSA public key from an ASN.1 DER file
success = pubKey.LoadRsaDerFile("pubKey.der");

if (success != true) {
    textBox1.Text += pubKey.LastErrorText + "\r\n";
    return;
}

string pkeyXml;
//  Get the public key in XML format:
pkeyXml = pubKey.GetXml();

Chilkat.Rsa rsa = new Chilkat.Rsa();

//  Any string argument automatically begins the 30-day trial.

success = rsa.UnlockComponent("30-day trial");
if (success != true) {
    textBox1.Text += rsa.LastErrorText + "\r\n";
    return;
}

//  Import the public key into the RSA component:
success = rsa.ImportPublicKey(pkeyXml);
if (success != true) {
    textBox1.Text += rsa.LastErrorText + "\r\n";
    return;
}

rsa.EncodingMode = "base64";

string strData;
strData = "The quick brown fox jumps over the lazy dog";

//  IMPORTANT:  This Base64 signature will have to be updated
//  with the digital signature produced by the Java code at:
//  http://www.cknotes.com/?p=283
string base64Sig;
base64Sig = "VGV5A+bodHBpBwwJZdf17Bv+lkBTm/gteOf8iCgEEfNzBosZLaAB8X55BIZIkE2zKRXoMcJT+iCxsj+1hnlwJeKZ+Gya58lrHw6NWm2N0O/KyfnuEzADOM86X0xrkgdFT6SYpbZ9dWPC59NiHeEdVyjOXNJ3fBpUSQ5/5pvVWm0=";

//  Verify the signature produced by the Java code at:
//  http://www.cknotes.com/?p=283
//  The VerifyStringENC method hashes the input data and verifies
//  the hash against the signature.
success = rsa.VerifyStringENC(strData,"sha-1",base64Sig);
//  Is the signature verified?
if (success == true) {
    textBox1.Text += "Signature Verified!" + "\r\n";
}
else {
    textBox1.Text += "Signature not verified!" + "\r\n";
}


 

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

Email Component · XML Parser