JWSBuilder
in package
Table of Contents
Properties
- $isPayloadDetached : bool
- $isPayloadEncoded : null|bool
- $payload : null|string
- $signatures : array<string|int, mixed>
- $signatureAlgorithmManager : AlgorithmManager
Methods
- __construct() : mixed
- addSignature() : JWSBuilder
- Adds the information needed to compute the signature.
- build() : JWS
- Computes all signatures and return the expected JWS object.
- create() : JWSBuilder
- Reset the current data.
- getSignatureAlgorithmManager() : AlgorithmManager
- Returns the algorithm manager associated to the builder.
- withPayload() : JWSBuilder
- Set the payload.
- checkB64AndCriticalHeader() : void
- checkDuplicatedHeaderParameters() : void
- checkIfPayloadIsEncoded() : bool
- findSignatureAlgorithm() : MacAlgorithm|SignatureAlgorithm
Properties
$isPayloadDetached
protected
bool
$isPayloadDetached
$isPayloadEncoded
protected
null|bool
$isPayloadEncoded
$payload
protected
null|string
$payload
$signatures
protected
array<string|int, mixed>
$signatures
= []
$signatureAlgorithmManager
private
AlgorithmManager
$signatureAlgorithmManager
Methods
__construct()
public
__construct(AlgorithmManager $signatureAlgorithmManager) : mixed
Parameters
- $signatureAlgorithmManager : AlgorithmManager
addSignature()
Adds the information needed to compute the signature.
public
addSignature(JWK $signatureKey, array<string|int, mixed> $protectedHeader[, array<string|int, mixed> $header = [] ]) : JWSBuilder
This method will return a new JWSBuilder object.
Parameters
- $signatureKey : JWK
- $protectedHeader : array<string|int, mixed>
- $header : array<string|int, mixed> = []
Tags
Return values
JWSBuilderbuild()
Computes all signatures and return the expected JWS object.
public
build() : JWS
Tags
Return values
JWScreate()
Reset the current data.
public
create() : JWSBuilder
Return values
JWSBuildergetSignatureAlgorithmManager()
Returns the algorithm manager associated to the builder.
public
getSignatureAlgorithmManager() : AlgorithmManager
Return values
AlgorithmManagerwithPayload()
Set the payload.
public
withPayload(string $payload[, bool $isPayloadDetached = false ]) : JWSBuilder
This method will return a new JWSBuilder object.
Parameters
- $payload : string
- $isPayloadDetached : bool = false
Tags
Return values
JWSBuildercheckB64AndCriticalHeader()
private
checkB64AndCriticalHeader(array<string|int, mixed> $protectedHeader) : void
Parameters
- $protectedHeader : array<string|int, mixed>
Tags
checkDuplicatedHeaderParameters()
private
checkDuplicatedHeaderParameters(array<string|int, mixed> $header1, array<string|int, mixed> $header2) : void
Parameters
- $header1 : array<string|int, mixed>
- $header2 : array<string|int, mixed>
Tags
checkIfPayloadIsEncoded()
private
checkIfPayloadIsEncoded(array<string|int, mixed> $protectedHeader) : bool
Parameters
- $protectedHeader : array<string|int, mixed>
Return values
boolfindSignatureAlgorithm()
private
findSignatureAlgorithm(JWK $key, array<string|int, mixed> $protectedHeader, array<string|int, mixed> $header) : MacAlgorithm|SignatureAlgorithm
Parameters
- $key : JWK
- $protectedHeader : array<string|int, mixed>
- $header : array<string|int, mixed>