From 40b91d9da26ac23870ba03bba6ea6d3b0cfc3f0d Mon Sep 17 00:00:00 2001 From: technorama Date: Thu, 29 Mar 2007 17:29:03 +0000 Subject: * ext/openssl/ossl_{bn,cipher,digest,hmac,rand,pkey_{dh,dsa,rsa}}.c: Add Documentation for various methods. * ext/openssl/lib/openssl/cipher.rb: Ditto * ext/openssl/ossl_bn.c: add lshift! and rshift! methods. * ext/openssl/ossl_digest.c: GetDigestPtr() also accept a string. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/openssl/lib/openssl/cipher.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ext/openssl/lib') diff --git a/ext/openssl/lib/openssl/cipher.rb b/ext/openssl/lib/openssl/cipher.rb index 049533d06..45cf6ac93 100644 --- a/ext/openssl/lib/openssl/cipher.rb +++ b/ext/openssl/lib/openssl/cipher.rb @@ -42,12 +42,16 @@ module OpenSSL } class Cipher + # Generate, set, and return a random key. + # You must call cipher.encrypt or cipher.decrypt before calling this method. def random_key str = OpenSSL::Random.random_bytes(self.key_len) self.key = str return str end + # Generate, set, and return a random iv. + # You must call cipher.encrypt or cipher.decrypt before calling this method. def random_iv str = OpenSSL::Random.random_bytes(self.iv_len) self.iv = str -- cgit