PHP Class ParagonIE\Halite\HiddenString

The purpose of this class is to encapsulate strings and hide their contents from stack traces should an unhandled exception occur in a program that uses Halite. The only things that should be protected: - Passwords - Plaintext (before encryption) - Plaintext (after decryption) This library makes heavy use of return-type declarations, which are a PHP 7 only feature. Read more about them here:
Afficher le fichier Open project: paragonie/halite Class Usage Examples

Protected Properties

Свойство Type Description
$disallowInline boolean Disallow the contents from being accessed via __toString()?
$disallowSerialization boolean Disallow the contents from being accessed via __sleep()?
$internalStringValue string

Méthodes publiques

Méthode Description
__construct ( string $value, boolean $disallowInline = false, boolean $disallowSerialization = false ) HiddenString constructor.
__debugInfo ( ) : array Hide its internal state from var_dump()
__destruct ( ) Wipe it from memory after it's been used.
__sleep ( ) : array
__toString ( ) : string Returns a copy of the string's internal value, which should be zeroed.
getString ( ) : string Explicit invocation -- get the raw string value

Method Details

__construct() public méthode

HiddenString constructor.
public __construct ( string $value, boolean $disallowInline = false, boolean $disallowSerialization = false )
$value string
$disallowInline boolean
$disallowSerialization boolean

__debugInfo() public méthode

Hide its internal state from var_dump()
public __debugInfo ( ) : array
Résultat array

__destruct() public méthode

Wipe it from memory after it's been used.
public __destruct ( )

__sleep() public méthode

public __sleep ( ) : array
Résultat array

__toString() public méthode

Optionally, it can return an empty string.
public __toString ( ) : string
Résultat string

getString() public méthode

Explicit invocation -- get the raw string value
public getString ( ) : string
Résultat string

Property Details

$disallowInline protected_oe property

Disallow the contents from being accessed via __toString()?
protected bool $disallowInline
Résultat boolean

$disallowSerialization protected_oe property

Disallow the contents from being accessed via __sleep()?
protected bool $disallowSerialization
Résultat boolean

$internalStringValue protected_oe property

protected string $internalStringValue
Résultat string