Wrapped Key Deposit
REST Api operation which deposits a Record ID and optional "wrapped" symmetric key into a user's account.
Synopsis
Submit
PUT /<RESTServletPath>/<AccountID>/<RecordID>.wrappedkey HTTP/1.1 Host: <RESTHost:RESTPort> Content-Length: <ContentLength>
Fields:
- RESTServletPath
- Path to the REST Servlet on the host. Example: records
- RESTHost
- IP address of Shared Records server. Example: sra.sharedrecords.org
- RESTPort
- Network port of the Shared Records server. Example: 8080
- AccountID
- The ID of the account into which the record is being deposited.
- RecordID
- The unique ID of the stored record. (The SHA1 hash of the stored data)
Headers:
- Content-Type
- A standard MIME type describing the format of the contents. If none is provided, the default is binary/octet-stream. For encrypted records the content type should always be binary/octet-stream. For unencrypted records the server will store this type and honor it when the record is returned to the client.
- Content-Length
- The length, in bytes, of the optional encryption key contained in the body.
Body:
The body of the http-put can contain the bytes of the symmetric key associated with the shared record. The key itself should be encrypted using the target user's public key.
Response
HTTP/1.1 100 Continue HTTP/1.1 200 OK Content-Type: text/html; charset=iso-8859-1 Content-Length: 0
Examples
Command-line
The following command-line example uses the common unix utility "curl" to share a record with an other user's account.
$ curl --verbose --upload-file mysymkey.pem.enc \ http://sra.sharedrecords.org/records/ \ faa5eb2862ec3b42701f8d8a60d2ac134ee0e2cf/fa701df930cfd3be7d4fc058675952d0b90008fd.wrappedkey
Note: the "\" character is used to indicate that the line continues. To copy-and-paste this command, remove those characters and remove whitespace in the URI.
