MuPDF X.Y.Z

pdf/crypt.h

Index

enum

function

Crypt

enum pdf_encrypt_algorithm

enum pdf_encrypt_algorithm
{
        PDF_ENCRYPT_KEEP,
        PDF_ENCRYPT_NONE,
        PDF_ENCRYPT_RC4_40,
        PDF_ENCRYPT_RC4_128,
        PDF_ENCRYPT_AES_128,
        PDF_ENCRYPT_AES_256,
        PDF_ENCRYPT_UNKNOWN
}

function pdf_new_crypt

pdf_crypt *
pdf_new_crypt (
        fz_context *ctx,
        pdf_obj *enc,
        pdf_obj *id
)

Create crypt object for decrypting strings and streams given the Encryption and ID objects.

function pdf_new_encrypt

pdf_crypt *
pdf_new_encrypt (
        fz_context *ctx,
        const char *opwd_utf8,
        const char *upwd_utf8,
        pdf_obj *id,
        int permissions,
        int algorithm
)

function pdf_drop_crypt

void
pdf_drop_crypt (
        fz_context *ctx,
        pdf_crypt *crypt
)

function pdf_crypt_obj

void
pdf_crypt_obj (
        fz_context *ctx,
        pdf_crypt *crypt,
        pdf_obj *obj,
        int num,
        int gen
)

function pdf_open_crypt

fz_stream *
pdf_open_crypt (
        fz_context *ctx,
        fz_stream *chain,
        pdf_crypt *crypt,
        int num,
        int gen
)

function pdf_open_crypt_with_filter

fz_stream *
pdf_open_crypt_with_filter (
        fz_context *ctx,
        fz_stream *chain,
        pdf_crypt *crypt,
        pdf_obj *name,
        int num,
        int gen
)

function pdf_crypt_version

int
pdf_crypt_version (
        fz_context *ctx,
        pdf_crypt *crypt
)

function pdf_crypt_revision

int
pdf_crypt_revision (
        fz_context *ctx,
        pdf_crypt *crypt
)

function pdf_crypt_method

const char *
pdf_crypt_method (
        fz_context *ctx,
        pdf_crypt *crypt
)

function pdf_crypt_string_method

const char *
pdf_crypt_string_method (
        fz_context *ctx,
        pdf_crypt *crypt
)

function pdf_crypt_stream_method

const char *
pdf_crypt_stream_method (
        fz_context *ctx,
        pdf_crypt *crypt
)

function pdf_crypt_length

int
pdf_crypt_length (
        fz_context *ctx,
        pdf_crypt *crypt
)

function pdf_crypt_permissions

int
pdf_crypt_permissions (
        fz_context *ctx,
        pdf_crypt *crypt
)

function pdf_crypt_encrypt_metadata

int
pdf_crypt_encrypt_metadata (
        fz_context *ctx,
        pdf_crypt *crypt
)

function pdf_crypt_owner_password

unsigned char *
pdf_crypt_owner_password (
        fz_context *ctx,
        pdf_crypt *crypt
)

function pdf_crypt_user_password

unsigned char *
pdf_crypt_user_password (
        fz_context *ctx,
        pdf_crypt *crypt
)

function pdf_crypt_owner_encryption

unsigned char *
pdf_crypt_owner_encryption (
        fz_context *ctx,
        pdf_crypt *crypt
)

function pdf_crypt_user_encryption

unsigned char *
pdf_crypt_user_encryption (
        fz_context *ctx,
        pdf_crypt *crypt
)

function pdf_crypt_permissions_encryption

unsigned char *
pdf_crypt_permissions_encryption (
        fz_context *ctx,
        pdf_crypt *crypt
)

function pdf_crypt_key

unsigned char *
pdf_crypt_key (
        fz_context *ctx,
        pdf_crypt *crypt
)

function pdf_print_crypt

void
pdf_print_crypt (
        fz_context *ctx,
        fz_output *out,
        pdf_crypt *crypt
)

function pdf_write_digest

void
pdf_write_digest (
        fz_context *ctx,
        fz_output *out,
        pdf_obj *byte_range,
        pdf_obj *field,
        size_t digest_offset,
        size_t digest_length,
        pdf_pkcs7_signer *signer
)

enum pdf_permissions

enum pdf_permissions
{
        PDF_PERM_PRINT = 1 << 2,
        PDF_PERM_MODIFY = 1 << 3,
        PDF_PERM_COPY = 1 << 4,
        PDF_PERM_ANNOTATE = 1 << 5,
        PDF_PERM_FORM = 1 << 8,
        PDF_PERM_ACCESSIBILITY = 1 << 9, /* deprecated in pdf 2.0 (this permission is always granted) */
        PDF_PERM_ASSEMBLE = 1 << 10,
        PDF_PERM_PRINT_HQ = 1 << 11,
}

User access permissions from PDF reference.

function pdf_document_permissions

int
pdf_document_permissions (
        fz_context *ctx,
        pdf_document *doc
)

function pdf_signature_byte_range

int
pdf_signature_byte_range (
        fz_context *ctx,
        pdf_document *doc,
        pdf_obj *signature,
        fz_range *byte_range
)

function pdf_signature_hash_bytes

fz_stream *
pdf_signature_hash_bytes (
        fz_context *ctx,
        pdf_document *doc,
        pdf_obj *signature
)

retrieve an fz_stream to read the bytes hashed for the signature

function pdf_signature_incremental_change_since_signing

int
pdf_signature_incremental_change_since_signing (
        fz_context *ctx,
        pdf_document *doc,
        pdf_obj *signature
)

function pdf_incremental_change_since_signing_widget

int
pdf_incremental_change_since_signing_widget (
        fz_context *ctx,
        pdf_annot *widget
)

function pdf_signature_contents

size_t
pdf_signature_contents (
        fz_context *ctx,
        pdf_document *doc,
        pdf_obj *signature,
        char **contents
)

Retrieve the contents of a signature as a counted allocated block that must be freed by the caller.

function pdf_encrypt_data

void pdf_encrypt_data(fz_context *ctx, pdf_crypt *crypt, int num, int gen, void (*fmt_str_out)(fz_context *, void *, const unsigned char *, size_t), void *arg, const unsigned char *s, size_t n)

function pdf_encrypted_len

size_t
pdf_encrypted_len (
        fz_context *ctx,
        pdf_crypt *crypt,
        int num,
        int gen,
        size_t len
)