HTTPSig
- Full name:
\Zotlabs\Web\HTTPSig
See Also:
- https://tools.ietf.org/html/draft-cavage-http-signatures-10 -
Methods
generate_digest_header
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$body |
string | The value to create the digest for |
$alg |
string | hash algorithm (one of 'sha256','sha512') |
Return Value:
The generated digest header string for $body
See Also:
- https://tools.ietf.org/html/rfc5843 -
find_headers
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed | |
$body |
mixed |
verify
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed | |
$key |
mixed | |
$keytype |
mixed |
get_key
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$key |
mixed | |
$keytype |
mixed | |
$id |
mixed | |
$force |
mixed |
convertKey
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$key |
mixed |
get_activitystreams_key
public static get_activitystreams_key(string $id, bool $force = false, mixed $delete = false): bool|array
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$id |
string | |
$force |
bool | (optional, default false) |
$delete |
mixed |
Return Value:
false if no pub key found, otherwise return an array with the pub key
get_webfinger_key
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$id |
string | |
$force |
bool | (optional, default false) |
Return Value:
false if no pub key found, otherwise return an array with the pub key
get_zotfinger_key
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$id |
string | |
$force |
bool | (optional, default false) |
Return Value:
false if no pub key found, otherwise return an array with the public key
create_sig
public static create_sig(array $head, string $prvkey, string $keyid = EMPTY_STR, bool $auth = false, string $alg = 'sha256', array $encryption = false): array
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$head |
array | |
$prvkey |
string | |
$keyid |
string | (optional, default '') |
$auth |
bool | (optional, default false) |
$alg |
string | (optional, default 'sha256') |
$encryption |
array | [ 'key', 'algorithm' ] or false |
set_headers
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$headers |
array |
sign
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$head |
array | |
$prvkey |
string | |
$alg |
string | (optional) default 'sha256' |
parse_sigheader
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$header |
string |
Return Value:
associate array with - \e string \b keyID - \e string \b algorithm - \e array \b headers - \e string \b signature
decrypt_sigheader
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$header |
string | |
$prvkey |
string | (optional), if not set use site private key |
Return Value:
associative array, empty string if failue - \e string \b iv - \e string \b key - \e string \b alg - \e string \b data
Automatically generated on 2025-03-19