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 / Unpack DCF File
Visual Basic 6.0 example showing how to read and unpack/decrypt an Open Mobile Alliance DCF file. Dim crypt As New ChilkatCrypt2 Dim omaDrm As New ChilkatOmaDrm ' A Chilkat Crypt unlock code will work here. omaDrm.UnlockComponent "Anything for 30-day trial" ' Load an OMA DRM file. omaDrm.LoadDcfFile "out.dcf" ' Display some header information... Text1.Text = "" Text1.Text = Text1.Text + omaDrm.ContentType + vbCrLf Text1.Text = Text1.Text + omaDrm.ContentUri + vbCrLf Text1.Text = Text1.Text + omaDrm.Headers + vbCrLf ' Get a specific header MsgBox "Content-Description = " + omaDrm.GetHeaderField("content-description") ' Get the AES initialization vector Dim iv As Variant iv = omaDrm.iv ' Display the IV in hex format. MsgBox "IV: " + crypt.Encode(iv, "hex") ' Display 1st 20 bytes of encrypted data in hex format MsgBox "Encrypted Data: " + Left$(crypt.Encode(omaDrm.encryptedData, "hex"), 20) ' To decrypt, set the Base64 key and decrypt... omaDrm.Base64Key = "BiVVJOQee6y4PWYL+fbvJA==" ' Display 1st 20 bytes of the decrypted data in hex format MsgBox "Decrypted Data: " + Left$(crypt.Encode(omaDrm.decryptedData, "hex"), 20) ' Save the decrypted data to a file. success = omaDrm.SaveDecrypted("orval2_out.gif") If (success = 0) Then MsgBox omaDrm.LastErrorText End If
|
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.