Signer
class Signer implements SignerInterface, LoggerAwareInterface
The Signer class is designed for those who are signing data on behalf of a public-private keypair.
In principle, the "client party" has public key (i.e., client_id
) has a matching private key
(i.e., client_secret
) that can be verified by both the signer, as well as the client, but
by nobody else as we don't want to make forgeries possible.
The "signing party" has a simple an identifier which acts as an additional piece of entropy in the algorithm, and can help differentiate between multiple signing parties if the client party does something like try to use the same public-private keypair independently of a signing party (as is common with GPG signing).
For example, in the original AWS implementation, the "self key" for AWS was "AWS4".
Traits
Methods
Constructs a new instance of this class.
Gets the self key that was set in the constructor.
Gets the client key that was set in the constructor.
Gets the client secret that was set in the constructor.
Sign the payload to produce a signature for its contents.
Details
in LoggerAwareTrait at line line 18
setLogger(LoggerInterface $logger)
Sets a logger.
at line line 75
__construct(string $self_key, string $client_id, string $client_secret, string $hash_algo = 'sha512')
Constructs a new instance of this class.
at line line 87
string
getSelfKey()
Gets the self key that was set in the constructor.
at line line 96
string
getClientId()
Gets the client key that was set in the constructor.
at line line 105
string
getClientSecret()
Gets the client secret that was set in the constructor.
at line line 114
string
sign(array $payload)
Sign the payload to produce a signature for its contents.