Four operations are currently supported in both online and offline versions:
Online Encryption
Create Key: POST passphrase
Get Messages: GET token,passphrase
Send Message: PUT token, message, [files]
Delete Key: DELETE token, passphrase
Offline Encryption
Upload Key: POST publickey, privatekey (optional) privatekeyhash
Get Encrypted Messages: GET token,privatekeyhash
Send Encrypted Message: PUT token, encryptedmessage,encryptionkey
Delete Key: DELETE token, privatekeyhash
The sample implementation below uses jQuery and knockout.js. The
service supports
CORS,
so you can call it from any URL without the need for JSONP.
The response format (xml or json) can be specified in requests using either the
Accept header or adding "format=" to the request URI.
If no response format is specified, JSON is the default.
Response status codes are: 200 (OK), 304 (No messages sent), 400 (Invalid operation)
and 500 (Server error).
Versioning:
If you do not send a version string, the latest version is assumed. If your are
consuming the service from an application you should append v={version} as a paramater.
The current version is 1.
POST:
(Alternative: send publickey as a parameter for offline decryption.)
PUT:
(Files can be sent as form data; offline encryption support coming soon.)