HashValue implements Stringable, SourceValueInterface

FinalYes

Representation of Content-Security-Policy hash source value see https://www.w3.org/TR/CSP3/#grammardef-hash-source

Table of Contents

Interfaces

Stringable
SourceValueInterface
Interface used for self-contained source value models.

Properties

$type  : HashType
$value  : string

Methods

__construct()  : mixed
__toString()  : string
compile()  : string|null
Compiled representation to be used for Content-Security-Policy HTTP header.
create()  : self
hash()  : self
knows()  : bool
Determines whether a serialized representation is known and can be handled by a specific implementation, (e.g. "string starts with 'hash-proxy-").
parse()  : self
Parses a known serialized representation as object representation.
serialize()  : string|null
Serialized representation to be used for persisting declaration (e.g. in database).

Properties

Methods

__construct()

public __construct(string $value[, HashType $type = HashType::sha256 ]) : mixed
Parameters
$value : string

hash value (binary, hex or base64 encoded)

$type : HashType = HashType::sha256

__toString()

public __toString() : string
Return values
string

compile()

Compiled representation to be used for Content-Security-Policy HTTP header.

public compile([FrontendInterface|null $cache = null ]) : string|null
Parameters
$cache : FrontendInterface|null = null
Return values
string|null

null means "not applicable / skip"

create()

public static create(string $value[, HashType $type = HashType::sha256 ]) : self
Parameters
$value : string
$type : HashType = HashType::sha256
Return values
self

hash()

public static hash(string $payload[, HashType $type = HashType::sha256 ]) : self
Parameters
$payload : string
$type : HashType = HashType::sha256
Return values
self

knows()

Determines whether a serialized representation is known and can be handled by a specific implementation, (e.g. "string starts with 'hash-proxy-").

public static knows(string $value) : bool
Parameters
$value : string
Return values
bool

parse()

Parses a known serialized representation as object representation.

public static parse(string $value) : self
Parameters
$value : string
Return values
self

serialize()

Serialized representation to be used for persisting declaration (e.g. in database).

public serialize() : string|null
Return values
string|null

null means "not applicable / skip"


        
On this page

Search results