Generated by JsDoc Toolkit 2.3.3-beta on Wed Nov 06 2013 17:43:37 GMT+0100 (MEZ)
HTML template: Codeview

Namespace sjcl.json

JSON encapsulation
Defined in: convenience.js.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
<static>  
sjcl.json.defaults
Default values for encryption
Method Summary
Method Attributes Method Name and Description
<static>  
sjcl.json.decode(str)
Decode a simple (flat) JSON string into a structure.
<static>  
sjcl.json.decrypt(password, ciphertext, params, rp)
Simple decryption function.
<static>  
sjcl.json.encode(obj)
Encode a flat structure into a JSON string.
<static>  
sjcl.json.encrypt(password, plaintext, params, rp)
Simple encryption function.
Namespace Detail
sjcl.json
Field Detail
<static> sjcl.json.defaults
Default values for encryption
Method Detail
<static> {Object} sjcl.json.decode(str)
Decode a simple (flat) JSON string into a structure. The ciphertext, adata, salt and iv will be base64-decoded.
Parameters:
{String} str
The string.
Throws:
{sjcl.exception.invalid}
if str isn't (simple) JSON.
Returns:
{Object} The decoded structure.
<static> {String} sjcl.json.decrypt(password, ciphertext, params, rp)
Simple decryption function.
Parameters:
{String|bitArray} password
The password or key.
{String} ciphertext
The ciphertext to decrypt.
{Object} params Optional
Additional non-default parameters.
{Object} rp Optional
A returned object with filled parameters.
Throws:
{sjcl.exception.invalid}
if a parameter is invalid.
{sjcl.exception.corrupt}
if the ciphertext is corrupt.
Returns:
{String} The plaintext.
<static> {String} sjcl.json.encode(obj)
Encode a flat structure into a JSON string.
Parameters:
{Object} obj
The structure to encode.
Throws:
{sjcl.exception.invalid}
if obj has a non-alphanumeric property.
{sjcl.exception.bug}
if a parameter has an unsupported type.
Returns:
{String} A JSON string.
<static> {String} sjcl.json.encrypt(password, plaintext, params, rp)
Simple encryption function.
Parameters:
{String|bitArray} password
The password or key.
{String} plaintext
The data to encrypt.
{Object} params Optional
The parameters including tag, iv and salt.
{Object} rp Optional
A returned version with filled-in parameters.
Throws:
{sjcl.exception.invalid}
if a parameter is invalid.
Returns:
{String} The ciphertext.