Add definition of Sig service (#18)

This commit is contained in:
Pavel 2021-12-13 18:38:57 +03:00 committed by GitHub
parent 7ce35fdc74
commit 75a978c779
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -251,3 +251,18 @@ service Script("script"):
-- Returns a list of existing scripts on the node. -- Returns a list of existing scripts on the node.
-- Each object in the list is of the following structure -- Each object in the list is of the following structure
list() -> []ScriptInfo list() -> []ScriptInfo
service Sig("sig"):
-- Signs data with the current peer's key.
-- Can only be called on %init_peer_id%
-- Accepts data only from the following sources:
-- trust-graph.get_trust_bytes
-- trust-graph.get_revocation_bytes
-- registry.get_key_bytes
-- registry.get_record_bytes
-- Argument: data - byte array to sign
-- Returns: signature as a byte array
sign(data: []u8) -> []u8
-- Given the data and signature both as byte arrays, returns true if the signature is correct, false otherwise.
verify(signature: []u8, data: []u8) -> bool