This class represents a keygen (public / private key generator) found in a Form. The field will automatically generate a key pair and compute its own value to match the challenge. Call key to access the public/private key pair.
Generates a key pair and sets the field’s value.
# File lib/mechanize/form/keygen.rb, line 26 def generate_key(key_size = 2048) # Spec at http://dev.w3.org/html5/spec/Overview.html#the-keygen-element @key = OpenSSL::PKey::RSA.new key_size @spki.public_key = @key.public_key @spki.sign @key, OpenSSL::Digest::MD5.new self.value = @spki.to_pem end
Generated with the Darkfish Rdoc Generator 2.