Documentation

Protection

Document protection class

Tags
since
0.12.0
see
http://www.datypic.com/sc/ooxml/t-w_CT_DocProtect.html

Table of Contents

$algorithm  : string
Cryptographic Hashing Algorithm (see constants defined in \PhpOffice\PhpWord\Shared\Microsoft\PasswordEncoder)
$editing  : string
Editing restriction none|readOnly|comments|trackedChanges|forms
$password  : string
password
$salt  : string
Salt for Password Verifier
$spinCount  : int
Iterations to Run Hashing Algorithm
__construct()  : mixed
Create a new instance
getAlgorithm()  : string
Get algorithm
getEditing()  : string
Get editing protection
getPassword()  : string
Get password
getSalt()  : string
Get salt
getSpinCount()  : int
Get count for hash iterations
setAlgorithm()  : self
Set algorithm
setEditing()  : self
Set editing protection
setPassword()  : self
Set password
setSalt()  : self
Set salt. Salt HAS to be 16 characters, or an exception will be thrown.
setSpinCount()  : self
Set count for hash iterations

Properties

$algorithm

Cryptographic Hashing Algorithm (see constants defined in \PhpOffice\PhpWord\Shared\Microsoft\PasswordEncoder)

private string $algorithm = PhpOfficePhpWordSharedMicrosoftPasswordEncoder::ALGORITHM_SHA_1

$salt

Salt for Password Verifier

private string $salt

$spinCount

Iterations to Run Hashing Algorithm

private int $spinCount = 100000

Methods

__construct()

Create a new instance

public __construct([string $editing = null ]) : mixed
Parameters
$editing : string = null
Return values
mixed

getAlgorithm()

Get algorithm

public getAlgorithm() : string
Return values
string

getEditing()

Get editing protection

public getEditing() : string
Return values
string

getPassword()

Get password

public getPassword() : string
Return values
string

getSalt()

Get salt

public getSalt() : string
Return values
string

getSpinCount()

Get count for hash iterations

public getSpinCount() : int
Return values
int

setAlgorithm()

Set algorithm

public setAlgorithm(string $algorithm) : self
Parameters
$algorithm : string
Return values
self

setEditing()

Set editing protection

public setEditing([string $editing = null ]) : self
Parameters
$editing : string = null

Any value of \PhpOffice\PhpWord\SimpleType\DocProtect

Return values
self

setPassword()

Set password

public setPassword(string $password) : self
Parameters
$password : string
Return values
self

setSalt()

Set salt. Salt HAS to be 16 characters, or an exception will be thrown.

public setSalt(string $salt) : self
Parameters
$salt : string
Tags
throws
InvalidArgumentException
Return values
self

setSpinCount()

Set count for hash iterations

public setSpinCount(int $spinCount) : self
Parameters
$spinCount : int
Return values
self

Search results