Protection
in package
Document protection class.
Tags
Table of Contents
Properties
- $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.
Methods
- __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
= \PhpOffice\PhpWord\Shared\Microsoft\PasswordEncoder::ALGORITHM_SHA_1
$editing
Editing restriction none|readOnly|comments|trackedChanges|forms.
private
string
$editing
Tags
$password
password.
private
string
$password
$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
getAlgorithm()
Get algorithm.
public
getAlgorithm() : string
Return values
stringgetEditing()
Get editing protection.
public
getEditing() : string
Return values
stringgetPassword()
Get password.
public
getPassword() : string
Return values
stringgetSalt()
Get salt.
public
getSalt() : string
Return values
stringgetSpinCount()
Get count for hash iterations.
public
getSpinCount() : int
Return values
intsetAlgorithm()
Set algorithm.
public
setAlgorithm(string $algorithm) : self
Parameters
- $algorithm : string
Return values
selfsetEditing()
Set editing protection.
public
setEditing([string $editing = null ]) : self
Parameters
- $editing : string = null
-
Any value of \PhpOffice\PhpWord\SimpleType\DocProtect
Return values
selfsetPassword()
Set password.
public
setPassword(string $password) : self
Parameters
- $password : string
Return values
selfsetSalt()
Set salt. Salt HAS to be 16 characters, or an exception will be thrown.
public
setSalt(string $salt) : self
Parameters
- $salt : string
Return values
selfsetSpinCount()
Set count for hash iterations.
public
setSpinCount(int $spinCount) : self
Parameters
- $spinCount : int