@@ -207,7 +207,7 @@ ossl_pem_passwd_cb(char *buf, int max_len, int flag, void *pwd_)
207207
208208 while (1 ) {
209209 /*
210- * when the flag is nonzero, this passphrase
210+ * when the flag is nonzero, this password
211211 * will be used to perform encryption; otherwise it will
212212 * be used to perform decryption.
213213 */
@@ -674,23 +674,21 @@ ossl_crypto_fixed_length_secure_compare(VALUE dummy, VALUE str1, VALUE str2)
674674 *
675675 * key = OpenSSL::PKey::RSA.new 2048
676676 *
677- * open 'private_key.pem', 'w' do |io| io.write key.to_pem end
678- * open 'public_key.pem', 'w' do |io| io.write key.public_key.to_pem end
677+ * File.write 'private_key.pem', key.private_to_pem
678+ * File.write 'public_key.pem', key.public_to_pem
679679 *
680680 * === Exporting a Key
681681 *
682682 * Keys saved to disk without encryption are not secure as anyone who gets
683683 * ahold of the key may use it unless it is encrypted. In order to securely
684- * export a key you may export it with a pass phrase .
684+ * export a key you may export it with a password .
685685 *
686686 * cipher = OpenSSL::Cipher.new 'aes-256-cbc'
687- * pass_phrase = 'my secure pass phrase goes here'
687+ * password = 'my secure password goes here'
688688 *
689- * key_secure = key.export cipher, pass_phrase
689+ * key_secure = key.private_to_pem cipher, password
690690 *
691- * open 'private.secure.pem', 'w' do |io|
692- * io.write key_secure
693- * end
691+ * File.write 'private.secure.pem', key_secure
694692 *
695693 * OpenSSL::Cipher.ciphers returns a list of available ciphers.
696694 *
@@ -710,13 +708,13 @@ ossl_crypto_fixed_length_secure_compare(VALUE dummy, VALUE str1, VALUE str2)
710708 *
711709 * === Loading an Encrypted Key
712710 *
713- * OpenSSL will prompt you for your pass phrase when loading an encrypted key.
714- * If you will not be able to type in the pass phrase you may provide it when
711+ * OpenSSL will prompt you for your password when loading an encrypted key.
712+ * If you will not be able to type in the password you may provide it when
715713 * loading the key:
716714 *
717715 * key4_pem = File.read 'private.secure.pem'
718- * pass_phrase = 'my secure pass phrase goes here'
719- * key4 = OpenSSL::PKey.read key4_pem, pass_phrase
716+ * password = 'my secure password goes here'
717+ * key4 = OpenSSL::PKey.read key4_pem, password
720718 *
721719 * == RSA Encryption
722720 *
@@ -909,12 +907,12 @@ ossl_crypto_fixed_length_secure_compare(VALUE dummy, VALUE str1, VALUE str2)
909907 * not readable by other users.
910908 *
911909 * ca_key = OpenSSL::PKey::RSA.new 2048
912- * pass_phrase = 'my secure pass phrase goes here'
910+ * password = 'my secure password goes here'
913911 *
914- * cipher = OpenSSL::Cipher.new 'aes-256-cbc'
912+ * cipher = 'aes-256-cbc'
915913 *
916914 * open 'ca_key.pem', 'w', 0400 do |io|
917- * io.write ca_key.export (cipher, pass_phrase )
915+ * io.write ca_key.private_to_pem (cipher, password )
918916 * end
919917 *
920918 * === CA Certificate
0 commit comments