Signing using PQC
Sign using a Falcon signature
Please note that this API endpoint is provided for testing purposes and should not be used in production. The private keys used to sign the messages are owned by the PQScale team.
Sign a message with Falcon digital signature
POST
/v1/falcon/sign
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Your API key |
Request Body
Name | Type | Description |
---|---|---|
digest* | String | Message to be signed (up to 4KB, hexadecimal encoded) |
Request Examples
The request examples below are just for reference.
Remember to supply {{BASE_URL}}
and {{Your_API_key}}
in the corresponding fields.
curl 'https://{{BASE_URL}}/v1/falcon/sign' \
-H 'Authorization: {{Your_API_key}}' \
-H 'Content-Type: application/json' \
-d '{
"digest":"0x225129545244627027"
}'
var https = require('https');
var fs = require('fs');
var options = {
'method': 'POST',
'hostname': '{{BASE_URL}}',
'path': '/v1/falcon/sign',
'headers': {
'Authorization': '{{Your_API_key}}',
'Content-Type': 'application/json'
}
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = JSON.stringify({
"digest": "0x225129545244627027"
});
req.write(postData);
req.end();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "{{BASE_URL}}/v1/falcon/sign"
method := "POST"
payload := strings.NewReader(`{
"digest":"0x225129545244627027"
}`)
client := &http.Client {
CheckRedirect: func(req *http.Request, via []*http.Request) error {
return http.ErrUseLastResponse
},
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "{{Your_API_key}}")
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = reqwest::Client::builder()
.build()?;
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("Authorization", "{{Your_API_key}}".parse()?);
headers.insert("Content-Type", "application/json".parse()?);
let data = r#"{
"digest": "0x225129545244627027"
}"#;
let json: serde_json::Value = serde_json::from_str(&data)?;
let request = client.request(reqwest::Method::POST, "{{BASE_URL}}/v1/falcon/sign")
.headers(headers)
.json(&json);
let response = request.send().await?;
let body = response.text().await?;
println!("{}", body);
Ok(())
}
import requests
import json
url = "{{BASE_URL}}/v1/falcon/sign"
payload = json.dumps({
"digest": "0x225129545244627027"
})
headers = {
'Authorization': '{{Your_API_key}}',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Response examples
{
"digest": "0x68656c6c6f20425451",
"signature": "0x3963f26e759921f3566c7b54917a99fd9ad46dc023b57272dfc6ac5b47e3be996ace02d38061990431195ed8adb25cbbcdecfb1976d2009946b039c4d3a39a45dbb4f5e0134ab20bed93eaa57c162826f144bb9bac3c90ee4491266c14f66cfdb14daedea1328c21c9ca5cd8ae95090abc895ee8136693bacf9f6a9e8929388fec3dd2f525f9de7aff24389d295c7ae6aecb0802d679de585e3a35b86b48a576103309045f58dddcd61a2286c95a1b04f89fc6b1b132777ab94612a3f29db709ec44b96bb0c70fed233c93f209914a8821ed36b9d6aa53b54098c678cacf1006c9cfc136adbd9158eec28a63d3044d36ee2e6da03dfaa3424f4d15c2a026b9159e09a9395114375f9256e0aca96482c46ee6de65a72a29c923219ad70f828cab8b8e524f439430797bad0d835111245a79bb974c1347d29e66bd6c835d01539654f13f6fd8c50efdd89b7efdb8884569e5ec5162ced77b3759b5c358f3e7dbf479e2b3eb77ad14ea1c4c7a46fe6997fb457e0a7575cd3a5ac77de4b3548baf1f45b9f5a9b7d7c1bdf7bc0b36cdfda3ea878312ade4bbdd792d4b3503c52565ff269ccc6297aaee625160906bd92ddb5d8c714a1d6e5881e32e9a8ce54fc058f099bffafc8855eb5b17a64ab8cd5b03255dcca43bc5e77111d72321c1952cfda9d7f08259a23c96d16f763a387532c720352d9e2663265ba6c9558c96e19a2eaf39445b6b46df13dad9bc349e375915f2f5917953dacdb79c1af6963428a29cd195b77dbd828e6c7718ab587c26a67e9df2a3cf25a2c153dd31834c83bd4cf461019f36619220b067c360531ad18c3b6944df1378ff6f5eb9894f60a3a7e605e88eaf363d93a0818c24",
"public_key": "0x097eac4c969092ad32b6afc8b1dda68b8d617b08e363a4ad09d93688e1920d3615ce0d541c6a5ba8b655dfb2995b89bb023a1dc4f605f3cf8937c249849fa51b43c8ffb60eed555d0695317b235e00e1a3040b85e85a942f9698cd9b17deaf886e8e90aa5c4f75d01bdd0342b7faeaedb7b739aca4eee4b95c121d0644a6a17505cdb778853a73285256bfdb597d61086729a4e17b9d7213916f093b280b48208bb56dfea789cd191b0dc956763610d611407ab6039cfc005c3153daa4099a9d55078c0df44a1287db1ecb0453c9080374213f71e21b168c85c382a2f5c86722d55276807b38d8000310de0b58dfb3a042e2a683a24f8f215e29a26315a999d1c3780c8557144090a7534c9b9673d98e41188f413b4802a77069dddad32097463499f24802e049abe5c2f23016157d8090c99fc6f62428192b96695f6379fc143ac74e09e1d8b155dab2a98e55732ed5208e560b1701267735b5593a9913b969b595e71b104dba1560e42825636f9c3986316c22580025623bc984be821f811d4c888db49d283d2cc02d6e6e481ca2b31b8edc42d60a602b8e2cb45493422b8c1a63fe1aa0ba562dc27246691966117371ab427b5e785353ee3086b219cb7de86a6f704acb57ef0d6a76dcc1bb9c60bd6c0f50148eddbc92c442f59243b0397d67e8acf277ed1264009fc3513e0f4a8868b1136e0229f6ea397bca38865690c7b81d8ac3e11a375d7100fbdaaf748a748a36ea94752b993967906abd4495d7a48f16797d4dbbd29d6a7f3e6dc5e9b50c9970e895e2c6e932973176311111a237fecd9948aaf95df91752988a687369c480bed032104ebb2bd95afaaf59a1f65edf52036e2ee2aa28c06cb6be9438cc2ca4f601705cd799220df41ad10ac44d186c9bb1170c029e1d8940e4f3bc451fc5846f1ba0e28138c9e12d3471fa63bc22753d856549c0d0188cd0e3a73315b9aa9e0b93f2ada908702e3a4ce4e5a828874a9bc4c7847de787384e54570c785222812aa54ee680bf6d4dae100e90d4da582eb5dd0beca89e4f0e8fd6f7c09454e6b1e318807c66c11565cea65465a9db73b8ef1b86d5dc105e27651ac14ae8c99c3960de5d519d0d9c0b744b743b18e073c4364bb71adb2e8df380e0a3c314f28c57be05693f89b6748b9d9963992a73912efb3eb6741984c2a188c865c5fb2e1152ac86d402803aa29e7aa443176c7b04a594a349fdbe247535002a7d738855f5072b0b75584675a117123e5628b08012db"
}
If the digest
in your request body is not hexadecimal encoded, you will get a response like this:
{
"error_code": "03-00016",
"ticket_id": "dwR53h5Jzrdsmr6",
"error_message": "please make sure all field should be hexadecimal numbers, prefixed with '0x'"
}
If you send a request without a valid API key, you will get a response like this:
{
"error_code": "03-20001",
"ticket_id": "",
"error_message": "Invalidate api token. Make sure input token are equal the initial token, and it is case sensitive. Or you could try to reset token credential to get new a token certification value"
}
Last updated