diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2011-08-01 21:52:03 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-08-01 21:52:03 -0700 |
commit | 6d5218bc7d344b0f4e0a0cb50fdd25052946cc4f (patch) | |
tree | eee125b05ed537734d1f1ff44d1c6a987d035d61 /doc | |
parent | a6e0a91a70ed450166a2066fe2a7d6a0d3969ca9 (diff) | |
parent | c72223e2a9aae2d5c20825562657c50a644d8a59 (diff) | |
download | nodejs-6d5218bc7d344b0f4e0a0cb50fdd25052946cc4f.tar.gz nodejs-6d5218bc7d344b0f4e0a0cb50fdd25052946cc4f.tar.bz2 nodejs-6d5218bc7d344b0f4e0a0cb50fdd25052946cc4f.zip |
Merge branch 'v0.4'
Conflicts:
doc/api/crypto.markdown
doc/api/modules.markdown
src/platform_win32.cc
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/crypto.markdown | 40 | ||||
-rw-r--r-- | doc/api/http.markdown | 9 |
2 files changed, 43 insertions, 6 deletions
diff --git a/doc/api/crypto.markdown b/doc/api/crypto.markdown index 19b88c2f8..b1833b28f 100644 --- a/doc/api/crypto.markdown +++ b/doc/api/crypto.markdown @@ -57,6 +57,8 @@ This can be called many times with new data as it is streamed. Calculates the digest of all of the passed data to be hashed. The `encoding` can be `'hex'`, `'binary'` or `'base64'`. +Note: `hash` object can not be used after `digest()` method been called. + ### crypto.createHmac(algorithm, key) @@ -75,13 +77,26 @@ This can be called many times with new data as it is streamed. Calculates the digest of all of the passed data to the hmac. The `encoding` can be `'hex'`, `'binary'` or `'base64'`. +Note: `hmac` object can not be used after `digest()` method been called. + -### crypto.createCipher(algorithm, key) +### crypto.createCipher(algorithm, password) -Creates and returns a cipher object, with the given algorithm and key. +Creates and returns a cipher object, with the given algorithm and password. `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. -On recent releases, `openssl list-cipher-algorithms` will display the available cipher algorithms. +On recent releases, `openssl list-cipher-algorithms` will display the +available cipher algorithms. +`password` is used to derive key and IV, which must be `'binary'` encoded +string (See the [Buffers](buffers.html) for more information). + +### crypto.createCipheriv(algorithm, key, iv) + +Creates and returns a cipher object, with the given algorithm, key and iv. + +`algorithm` is the same as the `createCipher()`. `key` is a raw key used in +algorithm. `iv` is an Initialization vector. `key` and `iv` must be `'binary'` +encoded string (See the [Buffers](buffers.html) for more information). ### cipher.update(data, input_encoding='binary', output_encoding='binary') @@ -95,10 +110,18 @@ Returns the enciphered contents, and can be called many times with new data as i Returns any remaining enciphered contents, with `output_encoding` being one of: `'binary'`, `'base64'` or `'hex'`. -### crypto.createDecipher(algorithm, key) +Note: `cipher` object can not be used after `final()` method been called. + + +### crypto.createDecipher(algorithm, password) Creates and returns a decipher object, with the given algorithm and key. -This is the mirror of the cipher object above. +This is the mirror of the [createCipher()](#crypto.createCipher) above. + +### crypto.createDecipheriv(algorithm, key, iv) + +Creates and returns a decipher object, with the given algorithm, key and iv. +This is the mirror of the [createCipheriv()](#crypto.createCipheriv) above. ### decipher.update(data, input_encoding='binary', output_encoding='binary') @@ -110,6 +133,8 @@ The `output_decoding` specifies in what format to return the deciphered plaintex Returns any remaining plaintext which is deciphered, with `output_encoding` being one of: `'binary'`, `'ascii'` or `'utf8'`. +Note: `decipher` object can not be used after `final()` method been called. + ### crypto.createSign(algorithm) @@ -129,6 +154,9 @@ Calculates the signature on all the updated data passed through the signer. Returns the signature in `output_format` which can be `'binary'`, `'hex'` or `'base64'`. +Note: `signer` object can not be used after `sign()` method been called. + + ### crypto.createVerify(algorithm) Creates and returns a verification object, with the given algorithm. @@ -149,6 +177,8 @@ signature for the data, in the `signature_format` which can be `'binary'`, Returns true or false depending on the validity of the signature for the data and public key. +Note: `verifier` object can not be used after `verify()` method been called. + ### crypto.createDiffieHellman(prime_length) Creates a Diffie-Hellman key exchange object and generates a prime of the diff --git a/doc/api/http.markdown b/doc/api/http.markdown index 497adba55..ad102eb20 100644 --- a/doc/api/http.markdown +++ b/doc/api/http.markdown @@ -42,7 +42,7 @@ per connection (in the case of keep-alive connections). When a new TCP stream is established. `socket` is an object of type `net.Socket`. Usually users will not want to access this event. The - `stream` can also be accessed at `request.connection`. + `socket` can also be accessed at `request.connection`. ### Event: 'close' @@ -283,6 +283,8 @@ Note: that Content-Length is given in bytes not characters. The above example works because the string `'hello world'` contains only single byte characters. If the body contains higher coded characters then `Buffer.byteLength()` should be used to determine the number of bytes in a given encoding. +And Node does not check whether Content-Length and the length of the body +which has been transmitted are equal or not. ### response.statusCode @@ -294,6 +296,9 @@ Example: response.statusCode = 404; +After response header was sent to the client, this property indicates the +status code which was sent out. + ### response.setHeader(name, value) Sets a single header value for implicit headers. If this header already exists @@ -528,6 +533,8 @@ event, the entire body will be caught. }); This is a `Writable Stream`. +Note: Node does not check whether Content-Length and the length of the body +which has been transmitted are equal or not. This is an `EventEmitter` with the following events: |