CkOmaDrm C++ Class Reference (Visual C++)

CkOmaDrm

Chilkat OMA DRM is a software component providing the ability to read and write Open Mobile Alliance (OMA) Digital Rights Management (DRM) content format files. Specifically, the Chilkat OMA DRM SDK (or toolkit) can parse and/or create DRM Content Format v1.0 files (i.e. encrypted media object files with the .dcf file extension.) The Chilkat OMA DRM library is included as part of the Chilkat Crypt toolkit license.

Properties

void get_Base64Key(CkString &str);

The 16-byte secret key for encryption/decryption in Base64 encoded form.

void get_ContentType(CkString &str);

The MIME media type of the DRM protected content.

void get_ContentUri(CkString &str);

The unique URI for the DRM protected content.

void get_DecryptedData(CkByteData &data);

Decrypts and returns the DRM protected content. The secret key must be set correctly beforehand. The the secret key is incorrect, gibberish is returned.

int get_DrmContentVersion(void);

The version of the DRM content format specification used to produce this content object.

void get_EncryptedData(CkByteData &data);

This property provides access to the encrypted data contained within the DRM content.

void get_Headers(CkString &str);

Header fields separated by CRLF line endings containing additional meta data about the DRM content.

void get_IV(CkByteData &data);

The initialization vector to be used when encrypting the DRM protected content.

void LastErrorHtml(CkString &str);

Error information in HTML format for the last method called.

void LastErrorText(CkString &str);

Error information in plain-text format for the last method called.

void LastErrorXml(CkString &str);

Error information in XML format for the last method called.

bool get_Utf8(void) const;
void put_Utf8(bool b);

When set to true, all "const char *" arguments are expected to be utf-8 strings. If set to false, the "const char *" arguments are expected to be ANSI strings.

Methods

bool CreateDcfFile(const char * filename);

Writes a .dcf file using the property settings and data contained within the calling object.

bool GetHeaderField(const char * fieldName, CkString & fieldVal);

Returns a header field value by field name.

Returns true for success, false for failure.

bool LoadDcfData(const CkByteData & data);

Loads a .dcf file from in-memory data.

bool LoadDcfFile(const char * filename);

Loads a .dcf file into the calling object. Once loaded, the headers and data can be accessed via the OMA DRM object's properties and methods.

void LoadUnencryptedData(const CkByteData & data);

Loads data into the OMA DRM object. This is the data that will be written to the .dcf file when the CreateDcfFile method is called

bool LoadUnencryptedFile(const char * filename);

Loads file data into the OMA DRM object. This is the data that will be written to the .dcf file when the CreateDcfFile method is called

bool SaveDecrypted(const char * filename);

Decrypts the data contained within the OMA DRM object and saves the result to an output file.

bool SaveLastError(const char * filename);

Saves the last error information to an XML formatted file.

void SetEncodedIV(const char * encodedIv, const char * encoding);

Sets the initialization vector via an encoded string. The encoding may be "base64", "hex", "url", or "quoted-printable".

bool UnlockComponent(const char * unlockCode);

Unlocks the OMA DRM component at runtime. This must be called once at the beginning of your application. Passing an arbitrary value initiates a fully-functional 30-day trial. A permanent unlock code is required to use the component beyond 30 days. Because the OMA DRM component is included with the Chilkat Crypt license, any valid Chilkat Crypt unlock code will also unlock this component.

const char * base64Key();

The 16-byte secret key for encryption/decryption in Base64 encoded form.

const char * contentType();

The MIME media type of the DRM protected content.

const char * contentUri();

The unique URI for the DRM protected content.

const char * getHeaderField(const char * fieldName);

Returns a header field value by field name.

const char * headers();

Header fields separated by CRLF line endings containing additional meta data about the DRM content.

const char * lastErrorHtml();

Error information in HTML format for the last method called.

const char * lastErrorText();

Error information in plain-text format for the last method called.

const char * lastErrorXml();

Error information in XML format for the last method called.

void set_Base64Key(const char * key);

Sets the base64-encoded secret key to be used in encrypting and decrypting the rights-managed data. (128-bit AES encryption is used, so the key should represent 16-bytes of data.)

void set_ContentType(const char * contentType);

The content type of the DRM content.

void set_ContentUri(const char * contentUri);

The content URI for the DRM protected content object.

void set_Headers(const char * headers);

Header fields separated by CRLF line endings containing additional meta data about the DRM content.

void set_IV(const CkByteData & data);

The initialization vector to be used when encrypting the DRM protected content.