Want to be notified of new releases in legalthings/lto-api.php?
Signing and addresses work both for the (private) event chain as for the public chain.
Properties that are specified will be verified. Properties that are omitted will be generated where possible.
You can use $account->encryptFor($account, $message); to encrypt a message for yourself.
You can use $account->decryptFrom($account, $message); to decrypt a message from yourself.
Note: You need to add an identity as first event on the chain. This is not done automatically.
You need the chain id and the hash of the last event to use an existing chain.
Signing HTTP Messages is described IETF draft draft-cavage-http-signatures-10.
The HTTP Authentication library can be used to sign and verify PSR-7 requests.
This library can be used in conjunction with the HTTP authentication library. The keyId should be the base58 encoded public key.
For POST and PUT requests, it's recommended to create an HTTP Digest (RFC 3230). This is a hash of the body, which manages to indirectly include the body in the signature. See the HTTP Digest library.
Create server middleware to verify incoming requests.
The LTO\Account\ServerMiddleware can be used to set the account attribute for a server request that contains a signature_key_id attribute.
The server middleware implements the PSR-15 MiddlewareInterface for single pass support and returns a callback for double pass with the asDoublePass() method.
Create client middleware to sign outgoing requests.
Get the seed from stdin to generate account info.
$ vendor/bin/lto-seed <<< "manage manual recall harvest series desert melt police rose hollow moral pledge kitten position add"
By default a mainnet (L) address is generated. Pass T as argument to create a testnet address.
$ vendor/bin/lto-seed T <<< "manage manual recall harvest series desert melt police rose hollow moral pledge kitten position add"
Show account info from the secret key. The secret key should be base58 encoded.
By default a mainnet (L) address is generated. Pass T as third argument to create a testnet address.
Sign a message (from stdin). The secret key should be base58 encoded. Outputs the signature and hash (base58 encoded).