DL Logo

CosCrypt Typedefs

CosCryptVersion

Header: CosExpT.h:42

Syntax

typedef ASInt32 CosCryptVersion;

Used In

CosCrypt Callback Signatures

CosCryptStringProc

Header: CosExpT.h:329

Description

A prototype for the string encryption/decryption callback. This is part of the Crypt Filter mechanism.

Syntax

ASInt32 CosCryptStringProc(CosDoc dP, ASAtom filterName, char *dest, char *src, ASInt32 dstSize, ASInt32 srcLength, ASUns32 genNumber, ASUns32 objNumber);

CosCrypt Functions

CosCryptGetVersion

Header: CosProcs.h:1392

Description

Gets the current version number of the encryption algorithm supported.

Syntax

ASTVersion CosCryptGetVersion();

Returns

The current version number of the encryption supported.

CosDecryptData

Header: CosProcs.h:1006

Description

Decrypts data in a buffer using the specified encryption key. The standard Acrobat viewer encryption/decryption algorithm (RC4 from RSA Data Security, Inc.) is used.

An exception is raised if encryption encounters an internal error.

Related Methods

Syntax

void CosDecryptData(void *src, ASTArraySize len, void *dst, char *cryptData, ASTArraySize cryptDataLen);

Parameters

src
The buffer containing the data to decrypt.
len
The number of bytes in src.
dst
(Filled by the method) The buffer into which the decrypted data will be placed. This may point to the same location as src.
cryptData
The encryption key.
cryptDataLen
The length of the encryption key in bytes. It cannot be greater than 5.

CosDecryptGetMaxKeyBytes

Header: CosProcs.h:1408

Description

Gets the maximum number of the decryption key length, in bytes, for the specified cryptVersion.

Syntax

CosByteMax CosDecryptGetMaxKeyBytes(ASTVersion cryptVersion);

Parameters

cryptVersion
IN/OUT The Cos crypt version, which is the version of the algorithm that is used to encrypt and decrypt document data. cryptVersion equal to 0 is treated as cryptVersion equal to 1 to maintain backward compatibility.

Returns

The maximum number of key length, in bytes, for the specified cryptVersion. If cryptVersion is not currently supported, it returns-1.

CosEncryptData

Header: CosProcs.h:1028

Description

Encrypts data in a buffer using the specified encryption key. The standard Acrobat viewer encryption/decryption algorithm (RC4 from RSA Data Security, Inc.) is used.

An exception is raised if encryption encounters an internal error.

Related Methods

Syntax

void CosEncryptData(void *src, ASTArraySize len, void *dst, char *cryptData, ASTArraySize cryptDataLen);

Parameters

src
The buffer containing the data to encrypt.
len
The number of bytes in src.
dst
(Filled by the method) The buffer into which the encrypted data will be placed. This may point to the same location as src.
cryptData
The encryption key.
cryptDataLen
Length of the encryption key, in bytes. It cannot be greater than 5.

CosEncryptGetMaxKeyBytes

Header: CosProcs.h:1424

Description

Gets the maximum number of the encryption key length, in bytes, for the specified cryptVersion.

Syntax

CosByteMax CosEncryptGetMaxKeyBytes(ASTVersion cryptVersion);

Parameters

cryptVersion
IN/OUT The Cos crypt version, which is the version of the algorithm that is used to encrypt and decrypt document data. cryptVersion equal to 0 is treated as cryptVersion equal to 1 to maintain backward compatibility.

Returns

The maximum number of key length, in bytes, for the specified cryptVersion. If cryptVersion is not currently supported, it returns-1.