# StandardSecurityHandlerRev5

## Content

[**DsPdfJS API v9.1.3**](../README)

***

[DsPdfJS API](../globals) / StandardSecurityHandlerRev5

# Class: StandardSecurityHandlerRev5

Represents Standard Security Handler Revision 5.
This handler always use AES encryption with key length of 256 bit,
it is described in Adobe Supplement to the ISO 32000.

## Extends

- [`StandardSecurityHandlerRev4`](StandardSecurityHandlerRev4)

## Extended by

- [`StandardSecurityHandlerRev6`](StandardSecurityHandlerRev6)

## Accessors

### accessType

#### Get Signature

> **get** **accessType**(): [`AccessType`](../enumerations/AccessType) \| `null`

Gets the access type granted by this [StandardSecurityHandler](StandardSecurityHandler), or null.
This property is initialized when a document is loaded.

##### Returns

[`AccessType`](../enumerations/AccessType) \| `null`

#### Inherited from

[`StandardSecurityHandlerRev4`](StandardSecurityHandlerRev4).[`accessType`](StandardSecurityHandlerRev4#accesstype)

***

### allowCopyContent

#### Get Signature

> **get** **allowCopyContent**(): `boolean`

Gets or sets whether the user can copy contents from the PDF document.

##### Returns

`boolean`

#### Set Signature

> **set** **allowCopyContent**(`value`): `void`

Gets or sets whether the user can copy contents from the PDF document.

##### Parameters

###### value

`boolean`

##### Returns

`void`

#### Inherited from

[`StandardSecurityHandlerRev4`](StandardSecurityHandlerRev4).[`allowCopyContent`](StandardSecurityHandlerRev4#allowcopycontent)

***

### allowEditAnnotations

#### Get Signature

> **get** **allowEditAnnotations**(): `boolean`

Gets or sets whether the user can edit annotations in the PDF document.

##### Returns

`boolean`

#### Set Signature

> **set** **allowEditAnnotations**(`value`): `void`

Gets or sets whether the user can edit annotations in the PDF document.

##### Parameters

###### value

`boolean`

##### Returns

`void`

#### Inherited from

[`StandardSecurityHandlerRev4`](StandardSecurityHandlerRev4).[`allowEditAnnotations`](StandardSecurityHandlerRev4#alloweditannotations)

***

### allowEditContent

#### Get Signature

> **get** **allowEditContent**(): `boolean`

Gets or sets whether the user can edit the contents of the PDF document.

##### Returns

`boolean`

#### Set Signature

> **set** **allowEditContent**(`value`): `void`

Gets or sets whether the user can edit the contents of the PDF document.

##### Parameters

###### value

`boolean`

##### Returns

`void`

#### Inherited from

[`StandardSecurityHandlerRev4`](StandardSecurityHandlerRev4).[`allowEditContent`](StandardSecurityHandlerRev4#alloweditcontent)

***

### allowPrint

#### Get Signature

> **get** **allowPrint**(): `boolean`

Gets or sets whether the user can print the PDF document.

##### Returns

`boolean`

#### Set Signature

> **set** **allowPrint**(`value`): `void`

Gets or sets whether the user can print the PDF document.

##### Parameters

###### value

`boolean`

##### Returns

`void`

#### Inherited from

[`StandardSecurityHandlerRev4`](StandardSecurityHandlerRev4).[`allowPrint`](StandardSecurityHandlerRev4#allowprint)

***

### copyContent

#### Get Signature

> **get** **copyContent**(): `boolean`

Gets or sets a value indicating whether a document's content can be copied or extracted.

##### Returns

`boolean`

#### Set Signature

> **set** **copyContent**(`value`): `void`

Gets or sets a value indicating whether a document's content can be copied or extracted.

##### Parameters

###### value

`boolean`

##### Returns

`void`

#### Inherited from

[`StandardSecurityHandlerRev4`](StandardSecurityHandlerRev4).[`copyContent`](StandardSecurityHandlerRev4#copycontent)

***

### copyContentAccessibility

#### Get Signature

> **get** **copyContentAccessibility**(): `boolean`

Gets or sets a value used to determine whether content could be extracted for
the purposes of accessibility.
Note however that this restriction has been deprecated in PDF 2.0,
which states that PDF readers shall ignore this bit.
The default value of this property is true, and it should not be changed.

##### Returns

`boolean`

#### Set Signature

> **set** **copyContentAccessibility**(`value`): `void`

Gets or sets a value used to determine whether content could be extracted for
the purposes of accessibility.
Note however that this restriction has been deprecated in PDF 2.0,
which states that PDF readers shall ignore this bit.
The default value of this property is true, and it should not be changed.

##### Parameters

###### value

`boolean`

##### Returns

`void`

#### Inherited from

[`StandardSecurityHandlerRev4`](StandardSecurityHandlerRev4).[`copyContentAccessibility`](StandardSecurityHandlerRev4#copycontentaccessibility)

***

### editingPermissions

#### Get Signature

> **get** **editingPermissions**(): [`EditingPermissions`](../enumerations/EditingPermissions)

Gets or sets a value controlling how a document can be edited.

##### Returns

[`EditingPermissions`](../enumerations/EditingPermissions)

#### Set Signature

> **set** **editingPermissions**(`value`): `void`

Gets or sets a value controlling how a document can be edited.

##### Parameters

###### value

[`EditingPermissions`](../enumerations/EditingPermissions)

##### Returns

`void`

#### Inherited from

[`StandardSecurityHandlerRev4`](StandardSecurityHandlerRev4).[`editingPermissions`](StandardSecurityHandlerRev4#editingpermissions)

***

### encryptionAlgorithm

#### Get Signature

> **get** **encryptionAlgorithm**(): `number`

Gets or sets a value indicating whether streams should be encrypted.

##### Returns

`number`

#### Set Signature

> **set** **encryptionAlgorithm**(`value`): `void`

Gets or sets a value indicating whether streams should be encrypted.

##### Parameters

###### value

`number`

##### Returns

`void`

#### Inherited from

[`StandardSecurityHandlerRev4`](StandardSecurityHandlerRev4).[`encryptionAlgorithm`](StandardSecurityHandlerRev4#encryptionalgorithm)

***

### encryptionKeyLength

#### Get Signature

> **get** **encryptionKeyLength**(): `number`

Gets or sets the length of the encryption key, in bits.
The value must be a multiple of 8, in the range from 40 to 128.
IMPORTANT NOTE: [StandardSecurityHandlerRev4](StandardSecurityHandlerRev4) can use RC4 or AES encryption,
and according to specification, with RC4 any key length in the range from 40 to 128 can be used.
But tests show that current/recent versions of <b>Adobe Acrobat Reader DC</b> and <b>Adobe Acrobat Pro DC</b>
cannot handle files encrypted with RC4 if the key length is not equal to 128.
Older versions of Acrobat Reader handle such files without issues, so it looks like a bug in
the newer versions of Acrobat Reader.
So it is recommended that [StandardSecurityHandlerRev3](StandardSecurityHandlerRev3) is used
in cases when RC4 encryption with key length other than 128 is required.

##### Returns

`number`

#### Set Signature

> **set** **encryptionKeyLength**(`value`): `void`

Gets or sets the length of the encryption key, in bits.
The value must be a multiple of 8, in the range from 40 to 128.
IMPORTANT NOTE: [StandardSecurityHandlerRev4](StandardSecurityHandlerRev4) can use RC4 or AES encryption,
and according to specification, with RC4 any key length in the range from 40 to 128 can be used.
But tests show that current/recent versions of <b>Adobe Acrobat Reader DC</b> and <b>Adobe Acrobat Pro DC</b>
cannot handle files encrypted with RC4 if the key length is not equal to 128.
Older versions of Acrobat Reader handle such files without issues, so it looks like a bug in
the newer versions of Acrobat Reader.
So it is recommended that [StandardSecurityHandlerRev3](StandardSecurityHandlerRev3) is used
in cases when RC4 encryption with key length other than 128 is required.

##### Parameters

###### value

`number`

##### Returns

`void`

#### Inherited from

[`StandardSecurityHandlerRev4`](StandardSecurityHandlerRev4).[`encryptionKeyLength`](StandardSecurityHandlerRev4#encryptionkeylength)

***

### encryptMetadata

#### Get Signature

> **get** **encryptMetadata**(): `boolean`

Gets or sets a value indicating whether the document-level metadata stream
is to be encrypted.

##### Returns

`boolean`

#### Set Signature

> **set** **encryptMetadata**(`value`): `void`

Gets or sets a value indicating whether the document-level metadata stream
is to be encrypted.

##### Parameters

###### value

`boolean`

##### Returns

`void`

#### Inherited from

[`StandardSecurityHandlerRev4`](StandardSecurityHandlerRev4).[`encryptMetadata`](StandardSecurityHandlerRev4#encryptmetadata)

***

### encryptStreams

#### Get Signature

> **get** **encryptStreams**(): `boolean`

Gets or sets a value indicating whether streams should be encrypted.

##### Returns

`boolean`

#### Set Signature

> **set** **encryptStreams**(`value`): `void`

Gets or sets a value indicating whether streams should be encrypted.

##### Parameters

###### value

`boolean`

##### Returns

`void`

#### Inherited from

[`StandardSecurityHandlerRev4`](StandardSecurityHandlerRev4).[`encryptStreams`](StandardSecurityHandlerRev4#encryptstreams)

***

### encryptStrings

#### Get Signature

> **get** **encryptStrings**(): `boolean`

Gets or sets a value indicating whether strings should be encrypted.

##### Returns

`boolean`

#### Set Signature

> **set** **encryptStrings**(`value`): `void`

Gets or sets a value indicating whether strings should be encrypted.

##### Parameters

###### value

`boolean`

##### Returns

`void`

#### Inherited from

[`StandardSecurityHandlerRev4`](StandardSecurityHandlerRev4).[`encryptStrings`](StandardSecurityHandlerRev4#encryptstrings)

***

### id

#### Get Signature

> **get** **id**(): `number`

Gets the reference to the object.

##### Returns

`number`

#### Inherited from

[`StandardSecurityHandlerRev4`](StandardSecurityHandlerRev4).[`id`](StandardSecurityHandlerRev4#id)

***

### om

#### Get Signature

> **get** **om**(): [`ObjectManager`](ObjectManager)

Gets the owner [ObjectManager](ObjectManager) instance.

##### Returns

[`ObjectManager`](ObjectManager)

#### Inherited from

[`StandardSecurityHandlerRev4`](StandardSecurityHandlerRev4).[`om`](StandardSecurityHandlerRev4#om)

***

### ownerPassword

#### Get Signature

> **get** **ownerPassword**(): `string`

Gets or sets the password required to change permissions of a PDF document as a string.
The two properties [ownerPassword](StandardSecurityHandler#ownerpassword) and [ownerPasswordBytes](StandardSecurityHandler#ownerpasswordbytes) allow
to define the password as a string or as an array of bytes.
According to the PDF specification, a string password should be converted to an array of bytes
using the system code page (if the standard security handler with revision 4 or less is used).
In some environments the system code page is unavailable, so DsPdfJS cannot perform this conversion.
If the password string only contains ASCII chars, this does not present a problem.
But if the password string contains non-ASCII Unicode characters, it is up to the developer
to perform the conversion and set the password using this property.

##### Returns

`string`

#### Set Signature

> **set** **ownerPassword**(`value`): `void`

Gets or sets the password required to change permissions of a PDF document as a string.
The two properties [ownerPassword](StandardSecurityHandler#ownerpassword) and [ownerPasswordBytes](StandardSecurityHandler#ownerpasswordbytes) allow
to define the password as a string or as an array of bytes.
According to the PDF specification, a string password should be converted to an array of bytes
using the system code page (if the standard security handler with revision 4 or less is used).
In some environments the system code page is unavailable, so DsPdfJS cannot perform this conversion.
If the password string only contains ASCII chars, this does not present a problem.
But if the password string contains non-ASCII Unicode characters, it is up to the developer
to perform the conversion and set the password using this property.

##### Parameters

###### value

`string`

##### Returns

`void`

#### Inherited from

[`StandardSecurityHandlerRev4`](StandardSecurityHandlerRev4).[`ownerPassword`](StandardSecurityHandlerRev4#ownerpassword)

***

### ownerPasswordBytes

#### Get Signature

> **get** **ownerPasswordBytes**(): `Uint8Array`

Gets or sets the password required to change permissions of a PDF document as a byte array.
The two properties [ownerPassword](StandardSecurityHandler#ownerpassword) and [ownerPasswordBytes](StandardSecurityHandler#ownerpasswordbytes) allow
to define the password as a string or as an array of bytes.
According to the PDF specification, a string password should be converted to an array of bytes
using the system code page (if the standard security handler with revision 4 or less is used).
In some environments the system code page is unavailable, so DsPdfJS cannot perform this conversion.
If the password string only contains ASCII chars, this does not present a problem.
But if the password string contains non-ASCII Unicode characters, it is up to the developer
to perform the conversion and set the password using this property.

##### Returns

`Uint8Array`

#### Set Signature

> **set** **ownerPasswordBytes**(`value`): `void`

Gets or sets the password required to change permissions of a PDF document as a byte array.
The two properties [ownerPassword](StandardSecurityHandler#ownerpassword) and [ownerPasswordBytes](StandardSecurityHandler#ownerpasswordbytes) allow
to define the password as a string or as an array of bytes.
According to the PDF specification, a string password should be converted to an array of bytes
using the system code page (if the standard security handler with revision 4 or less is used).
In some environments the system code page is unavailable, so DsPdfJS cannot perform this conversion.
If the password string only contains ASCII chars, this does not present a problem.
But if the password string contains non-ASCII Unicode characters, it is up to the developer
to perform the conversion and set the password using this property.

##### Parameters

###### value

`Uint8Array`

##### Returns

`void`

#### Inherited from

[`StandardSecurityHandlerRev4`](StandardSecurityHandlerRev4).[`ownerPasswordBytes`](StandardSecurityHandlerRev4#ownerpasswordbytes)

***

### passwordMatches

#### Get Signature

> **get** **passwordMatches**(): [`PasswordMatches`](../enumerations/PasswordMatches)

Gets a combination of flags that indicate how the password specified
when loading the PDF matches the document's User and Owner passwords.

##### Returns

[`PasswordMatches`](../enumerations/PasswordMatches)

#### Inherited from

[`StandardSecurityHandlerRev4`](StandardSecurityHandlerRev4).[`passwordMatches`](StandardSecurityHandlerRev4#passwordmatches)

***

### printingPermissions

#### Get Signature

> **get** **printingPermissions**(): [`PrintingPermissions`](../enumerations/PrintingPermissions)

Gets or sets a value controlling how a document can be printed.

##### Returns

[`PrintingPermissions`](../enumerations/PrintingPermissions)

#### Set Signature

> **set** **printingPermissions**(`value`): `void`

Gets or sets a value controlling how a document can be printed.

##### Parameters

###### value

[`PrintingPermissions`](../enumerations/PrintingPermissions)

##### Returns

`void`

#### Inherited from

[`StandardSecurityHandlerRev4`](StandardSecurityHandlerRev4).[`printingPermissions`](StandardSecurityHandlerRev4#printingpermissions)

***

### revision

#### Get Signature

> **get** **revision**(): `number`

Gets the revision of this [StandardSecurityHandler](StandardSecurityHandler).

##### Returns

`number`

#### Inherited from

[`StandardSecurityHandlerRev4`](StandardSecurityHandlerRev4).[`revision`](StandardSecurityHandlerRev4#revision)

***

### userPassword

#### Get Signature

> **get** **userPassword**(): `string`

Gets or sets the password required to open a PDF document as a string.
The two properties [userPassword](StandardSecurityHandler#userpassword) and [userPasswordBytes](StandardSecurityHandler#userpasswordbytes) allow
to define the password as a string or as an array of bytes.
According to the PDF specification, a string password should be converted to an array of bytes
using the system code page (if the standard security handler with revision 4 or less is used).
In some environments the system code page is unavailable, so DsPdf cannot perform this conversion.
If the password string only contains ASCII chars, this does not present a problem.
But if the password string contains non-ASCII Unicode characters, it is up to the developer
to perform the conversion and set the password using [userPasswordBytes](StandardSecurityHandler#userpasswordbytes).

##### Returns

`string`

#### Set Signature

> **set** **userPassword**(`value`): `void`

Gets or sets the password required to open a PDF document as a string.
The two properties [userPassword](StandardSecurityHandler#userpassword) and [userPasswordBytes](StandardSecurityHandler#userpasswordbytes) allow
to define the password as a string or as an array of bytes.
According to the PDF specification, a string password should be converted to an array of bytes
using the system code page (if the standard security handler with revision 4 or less is used).
In some environments the system code page is unavailable, so DsPdf cannot perform this conversion.
If the password string only contains ASCII chars, this does not present a problem.
But if the password string contains non-ASCII Unicode characters, it is up to the developer
to perform the conversion and set the password using [userPasswordBytes](StandardSecurityHandler#userpasswordbytes).

##### Parameters

###### value

`string`

##### Returns

`void`

#### Inherited from

[`StandardSecurityHandlerRev4`](StandardSecurityHandlerRev4).[`userPassword`](StandardSecurityHandlerRev4#userpassword)

***

### userPasswordBytes

#### Get Signature

> **get** **userPasswordBytes**(): `Uint8Array`

Gets or sets the password required to open a PDF document as a byte array.
The two properties [userPassword](StandardSecurityHandler#userpassword) and [userPasswordBytes](StandardSecurityHandler#userpasswordbytes) allow
to define the password as a string or as an array of bytes.
According to the PDF specification, a string password should be converted to an array of bytes
using the system code page (if the standard security handler with revision 4 or less is used).
In some environments the system code page is unavailable, so DsPdfJS cannot perform this conversion.
If the password string only contains ASCII chars, this does not present a problem.
But if the password string contains non-ASCII Unicode characters, it is up to the developer
to perform the conversion and set the password using this property.

##### Returns

`Uint8Array`

#### Set Signature

> **set** **userPasswordBytes**(`value`): `void`

Gets or sets the password required to open a PDF document as a byte array.
The two properties [userPassword](StandardSecurityHandler#userpassword) and [userPasswordBytes](StandardSecurityHandler#userpasswordbytes) allow
to define the password as a string or as an array of bytes.
According to the PDF specification, a string password should be converted to an array of bytes
using the system code page (if the standard security handler with revision 4 or less is used).
In some environments the system code page is unavailable, so DsPdfJS cannot perform this conversion.
If the password string only contains ASCII chars, this does not present a problem.
But if the password string contains non-ASCII Unicode characters, it is up to the developer
to perform the conversion and set the password using this property.

##### Parameters

###### value

`Uint8Array`

##### Returns

`void`

#### Inherited from

[`StandardSecurityHandlerRev4`](StandardSecurityHandlerRev4).[`userPasswordBytes`](StandardSecurityHandlerRev4#userpasswordbytes)

## Methods

### create()

> `static` **create**(`om?`): `StandardSecurityHandlerRev5`

Creates a new StandardSecurityHandlerRev5.

#### Parameters

##### om?

[`ObjectManager`](ObjectManager)

[ObjectManager](ObjectManager) that controls the lifetime of the StandardSecurityHandlerRev5.

#### Returns

`StandardSecurityHandlerRev5`

#### Overrides

[`StandardSecurityHandlerRev4`](StandardSecurityHandlerRev4).[`create`](StandardSecurityHandlerRev4#create)

***

### assignFrom()

> **assignFrom**(`source`): `void`

Copies all property values from another object.

#### Parameters

##### source

[`SecurityHandlerBase`](SecurityHandlerBase)

The source object.

#### Returns

`void`

#### Inherited from

[`StandardSecurityHandlerRev4`](StandardSecurityHandlerRev4).[`assignFrom`](StandardSecurityHandlerRev4#assignfrom)

***

### clone()

> **clone**(): [`SecurityHandlerBase`](SecurityHandlerBase)

Create copy of this [SecurityHandlerBase](SecurityHandlerBase).

#### Returns

[`SecurityHandlerBase`](SecurityHandlerBase)

The clone of this object.

#### Inherited from

[`StandardSecurityHandlerRev4`](StandardSecurityHandlerRev4).[`clone`](StandardSecurityHandlerRev4#clone)

***

### free()

> **free**(): `void`

Detaches the object from the [ObjectManager](ObjectManager) and deallocates its memory, if possible.

#### Returns

`void`

#### Inherited from

[`StandardSecurityHandlerRev4`](StandardSecurityHandlerRev4).[`free`](StandardSecurityHandlerRev4#free)

***

### rebind()

> **rebind**(`omTo`): `void`

Rebinds the object from the current [ObjectManager](ObjectManager) to the specified one.

#### Parameters

##### omTo

[`ObjectManager`](ObjectManager)

The new [ObjectManager](ObjectManager) for the object.

#### Returns

`void`

#### Inherited from

[`StandardSecurityHandlerRev4`](StandardSecurityHandlerRev4).[`rebind`](StandardSecurityHandlerRev4#rebind)
