PDF SDK Documentation

Comprehensive Guide for Developers: Features, Integration, and API Reference

Loading...
Searching...
No Matches
security.h File Reference

Security API. More...

Go to the source code of this file.

Classes

struct  PDSecurityHandler
 
struct  PDStdSecurityParams
 

Typedefs

typedef enum PDPermReqObj PDPermReqObj
 
typedef enum PDPermReqOp PDPermReqOp
 
typedef PDErrCode(PDFSDK_CALLCONV * PDCryptNewAuthDataProc) (void *clientData, void **pAuthData)
 
typedef PDErrCode(PDFSDK_CALLCONV * PDCryptFreeAuthDataProc) (void *authData)
 
typedef PDErrCode(PDFSDK_CALLCONV * PDCryptNewSecurityDataProc) (void *clientData, PDObject encryptDict, void **pSecurityData)
 
typedef PDErrCode(PDFSDK_CALLCONV * PDCryptCopySecurityDataProc) (void *securityData, void **pSecurityData)
 
typedef PDErrCode(PDFSDK_CALLCONV * PDCryptFreeSecurityDataProc) (void *securityData)
 
typedef PDErrCode(PDFSDK_CALLCONV * PDCryptGetKeyDataProc) (void *securityData, PDAtom cryptFilter, PDObject decodeParms, void *buffer, size_t bufsize, size_t *pSize, PDAtom *pMethod)
 
typedef PDErrCode(PDFSDK_CALLCONV * PDCryptEncryptProc) (void *securityData, const void *input, size_t inputSize, void *output, size_t outputSize, uint32_t objnum, uint16_t generation, PDAtom cryptFilter, PDObject decodeParms, size_t *pOutputSize)
 
typedef PDErrCode(PDFSDK_CALLCONV * PDCryptAuthorizeProc) (void *securityData, PDPermReqObj object, PDPermReqOp operation, const void *authData, bool *pGranted)
 
typedef PDErrCode(PDFSDK_CALLCONV * PDCryptFillEncryptDictProc) (void *securityData, PDDoc doc, PDObject encryptDict)
 
typedef PDErrCode(PDFSDK_CALLCONV * PDCryptEncryptMetadataProc) (void *securityData, bool *pEncrypt)
 
typedef PDErrCode(PDFSDK_CALLCONV * PDCryptFreeClientDataProc) (void *clientData)
 
typedef struct PDSecurityHandler PDSecurityHandler
 
typedef void * PDStdSecurityData
 
typedef uint32_t PDStdPerms
 
typedef wchar_t PDStdPassword[kPDStdPasswordMaxChars+1]
 
typedef uint32_t PDStdSecurityModifyFlags
 

Enumerations

enum  PDPermReqObj {
  kPDPermReqObjDoc , kPDPermReqObjPage , kPDPermReqObjContent , kPDPermReqObjAnnot ,
  kPDPermReqObjForm , kPDPermReqObjBookmark , kPDPermReqObjAttachment
}
 
enum  PDPermReqOp {
  kPDPermReqOpInsert , kPDPermReqOpDelete , kPDPermReqOpMove , kPDPermReqOpRotate ,
  kPDPermReqOpModify , kPDPermReqOpExtract , kPDPermReqOpAccessible , kPDPermReqOpOpen ,
  kPDPermReqOpSecure , kPDPermReqOpPrint , kPDPermReqOpPrintHigh , kPDPermReqOpFillIn ,
  kPDPermReqOpFullSave , kPDPermReqOpCopy , kPDPermReqOpCopyForAccessibility , kPDPermReqOpCreationOfTemplatePages ,
  kPDPermReqOpAllowDocAssembly
}
 
enum  {
  kPDStdPermOpen = 0x01 , kPDStdPermSecure = 0x02 , kPDStdPermPrint = 0x04 , kPDStdPermEdit = 0x08 ,
  kPDStdPermCopy = 0x10 , kPDStdPermEditNotes = 0x20 , kPDStdPermSaveAs = 0x40 , kPDStdPermExt = 0x80 ,
  kPDStdPermFillAndSign = 0x100 , kPDStdPermAccessible = 0x200 , kPDStdPermDocAssembly = 0x400 , kPDStdPermHighPrint = 0x800 ,
  kPDStdPermOwner = 0x8000 , kPDStdPermFormSubmit = 0x10000 , kPDStdPermFormSpawnTempl = 0x20000
}
 
enum  { kPDStdPasswordMaxChars = 255 }
 
enum  { kPDStdSecurityModifyUserPassword = 0x01 , kPDStdSecurityModifyOwnerPassword = 0x02 }
 

Functions

PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocSetNewSecurityHandler (PDDoc doc, PDAtom name, void *securityData)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocGetSecurityHandlerData (PDDoc doc, void **pSecurityData)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocGetSecurityHandlerName (PDDoc doc, PDAtom *pName)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocGetNewSecurityHandlerData (PDDoc doc, void **pSecurityData)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocGetNewSecurityHandlerName (PDDoc doc, PDAtom *pFilter)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocEncryptionIsModified (PDDoc doc, bool *pValue)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocPermRequest (PDDoc doc, PDPermReqObj permReqObj, PDPermReqOp permReqOp, const void *authData, bool *pGranted)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocPermRequestSecurity (PDDoc doc, PDPermReqObj permReqObj, PDPermReqOp permReqOp, const void *authData, bool *pGranted)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocPermRequestWithAuth (PDDoc doc, PDPermReqObj permReqObj, PDPermReqOp permReqOp, bool *pGranted)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDSecurityRegisterHandler (PDAtom filter, const PDSecurityHandler *handler, void *clientData)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDSecurityNewAuthData (PDAtom filter, void **pAuthData)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDSecurityFreeAuthData (PDAtom filter, void *authData)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDStdSecurityDataNew (PDDoc doc, PDStdSecurityData *pSecurityData)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDStdSecurityDataUpdateParams (PDStdSecurityData securityData, PDStdSecurityModifyFlags modifyFlags, const PDStdSecurityParams *params)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDStdSecurityDataGetParams (PDStdSecurityData securityData, PDStdSecurityParams *pParams)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDStdSecurityDataFree (PDStdSecurityData securityData)
 
PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDStdPasswordSetChars (PDStdPassword *authData, const wchar_t *chars)
 

Detailed Description

Security API.

Function Documentation

◆ PDDocGetNewSecurityHandlerData()

PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocGetNewSecurityHandlerData ( PDDoc doc,
void ** pSecurityData )

Gets the security data structure for the specified document's new security handler. Use PDDocGetSecurityData() to get the security data structure for the document's current security handler. The new security handler is used to encrypt the document during a save. Handler's copySecurityData is used to create the returned pointer

Parameters
docThe document whose new security data structure is obtained.
securityHandlerDataA pointer to the security data structure.
See also
PDDocGetSecurityData
PDDocSetNewSecurityHandler
PDDocGetSecurityHandlerName
PDDocGetNewSecurityHandlerName
PDDocPermRequest

◆ PDDocGetNewSecurityHandlerName()

PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocGetNewSecurityHandlerName ( PDDoc doc,
PDAtom * pFilter )

Gets the name of the new security handler.

"Standard" is the name of the default password protection handler

See also
PDDocGetSecurityData
PDDocGetNewSecurityData
PDDocSetNewSecurityHandler
PDDocPermRequest

◆ PDDocGetSecurityHandlerData()

PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocGetSecurityHandlerData ( PDDoc doc,
void ** pSecurityData )

Gets the security data structure for the specified document's current security handler. Use PDDocGetNewSecurityData() to get the security data structure for the document's new security handler. The current security handler is the security handler that is used to decrypt the current document and encrypt the document during a save if a new security handler is not set. Handler's copySecurityData is used to create the returned pointer

Parameters
docThe document whose new security data structure is obtained.
securityHandlerDataA pointer to the security data structure.
See also
PDDocGetSecurityData
PDDocSetNewSecurityHandler
PDDocGetSecurityHandlerName
PDDocGetNewSecurityHandlerName
PDDocPermRequest

◆ PDDocGetSecurityHandlerName()

PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocGetSecurityHandlerName ( PDDoc doc,
PDAtom * pName )

Gets the name of the current security handler.

"Standard" is the name of the default password protection handler

See also
PDDocGetSecurityData
PDDocGetNewSecurityData
PDDocSetNewSecurityHandler
PDDocPermRequest

◆ PDDocSetNewSecurityHandler()

PDF_CORE_API PDErrCode PDFSDK_CALLCONV PDDocSetNewSecurityHandler ( PDDoc doc,
PDAtom name,
void * securityData )

Sets the specified document's new security handler. The new security handler is used to encrypt the document during a save.

Parameters
docThe document whose new security handler is set.
nameThe PDAtom for the name of the new security handler to use for the document. This name must be the same as the pdfName used when the security handler was registered using PDRegisterSecurityHandler().
securityDataThe new security data structure to set for doc. If the call succeeds, doc will take ownership of securityData and will free it later using PDSecurityHandler::freeSecurityData
See also
PDRegisterSecurityHandler