Class MessageAuthentication
A class that is used for signing messages.
Methods summary
public
|
#
__construct( string $privateKey )
Creates a new instance with a specific private key, that can then be used to sign messages.
Creates a new instance with a specific private key, that can then be used to sign messages.
Parameters
- $privateKey
- A private key that will be used as a secret in the signature. Must not be null.
Throws
|
public
string
|
#
sign( string $message )
Signs a message by combining it with a private key, used for prevention of unauthorized changes of the message.
Signs a message by combining it with a private key, used for prevention of unauthorized changes of the message.
Parameters
- $message
- The message that should be signed. Must not be null or empty.
Returns
string A string token in hex format.
Throws
|