3#ifndef PDFSDK_CORE_SECURITY_H_INCLUDED_
4#define PDFSDK_CORE_SECURITY_H_INCLUDED_
17typedef enum PDPermReqObj {
23 kPDPermReqObjBookmark,
24 kPDPermReqObjAttachment
27typedef enum PDPermReqOp {
34 kPDPermReqOpAccessible,
38 kPDPermReqOpPrintHigh,
42 kPDPermReqOpCopyForAccessibility,
43 kPDPermReqOpCreationOfTemplatePages,
44 kPDPermReqOpAllowDocAssembly
47typedef PDErrCode(PDFSDK_CALLCONV* PDCryptNewAuthDataProc)(
void* clientData,
void** pAuthData);
48typedef PDErrCode(PDFSDK_CALLCONV* PDCryptFreeAuthDataProc)(
void* authData);
50typedef PDErrCode(PDFSDK_CALLCONV* PDCryptNewSecurityDataProc)(
void* clientData,
52 void** pSecurityData);
53typedef PDErrCode(PDFSDK_CALLCONV* PDCryptCopySecurityDataProc)(
void* securityData,
54 void** pSecurityData);
55typedef PDErrCode(PDFSDK_CALLCONV* PDCryptFreeSecurityDataProc)(
void* securityData);
57typedef PDErrCode(PDFSDK_CALLCONV* PDCryptGetKeyDataProc)(
void* securityData,
65typedef PDErrCode(PDFSDK_CALLCONV* PDCryptEncryptProc)(
void* securityData,
76typedef PDErrCode(PDFSDK_CALLCONV* PDCryptAuthorizeProc)(
void* securityData,
78 PDPermReqOp operation,
82typedef PDErrCode(PDFSDK_CALLCONV* PDCryptFillEncryptDictProc)(
void* securityData,
86typedef PDErrCode(PDFSDK_CALLCONV* PDCryptEncryptMetadataProc)(
void* securityData,
bool* pEncrypt);
88typedef PDErrCode(PDFSDK_CALLCONV* PDCryptFreeClientDataProc)(
void* clientData);
91 PDCryptNewAuthDataProc newAuthData;
92 PDCryptFreeAuthDataProc freeAuthData;
93 PDCryptNewSecurityDataProc newSecurityData;
94 PDCryptCopySecurityDataProc copySecurityData;
95 PDCryptFreeSecurityDataProc freeSecurityData;
96 PDCryptGetKeyDataProc getCryptKey;
97 PDCryptEncryptProc encrypt;
98 PDCryptEncryptProc decrypt;
99 PDCryptFillEncryptDictProc fillEncryptDict;
100 PDCryptAuthorizeProc authorize;
101 PDCryptEncryptMetadataProc encryptMetadata;
102 PDCryptFreeClientDataProc freeClientData;
105typedef void* PDStdSecurityData;
108 kPDStdPermOpen = 0x01,
109 kPDStdPermSecure = 0x02,
110 kPDStdPermPrint = 0x04,
111 kPDStdPermEdit = 0x08,
112 kPDStdPermCopy = 0x10,
113 kPDStdPermEditNotes = 0x20,
114 kPDStdPermSaveAs = 0x40,
115 kPDStdPermExt = 0x80,
116 kPDStdPermFillAndSign = 0x100,
117 kPDStdPermAccessible = 0x200,
118 kPDStdPermDocAssembly = 0x400,
119 kPDStdPermHighPrint = 0x800,
120 kPDStdPermOwner = 0x8000,
121 kPDStdPermFormSubmit = 0x10000,
122 kPDStdPermFormSpawnTempl = 0x20000
124typedef uint32_t PDStdPerms;
126enum { kPDStdPasswordMaxChars = 255 };
127typedef wchar_t PDStdPassword[kPDStdPasswordMaxChars + 1];
158 bool hasOwnerPassword;
207 kPDStdSecurityModifyUserPassword = 0x01,
208 kPDStdSecurityModifyOwnerPassword = 0x02
210typedef uint32_t PDStdSecurityModifyFlags;
297PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocEncryptionIsModified(PDDoc doc,
bool* pValue);
299PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocPermRequest(PDDoc doc, PDPermReqObj permReqObj, PDPermReqOp permReqOp,
const void* authData,
bool* pGranted);
300PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocPermRequestSecurity(PDDoc doc, PDPermReqObj permReqObj, PDPermReqOp permReqOp,
const void* authData,
bool* pGranted);
301PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDDocPermRequestWithAuth(PDDoc doc, PDPermReqObj permReqObj, PDPermReqOp permReqOp,
bool* pGranted);
303PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDSecurityRegisterHandler(PDAtom filter,
const PDSecurityHandler* handler,
void* clientData);
304PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDSecurityNewAuthData(PDAtom filter,
void** pAuthData);
305PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDSecurityFreeAuthData(PDAtom filter,
void* authData);
307PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDStdSecurityDataNew(PDDoc doc, PDStdSecurityData* pSecurityData);
308PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDStdSecurityDataUpdateParams(PDStdSecurityData securityData,
309 PDStdSecurityModifyFlags modifyFlags,
312PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDStdSecurityDataFree(PDStdSecurityData securityData);
314PDF_CORE_API
PDErrCode PDFSDK_CALLCONV PDStdPasswordSetChars(PDStdPassword* authData,
const wchar_t* chars);
int32_t PDErrCode
Definition errors.h:44
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocGetSecurityHandlerName(PDDoc doc, PDAtom *pName)
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocGetSecurityHandlerData(PDDoc doc, void **pSecurityData)
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocGetNewSecurityHandlerName(PDDoc doc, PDAtom *pFilter)
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocSetNewSecurityHandler(PDDoc doc, PDAtom name, void *securityData)
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocGetNewSecurityHandlerData(PDDoc doc, void **pSecurityData)
Definition security.h:137
int version
Definition security.h:175
bool encryptMetadata
Definition security.h:196
bool encryptAttachmentsOnly
Definition security.h:202
PDStdPerms permissions
Definition security.h:163
PDAtom cryptMethod
Definition security.h:182
bool hasUserPassword
Definition security.h:147
int keyLength
Definition security.h:190
PDStdPassword ownerPassword
Definition security.h:152
PDStdPassword userPassword
Definition security.h:141
int revision
Definition security.h:168