PHP 클래스 Neos\Flow\Security\Cryptography\HashService

파일 보기 프로젝트 열기: neos/flow-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$cache Neos\Cache\Frontend\StringFrontend
$encryptionKey string A private, unique key used for encryption tasks
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
$passwordHashingStrategies array
$strategySettings array

공개 메소드들

메소드 설명
appendHmac ( string $string ) : string Appends a hash (HMAC) to a given string and returns the result
generateHmac ( string $string ) : string Generate a hash (HMAC) for a given string
hashPassword ( string $password, string $strategyIdentifier = 'default' ) : string Hash a password using the configured password hashing strategy
injectSettings ( array $settings ) : void Injects the settings of the package this controller belongs to.
validateAndStripHmac ( string $string ) : string Tests if the last 40 characters of a given string $string matches the HMAC of the rest of the string and, if true, returns the string without the HMAC. In case of a HMAC validation error, an exception is thrown.
validateHmac ( string $string, string $hmac ) : boolean Tests if a string $string matches the HMAC given by $hash.
validatePassword ( string $password, string $hashedPasswordAndSalt ) : boolean Validate a hashed password using the configured password hashing strategy

보호된 메소드들

메소드 설명
getEncryptionKey ( ) : string Returns the encryption key from the persistent cache or Data/Persistent directory. If none exists, a new encryption key will be generated and stored in the cache.
getPasswordHashingStrategyAndIdentifier ( string $strategyIdentifier = 'default' ) : array Get a password hashing strategy

메소드 상세

appendHmac() 공개 메소드

Appends a hash (HMAC) to a given string and returns the result
또한 보기: generateHmac()
public appendHmac ( string $string ) : string
$string string The string for which a hash should be generated
리턴 string The original string with HMAC of the string appended

generateHmac() 공개 메소드

Generate a hash (HMAC) for a given string
public generateHmac ( string $string ) : string
$string string The string for which a hash should be generated
리턴 string The hash of the string

getEncryptionKey() 보호된 메소드

Returns the encryption key from the persistent cache or Data/Persistent directory. If none exists, a new encryption key will be generated and stored in the cache.
protected getEncryptionKey ( ) : string
리턴 string The configured encryption key stored in Data/Persistent/EncryptionKey

getPasswordHashingStrategyAndIdentifier() 보호된 메소드

Get a password hashing strategy
protected getPasswordHashingStrategyAndIdentifier ( string $strategyIdentifier = 'default' ) : array
$strategyIdentifier string
리턴 array

hashPassword() 공개 메소드

Hash a password using the configured password hashing strategy
public hashPassword ( string $password, string $strategyIdentifier = 'default' ) : string
$password string The cleartext password
$strategyIdentifier string An identifier for a configured strategy, uses default strategy if not specified
리턴 string A hashed password with salt (if used)

injectSettings() 공개 메소드

Injects the settings of the package this controller belongs to.
public injectSettings ( array $settings ) : void
$settings array Settings container of the current package
리턴 void

validateAndStripHmac() 공개 메소드

Tests if the last 40 characters of a given string $string matches the HMAC of the rest of the string and, if true, returns the string without the HMAC. In case of a HMAC validation error, an exception is thrown.
또한 보기: validateHmac()
public validateAndStripHmac ( string $string ) : string
$string string The string with the HMAC appended (in the format 'string')
리턴 string the original string without the HMAC, if validation was successful

validateHmac() 공개 메소드

Tests if a string $string matches the HMAC given by $hash.
public validateHmac ( string $string, string $hmac ) : boolean
$string string The string which should be validated
$hmac string The hash of the string
리턴 boolean TRUE if string and hash fit together, FALSE otherwise.

validatePassword() 공개 메소드

Validate a hashed password using the configured password hashing strategy
public validatePassword ( string $password, string $hashedPasswordAndSalt ) : boolean
$password string The cleartext password
$hashedPasswordAndSalt string The hashed password with salt (if used) and an optional strategy identifier
리턴 boolean TRUE if the given password matches the hashed password

프로퍼티 상세

$cache 보호되어 있는 프로퍼티

protected StringFrontend,Neos\Cache\Frontend $cache
리턴 Neos\Cache\Frontend\StringFrontend

$encryptionKey 보호되어 있는 프로퍼티

A private, unique key used for encryption tasks
protected string $encryptionKey
리턴 string

$objectManager 보호되어 있는 프로퍼티

protected ObjectManagerInterface,Neos\Flow\ObjectManagement $objectManager
리턴 Neos\Flow\ObjectManagement\ObjectManagerInterface

$passwordHashingStrategies 보호되어 있는 프로퍼티

protected array $passwordHashingStrategies
리턴 array

$strategySettings 보호되어 있는 프로퍼티

protected array $strategySettings
리턴 array