With TozStore securing your data is easy, as our platform and SDKs do all of the cryptography for you. Integrating TozStore is a simple process:
Create an account at the Tozny Dashboard and create your registration token here. This registration token is what lets you create your clients.
Using the SDK of your choice, create a client with your new registration token and begin writing encrypted data to TozStore.
We provide a number of SDK's in different languages, feel free to choose the one that best suits your needs.
​ | ​ |
​Python​ | ​Javascript​ |
​Ruby​ | ​Go​ |
​PHP​ | ​CLI |
​Java (Android)​ | ​iOS (Swift)​ |
Creating a client is a quick process, but remember that these credentials are private and should be handled with care. If these credentials are lost there is no way to recover your data, as we do not store them by default.
import e3db​token = 'YOUR_REGISTRATION_TOKEN_HERE'client_name = 'example name'​public_key, private_key = e3db.Client.generate_keypair()​# Register your clientclient_info = e3db.Client.register(token, client_name, public_key)​config = e3db.Config(client_info.client_id,client_info.api_key_id,client_info.api_secret,public_key,private_key)​# To save this Configuration to disk, do the following:config.write()​# Instantiate your client to communicate with TozStoreclient = e3db.Client(config())
Tozny's SDKs handle the encryption for you, all you need to provide is the data. See Record Structure for details on how you can best structure your data.
import e3db​client = e3db.Client(# config)​record_type = 'contact'data = {'first_name': 'Jon','last_name': 'Snow','phone': '555-555-1212'}​metadata = {'house' : 'Stark'}​record = client.write(record_type, data, metadata)
const e3db = require('e3db')​let client = new e3db.Client(/* config */)​async function main() {let data = {'first_name': 'Jon','last_name': 'Snow','phone': '555-555-1212',}let metadata = {'house' : 'Stark'}let record = await client.write('contact', data, metadata)​console.log('Wrote record ' + record.meta.recordId)}main()
<?php$data = ['name' => 'Jon Snow','what_he_knows' => 'Nothing',];$metadata = ['house' => 'Stark'];​// 'test-contact' represents our data type$record = $client->write('test-contact', $data, $metadata);​//record contains the newly created value$record_id = $record->meta->record_id;?>​
// Create data for a recordvar recordData map[string]stringrecordType := "contact"recordData["first_name"] = "Jon"recordData["last_name"] = "Snow"recordData["phone"] = "555-555-1212"​// Create optional metadata for the record//(metadata can be used for searching)var metadata map[string]stringmatadata["realm"] = "The North"metadata["pet"] = "Ghost"​// Encrypt and save the recordrecordID, err := client.Write(context.Background(),recordType,recordData,metadata)if err != nil {//Error handling omitted}fmt.Println("Wrote record: " + recordID)
record = client.write('contact', {:first_name => 'Jon',:last_name => 'Snow',:phone => '555-555-1212'})printf("Wrote record %s\n", record.meta.record_id)
Client client = ...; // Get a client instance​Map<String, String> lyric = new HashMap<>();lyric.put("line", "Say I'm the only bee in your bonnet");lyric.put("song", "Birdhouse in Your Soul");lyric.put("artist", "They Might Be Giants");​String recordType = "lyric";​client.write(recordType, new RecordData(lyric), null, new ResultHandler<Record>() {@Overridepublic void handle(Result<Record> r) {if(! r.isError()) {// record written successfullyRecord record = r.asValue();// Log or print record ID, e.g.:System.out.println("Record ID: " + record.meta().recordId());}else {// an error occurredthrow new RuntimeException(r.asError().other());}}});​
// Wrap message in RecordData type to designate// it as sensitive information for encryptionlet recordData = RecordData(cleartext: ["SSN": "123-45-6789"])​// Can optionally include arbitrary metadata as `plain`// where neither keys nor values are encryptede3db.write(type: "UserInfo", data: recordData, plain: ["Sent from": "my iPhone"]) { result inswitch result {​// The operation was successful, here's the recordcase .success(let record):​// `record.meta` holds metadata associated// with the record, such as type.print("Wrote record! \(record.meta.recordId)")​case .failure(let error):print("An error occurred attempting to write the data: \(error)")}}}​
Have questions? Contact us at help@tozny.com
​