Visual Basic Examples

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

VB Examples

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

More Examples...
Amazon S3
Email Object
DKIM / DomainKey
NTLM
DH Key Exchange
DSA
FileAccess
RSS
Atom
Self-Extractor
Service
Bzip2
PPMD
Deflate
LZW


VB Strings
VB Byte Array

 

 

 

 

 

 

 

OMA DRM - Read / Unpack DCF File

Download Chilkat Crypt ActiveX

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.