Browse files

Remove the outdated example code, add pointer to test.js instead.

  • Loading branch information...
isaacs committed Mar 24, 2010
1 parent 0f9ad50 commit 71f3395d3c39d131817577ba05f95c26302bc5e7
Showing with 1 addition and 27 deletions.
  1. +1 −27 README
@@ -19,30 +19,4 @@ base64 encoded strings.
The encrypt / decrypt methods work with binary, hex or base64 encodings,
with streaming.
-Quick example
-var sys=require("sys");
-var posix=require('posix');
-var crypto=require("./crypto");
-// Test hashing
-var h1 = (new crypto.Hash).init("sha1").update("Test123").digest("hex");
-var h2 = (new crypto.Hash).init("sha1").update("Test").update("123").digest("hex");
-// Load our public and private keys
-var keyPem ="test_key.pem").wait();
-var certPem ="test_cert.pem").wait();
-// Test signing and verifying
-var s1 = (new crypto.Sign).init("RSA-SHA256").update("Test123").sign(keyPem, "base64");
-sys.puts((new crypto.Verify).init("RSA-SHA256").update("Test").update("123").verify(certPem, s1, "base64"));
-// Test encryption and decryption
-var plaintext="Keep this a secret? No! Tell everyone about node.js!";
-var cipher=(new crypto.Cipher).init("aes192", "MySecretKey123");
-var ciph=cipher.update(plaintext, 'utf8', 'hex');'hex');
+See test.js for example usage.

0 comments on commit 71f3395

Please sign in to comment.