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

 

 

 

 

 

 

OMA DRM: Read DCF

Download: Chilkat .NET Assemblies

Demonstrates how to open a .dcf file, read headers, decrypt and extract the protected content.

// A Chilkat Crypt unlock code will work here.
Chilkat.OmaDrm omaDrm = new Chilkat.OmaDrm();
omaDrm.UnlockComponent("Anything for 30-day trial");

Chilkat.Crypt2 crypt = new Chilkat.Crypt2();

// Load an OMA DRM file.
omaDrm.LoadDcfFile("orval2.dcf");

string msg = omaDrm.ContentType + "\r\n" + 
	omaDrm.ContentUri + "\r\n" +
	omaDrm.Headers;

MessageBox.Show(msg);

// Get a specific header
MessageBox.Show("Content-Description = " + omaDrm.GetHeaderField("content-description"));

// Get the AES initialization vector
// Display the IV in hex format.
MessageBox.Show("IV: " + crypt.Encode(omaDrm.IV, "hex"));

// Display 1st 20 bytes of encrypted data in hex format
MessageBox.Show("Encrypted Data: " + crypt.Encode(omaDrm.EncryptedData, "hex").Substring(0,20));

// To decrypt, set the Base64 key and decrypt...
omaDrm.Base64Key = "BiVVJOQee6y4PWYL+fbvJA==";

// Display 1st 20 bytes of the decrypted data in hex format
MessageBox.Show("Decrypted Data: " + crypt.Encode(omaDrm.DecryptedData,"hex").Substring(0,20));

// Save the decrypted data to a file.
bool success = omaDrm.SaveDecrypted("out.gif");
if (!success)
    {
    MessageBox.Show(omaDrm.LastErrorText);
    }


Important: The download for this example does not contain the ChilkatDotNet.dll which
must be downloaded and installed separately at http://www.chilkatsoft.com/downloads.asp.
Once installed, add a reference to the DLL in the project by following the instructions at
http://www.example-code.com/vbdotnet/step2.asp

 

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

Email Component · XML Parser