Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
OMA DRM: Read DCFDownload: 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 |
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.