| 1 |
/* |
| 2 |
|
| 3 |
This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. |
| 4 |
|
| 5 |
Copyright (C) 2002-2020 by Jin-Hwan Cho and Shunsaku Hirata, |
| 6 |
the dvipdfmx project team. |
| 7 |
|
| 8 |
This program is free software; you can redistribute it and/or modify |
| 9 |
it under the terms of the GNU General Public License as published by |
| 10 |
the Free Software Foundation; either version 2 of the License, or |
| 11 |
(at your option) any later version. |
| 12 |
|
| 13 |
This program is distributed in the hope that it will be useful, |
| 14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 |
GNU General Public License for more details. |
| 17 |
|
| 18 |
You should have received a copy of the GNU General Public License |
| 19 |
along with this program; if not, write to the Free Software |
| 20 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
| 21 |
*/ |
| 22 |
|
| 23 |
#ifndef _PDFENCRYPT_H_ |
| 24 |
#define _PDFENCRYPT_H_ |
| 25 |
|
| 26 |
#include "pdfobj.h" |
| 27 |
#include "pdfdoc.h" |
| 28 |
|
| 29 |
#define MAX_PWD_LEN 127 |
| 30 |
|
| 31 |
typedef struct pdf_sec pdf_sec; |
| 32 |
extern pdf_sec *pdf_enc_init (const unsigned char *id, |
| 33 |
int keybits, uint32_t permission, |
| 34 |
const char *opasswd, const char *upasswd, |
| 35 |
int use_aes, int encrypt_metadata); |
| 36 |
extern void pdf_enc_close (pdf_sec **p_sec); |
| 37 |
|
| 38 |
extern void pdf_enc_set_label (pdf_sec *p_sec, unsigned label); |
| 39 |
extern void pdf_enc_set_generation (pdf_sec *p_sec, unsigned generation); |
| 40 |
extern void pdf_encrypt_data (pdf_sec *p_sec, const unsigned char *plain, size_t plain_len, |
| 41 |
unsigned char **cipher, size_t *cipher_len); |
| 42 |
extern pdf_obj *pdf_enc_get_encrypt_dict (pdf_sec *p_sec); |
| 43 |
extern pdf_obj *pdf_enc_get_extension_dict (pdf_sec *p_sec); |
| 44 |
|
| 45 |
#endif /* _PDFENCRYPT_H_ */ |