LayerAV_Layer
ObjectAVCrypt

AVCrypt methods implement the Acrobat built-in dialog boxes for encryption control. They are present in the core API so that they can be used by other security handlers.



Define Summary
 Define
 STDSEC_CryptRevision1
 STDSEC_CryptRevision2
 STDSEC_CryptRevision3
 STDSEC_CryptRevision4
 STDSEC_CryptRevision5
 STDSEC_CryptRevision6
 STDSEC_CryptVersionV1
 STDSEC_CryptVersionV2
 STDSEC_CryptVersionV3
 STDSEC_CryptVersionV4
 STDSEC_CryptVersionV5
New encryption method for Acrobat 9.0
 STDSEC_KEYLENGTH_AES128
 STDSEC_KEYLENGTH_AES256
New encryption method for Acrobat 9.0
 STDSEC_KEYLENGTH_RC4_V1
 STDSEC_KEYLENGTH_RC4_V2
 STDSEC_METHOD_AES_V1
 STDSEC_METHOD_AES_V2
 STDSEC_METHOD_AES_V3
New encryption method for Acrobat 9.0
 STDSEC_METHOD_RC4_V2
Typedef Summary
 Typedef
 StdSecurityData
 StdSecurityDataRec
Structure Summary
 Structure
 _t_StdSecurityData
A structure describing the data for the standard security handler provided in the Acrobat viewer.
Method Summary
 Method
 
ASBool AVAuthOpen(PDDoc pdDoc)
Determines if the current user is authorized to open a document.
 
ASBool AVCryptDoStdSecurity(PDDoc pdDoc, void* secData)
Displays the settings dialog box for the built-in standard security handler, allowing the user to change a document's permissions. The initial configuration of the dialog box may be set by populating the StdSecurityDataRec structure prior to calling the method.
 
ASBool AVCryptGetPassword(PDDoc pdDoc, PDPerms permWanted, void** authDataP)
Displays a standard dialog box that lets a user enter a password. This method does not attempt to validate the password entered by the user. That operation is performed by PDDocAuthorize().
Defines Detail
STDSEC_CryptRevision1 
Product availability: All
Platform availability: All

Syntax

#define STDSEC_CryptRevision1 1

File: PDExpT.h
Line: 4252
STDSEC_CryptRevision2 
Product availability: All
Platform availability: All

Syntax

#define STDSEC_CryptRevision2 2

File: PDExpT.h
Line: 4253
STDSEC_CryptRevision3 
Product availability: All
Platform availability: All

Syntax

#define STDSEC_CryptRevision3 3

File: PDExpT.h
Line: 4254
STDSEC_CryptRevision4 
Product availability: All
Platform availability: All

Syntax

#define STDSEC_CryptRevision4 4

File: PDExpT.h
Line: 4255
STDSEC_CryptRevision5 
Product availability: All
Platform availability: All

Syntax

#define STDSEC_CryptRevision5 5

File: PDExpT.h
Line: 4263
STDSEC_CryptRevision6 
Product availability: All
Platform availability: All

Syntax

#define STDSEC_CryptRevision6 6

File: PDExpT.h
Line: 4265
STDSEC_CryptVersionV1 
Product availability: All
Platform availability: All

Syntax

#define STDSEC_CryptVersionV1 1

File: PDExpT.h
Line: 4243
STDSEC_CryptVersionV2 
Product availability: All
Platform availability: All

Syntax

#define STDSEC_CryptVersionV2 2

File: PDExpT.h
Line: 4244
STDSEC_CryptVersionV3 
Product availability: All
Platform availability: All

Syntax

#define STDSEC_CryptVersionV3 3

File: PDExpT.h
Line: 4245
STDSEC_CryptVersionV4 
Product availability: All
Platform availability: All

Syntax

#define STDSEC_CryptVersionV4 4

File: PDExpT.h
Line: 4247
STDSEC_CryptVersionV5 
Product availability: All
Platform availability: All

Syntax

#define STDSEC_CryptVersionV5 5

Description

New encryption method for Acrobat 9.0


File: PDExpT.h
Line: 4249
STDSEC_KEYLENGTH_AES128 
Product availability: All
Platform availability: All

Syntax

#define STDSEC_KEYLENGTH_AES128 16

File: PDExpT.h
Line: 4238
STDSEC_KEYLENGTH_AES256 
Product availability: All
Platform availability: All

Syntax

#define STDSEC_KEYLENGTH_AES256 32

Description

New encryption method for Acrobat 9.0


File: PDExpT.h
Line: 4240
STDSEC_KEYLENGTH_RC4_V1 
Product availability: All
Platform availability: All

Syntax

#define STDSEC_KEYLENGTH_RC4_V1 5

File: PDExpT.h
Line: 4236
STDSEC_KEYLENGTH_RC4_V2 
Product availability: All
Platform availability: All

Syntax

#define STDSEC_KEYLENGTH_RC4_V2 16

File: PDExpT.h
Line: 4237
STDSEC_METHOD_AES_V1 
Product availability: All
Platform availability: All

Syntax

#define STDSEC_METHOD_AES_V1 5

File: PDExpT.h
Line: 4231
STDSEC_METHOD_AES_V2 
Product availability: All
Platform availability: All

Syntax

#define STDSEC_METHOD_AES_V2 6

File: PDExpT.h
Line: 4232
STDSEC_METHOD_AES_V3 
Product availability: All
Platform availability: All

Syntax

#define STDSEC_METHOD_AES_V3 7

Description

New encryption method for Acrobat 9.0


File: PDExpT.h
Line: 4234
STDSEC_METHOD_RC4_V2 
Product availability: All
Platform availability: All

Syntax

#define STDSEC_METHOD_RC4_V2 2

File: PDExpT.h
Line: 4230

Typedefs Detail
StdSecurityData 
Product availability: All
Platform availability: All

Syntax

typedef _t_StdSecurityData StdSecurityData;

File: PDExpT.h
Line: 4240
StdSecurityDataRec 
Product availability: All
Platform availability: All

Syntax

typedef _t_StdSecurityData StdSecurityDataRec;

File: PDExpT.h
Line: 4240


Structure Detail
_t_StdSecurityData
Product availability: All
Platform availability: All

Syntax

struct _t_StdSecurityData {
 ASSize_t size; 
 
 ASBool newUserPW; 
 
 ASBool hasUserPW; 
 
 StdPassword userPW; 
 
 ASBool newOwnerPW; 
 
 ASBool hasOwnerPW; 
 
 StdPassword ownerPW; 
 
 PDPerms perms; 
 
 Int32 keyLength; 
 
 Int32 revision; 
 
 ASBool encryptMetadata; 
 
 Int32 encryptMethod; 
 
 ASBool encryptAttachmentsOnly; 
 
 Int32 version; 
}

A structure describing the data for the standard security handler provided in the Acrobat viewer.


File: PDExpT.h
Line: 4200

Elements
size  

The size of this stucture.

 
newUserPW  

true if the user password should be changed.

 
hasUserPW  

true if there is a user password.

 
userPW  

The user password.

 
newOwnerPW  

true if the owner password should be changed, false otherwise.

 
hasOwnerPW  

true if an owner password is provided, false otherwise.

 
ownerPW  

The owner password.

 
perms  

The permissions to allow.

 
keyLength  

The encryption key length in bytes. New for Acrobat 5.0.

 
revision  

Indicates a /R value. New for Acrobat 6.0.

 
encryptMetadata  

A flag that indicates whether document metadata will be encrypted.

 
encryptMethod  

New for Acrobat 7.0.

The method of encryption for filters to use. It is only valid if the version is 4 or greater.

The valid values are:

Value

Description

CF_METHOD_RC4_V2

Use the RC4 algorithm for encryption.

CF_METHOD_AES_V1

Use the AES algorithm for encryption with a zero initialization vector.

CF_METHOD_AES_V2

Use the AES algorithm for encryption with a 16 byte random initialization vector.

CF_METHOD_AES_V3

Use the AES algorithm for encryption with a 4 byte random initialization vector.

 
encryptAttachmentsOnly  

A flag to indicate that only attachments are encrypted. encryptMetadata and encryptAttachmentsOnly cannot both be true.

 
version  

Indicates a /V value. New for Acrobat 9.0.


Method Detail
AVAuthOpen()
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

ASBool AVAuthOpen(PDDoc pdDoc)

Determines if the current user is authorized to open a document.

If no password is required to open the document, the user will be granted access automatically. If a password is required, the method queries the user for the password and uses it to request open permissions for the document.

Clients: This method can be used as a standard, interactive authorization callback when opening documents through PDDocOpen().

Parameters

pdDoc — 

The document.

Returns

true if the user is authorized to open the document, false otherwise.

See Also

Since

PI_ACROVIEW_VERSION >= 0x00020002

File: AVProcs.h
Line: 3767
AVCryptDoStdSecurity() 
Product availability: Acrobat
Platform availability: Macintosh, Windows, UNIX

Syntax

ASBool AVCryptDoStdSecurity(PDDoc pdDoc, void* secData)

Displays the settings dialog box for the built-in standard security handler, allowing the user to change a document's permissions. The initial configuration of the dialog box may be set by populating the StdSecurityDataRec structure prior to calling the method.

Parameters

pdDoc — 

IN/OUT The document for which new security data is obtained.

 
secData — 

IN/OUT (Filled by the method) A pointer to a StdSecurityDataRec structure to hold the permissions selected by the user.

Returns

true if the user confirmed the selections, false if the user pressed Cancel.

See Also

Since

PI_ACROVIEW_VERSION >= 0x00020000

File: AVProcs.h
Line: 3156
AVCryptGetPassword() 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

ASBool AVCryptGetPassword(PDDoc pdDoc, PDPerms permWanted, void** authDataP)

Displays a standard dialog box that lets a user enter a password. This method does not attempt to validate the password entered by the user. That operation is performed by PDDocAuthorize().

It is the client's responsibility to release the memory associated with the password, using ASfree().

This method is present in the API so that other security handlers can use it, if they choose, as a standard way to obtain a password from a user.

Parameters

pdDoc — 

IN The document whose password is obtained from the user. This parameter is used to generate a label within the dialog box.

 
permWanted — 

IN The permissions requested. It must be an OR of the PDPerms values.

 
authDataP — 

OUT If the method returns true, authData will reference a char* containing the password.

Returns

true if the user confirmed the selection, false if the user clicked Cancel.

See Also

Since

PI_ACROVIEW_VERSION >= 0x00020000

File: AVProcs.h
Line: 3182