...
Code Block |
---|
desc = engine:describeRuleset("io.picolabs.hello_world"); /* { "rid": "io.picolabs.hello_world", "src": "ruleset io.picolabs.hello_world{ ...<cut for brevity> ... }", "hash": "a096f2f3bfbd63e54bf4f39081814dbc895f3f003ae9918dbe24aec8acc097b9", "url": "https://raw.githubusercontent.com/Picolab/node-pico-engine-core/master/test-rulesets/hello-world.krl", "timestamp_stored": "2017-05-17T21:31:21.663Z", "timestamp_enable": "2017-05-17T21:31:21.663Z", "meta": { "name": "Hello World", "description": "\nA first ruleset for the Quickstart\n ", "author": "Phil Windley" } } */ |
encryptChannelMessage
Encrypt a message sent over a channel
Parameter | Datatype | Required |
---|---|---|
<eci> | <string> | YES |
<encryptedMessage> | <string> | YES |
<nonce> | <string> | YES |
<otherPublicKey> | <string> | YES |
Code Block |
---|
encrypted_message = engine:encryptChannelMessage(eci, message, subscription.other_encryption_public_key)
/*
{
"encryptedMessage" : <base 58 encrypted message>,
"nonce" : <base 58 nonce used to encrypt message>,
}
*/ |
decryptChannelMessage
Encrypt a message sent over a channel
Parameter | Datatype | Required |
---|---|---|
<eci> | <string> | YES |
<message> | <string> | YES |
<otherPublicKey> | <string> | YES |
Code Block |
---|
decrypted_message = engine:decryptChannelMessage(eci, encrypted_message, nonce, other_encryption_public_key)
/*
// The decrypted message if successfully decrypted, false otherwise
*/ |
signChannelMessage
SIgn a message sent over a channel
Parameter | Datatype | Required |
---|---|---|
<eci> | <string> | YES |
<message> | <string> | YES |
Code Block |
---|
signed_message = engine:signChannelMessage(eci, message)
/*
// Base 58 encoded string that is the signed message
*/ |
verifySignedMessage
Verify a message sent over a channel
Parameter | Datatype | Required |
---|---|---|
<verifyKey> | <string> | YES |
<message> | <string> | YES |
Code Block |
---|
verifiedMessage = engine:verifySignedMessage(verify_key, signedMessage)
/*
// The original message if verified, false otherwise
*/ |
Actions
newPico
Creates a new pico.
...