PKID is a public Key Indexed Datastore. You can save plain or encrypted data in a public key index; as long as you are the owner of the secret corresponding to that public key.
POST /{pk}/{project}/{key}
Set the value of a document corresponding to {key} inside a {project} indexed by the public key {pk}. This is only possible when sending following header; signed by the private key corresponding to {pk}.
pk is hex encoded; request data is a base64 encoded and signed;
{ "is_encrypted": true, "payload": "document value", "data_version": 1}
header is base64 encoded and signed;
{ "intent": "pkid.store", "timestamp": "epochtime"}
GET /{pk}/{project}/{key}
Get the value of a document corresponding to {key} inside a {project} indexed by the public key {pk}. There is no requirement for a security header
pk is hex encoded; response data is base64 encoded;
DELETE /{pk}/{project}/{key}
Delete the value of a document corresponding to {key} inside a {project} indexed by the public key {pk}. There is no requirement for a security header
pk is hex encoded;
DELETE /{pk}/{project}
Delete all values of documents inside a {project} indexed by the public key {pk}. There is no requirement for a security header
pk is hex encoded;
GET /{pk}/{project}
Get the keys of a {project} indexed by the public key {pk}. There is no requirement for a security header
pk is hex encoded; response data is base64 encoded;
First create config.json
check configuration
make build
First create config.json
check configuration
make run
Before building or running create config.json
.
example config.json
:
{
"port": ":3000",
"version": "v1",
"db_file": "pkid.db"
}
- Run the app
make test
- This is a go client for pkid to be able to use pkid
import "github.com/rawdaGastan/pkid/client"
privateKey, publicKey := GenerateKeyPair()
serverUrl := "http://localhost:3000"
timeout := 5 * time.Second
pkidClient := NewPkidClient(privateKey, publicKey, serverUrl, timeout)
err := pkidClient.Set("pkid", "key", "value", true)
value, err := pkidClient.Get("pkid", "key")
keys, err := pkidClient.List("pkid")
err = pkidClient.DeleteProject("pkid")
err = pkidClient.Delete("pkid", "key")
- Get the derived seed from TF login
- Generate the key pair using the derived seed
import "github.com/rawdaGastan/pkid/client"
seed := <your seed>
privateKey, publicKey, err := GenerateKeyPairUsingSeed(seed)
serverUrl := "http://localhost:3000"
timeout := 5 * time.Second
pkidClient := NewPkidClient(privateKey, publicKey, serverUrl, timeout)
...
...