#include "config.h"
#include "mobi.h"
Go to the source code of this file.
|
void | mobi_free_drm (MOBIData *m) |
| Free DRM structure. More...
|
|
MOBI_RET | mobi_buffer_decrypt (unsigned char *out, const unsigned char *in, const size_t length, const MOBIData *m) |
| Decrypt buffer with PK1 algorithm. More...
|
|
MOBI_RET | mobi_drmkey_set (MOBIData *m, const char *pid) |
| Store key for encryption in MOBIData stucture. More...
|
|
MOBI_RET | mobi_drmkey_set_serial (MOBIData *m, const char *serial) |
| Store key for encryption in MOBIData stucture. Pid will be calculated from device serial number. More...
|
|
MOBI_RET | mobi_drmkey_delete (MOBIData *m) |
| Remove key from MOBIData structure. More...
|
|
MOBI_RET | mobi_voucher_add (MOBIData *m, const char *serial, const time_t valid_from, const time_t valid_to, const MOBIExthTag *tamperkeys, const size_t tamperkeys_count) |
| Add DRM voucher. More...
|
|
MOBI_RET | mobi_drm_serialize_v1 (MOBIBuffer *buf, const MOBIData *m) |
| Serialize encryption scheme version 1. More...
|
|
MOBI_RET | mobi_drm_serialize_v2 (MOBIBuffer *buf, const MOBIData *m) |
| Serialize encryption scheme version 2. More...
|
|
Copyright (c) 2014 Bartek Fabiszewski http://www.fabiszewski.net
This file is part of libmobi. Licensed under LGPL, either version 3, or any later. See http://www.gnu.org/licenses/
◆ mobi_buffer_decrypt()
MOBI_RET mobi_buffer_decrypt |
( |
unsigned char * |
out, |
|
|
const unsigned char * |
in, |
|
|
const size_t |
length, |
|
|
const MOBIData * |
m |
|
) |
| |
Decrypt buffer with PK1 algorithm.
- Parameters
-
[in,out] | out | Decrypted buffer |
[in] | in | Encrypted buffer |
[in] | length | Buffer length |
[in] | m | MOBIData structure with loaded key |
- Returns
- MOBI_RET status code (on success MOBI_SUCCESS)
◆ mobi_drm_serialize_v1()
Serialize encryption scheme version 1.
- Parameters
-
[in,out] | buf | Output buffer |
[in] | m | MOBIData structure with raw data and metadata |
- Returns
- MOBI_RET status code (on success MOBI_SUCCESS)
◆ mobi_drm_serialize_v2()
Serialize encryption scheme version 2.
- Parameters
-
[in,out] | buf | Output buffer |
[in] | m | MOBIData structure with raw data and metadata |
- Returns
- MOBI_RET status code (on success MOBI_SUCCESS)
◆ mobi_drmkey_delete()
Remove key from MOBIData structure.
- Parameters
-
[in,out] | m | MOBIData structure with raw data and metadata |
- Returns
- MOBI_RET status code (on success MOBI_SUCCESS)
◆ mobi_drmkey_set()
Store key for encryption in MOBIData stucture.
In case of encrypted document key is extracted from document. PID may be needed.
- Parameters
-
[in,out] | m | MOBIData structure with raw data and metadata |
[in] | pid | PID, may be NULL in case of encryption type 1, which does not use PID |
- Returns
- MOBI_RET status code (on success MOBI_SUCCESS)
◆ mobi_drmkey_set_serial()
Store key for encryption in MOBIData stucture. Pid will be calculated from device serial number.
- Parameters
-
[in,out] | m | MOBIData structure with raw data and metadata |
[in] | serial | Serial |
- Returns
- MOBI_RET status code (on success MOBI_SUCCESS)
◆ mobi_free_drm()
Free DRM structure.
- Parameters
-
[in,out] | m | MOBIData structure with raw data and metadata |
◆ mobi_voucher_add()
MOBI_RET mobi_voucher_add |
( |
MOBIData * |
m, |
|
|
const char * |
serial, |
|
|
const time_t |
valid_from, |
|
|
const time_t |
valid_to, |
|
|
const MOBIExthTag * |
tamperkeys, |
|
|
const size_t |
tamperkeys_count |
|
) |
| |
Add DRM voucher.
- See also
- mobi_drm_addvoucher
- Parameters
-
[in,out] | m | MOBIData structure with raw data and metadata |
[in] | serial | Device serial number |
[in] | valid_from | Voucher validity start time, -1 if not set |
[in] | valid_to | Voucher expire time, -1 if not set |
[in] | tamperkeys | Array of EXTH tags to include in PID generation, NULL if none |
[in] | tamperkeys_count | Count of EXTH tags |
- Returns
- MOBI_RET status code (on success MOBI_SUCCESS)