PHP Class Trianglman\Sqrl\SqrlGenerate

Author: johnj
Inheritance: implements Trianglman\Sqrl\SqrlGenerateInterface
显示文件 Open project: trianglman/sqrl Class Usage Examples

Protected Properties

Property Type Description
$configuration SqrlConfiguration
$nonce
$store SqrlStore

Public Methods

Method Description
__construct ( SqrlConfiguration $config, Trianglman\Sqrl\SqrlStoreInterface $storage )
generateQry ( )
getNonce ( integer $action, string $key = '', string $previousNonce = '' ) : string Returns the generated nonce
getUrl ( )
render ( $outputFile )

Protected Methods

Method Description
generateNonce ( integer $action, string $key = '', string $previousNonce = '' ) : string Generates a random, one time use key to be used in the sqrl validation

Method Details

__construct() public method

public __construct ( SqrlConfiguration $config, Trianglman\Sqrl\SqrlStoreInterface $storage )
$config SqrlConfiguration
$storage Trianglman\Sqrl\SqrlStoreInterface

generateNonce() protected method

The implementation of this may get more complicated depending on the requirements detailed in any reference implementation. Users wanting to make this library more (or less) secure should override this function to strengthen (or weaken) the randomness of the generation.
protected generateNonce ( integer $action, string $key = '', string $previousNonce = '' ) : string
$action integer [Optional] The type of action this nonce is being generated for
$key string [Optional] The public key associated with the nonce
$previousNonce string [Optional] The previous nonce in the transaction that should be associated to this nonce
return string

generateQry() public method

public generateQry ( )

getNonce() public method

Returns the generated nonce
public getNonce ( integer $action, string $key = '', string $previousNonce = '' ) : string
$action integer [Optional] The type of action this nonce is being generated for
$key string [Optional] The public key associated with the nonce
$previousNonce string [Optional] The previous nonce in the transaction that should be associated to this nonce
return string The one time use string for the QR link

getUrl() public method

public getUrl ( )

render() public method

public render ( $outputFile )

Property Details

$configuration protected_oe property

protected SqrlConfiguration,Trianglman\Sqrl $configuration
return SqrlConfiguration

$nonce protected_oe property

protected $nonce

$store protected_oe property

protected SqrlStore $store
return SqrlStore