to_s

to_s() Instance Public methods Alias for: export

to_text

dh.to_text â aString Instance Public methods Prints all parameters of key to buffer INSECURE: PRIVATE INFORMATIONS CAN LEAK OUT!!! Don't use :-)) (I's up to you)

generate

DSA.generate(size) â dsa Class Public methods Creates a new DSA instance by generating a private/public key pair from scratch. Parameters size is an integer representing the desired key size.

new

DSA.new([size | string [, pass]) â dsa Class Public methods Creates a new DSA instance by reading an existing key from string. Parameters size is an integer representing the desired key size. string contains a DER or PEM encoded key. pass is a string that contains an optional password. Examples DSA.new -> dsa DSA.new(1024) -> dsa DSA.new(File.read('dsa.pem')) -> dsa DSA.new(File.read('dsa.pem'), 'mypassword') -> dsa

export

dsa.to_pem([cipher, password]) â aString Instance Public methods Encodes this DSA to its PEM encoding. Parameters cipher is an OpenSSL::Cipher. password is a string containing your password. Examples DSA.to_pem -> aString DSA.to_pem(cipher, 'mypassword') -> aString to_pem to_s

params

dsa.params â hash Instance Public methods Stores all parameters of key to the hash INSECURE: PRIVATE INFORMATIONS CAN LEAK OUT!!! Don't use :-)) (I's up to you)

private?

dsa.private? â true | false Instance Public methods Indicates whether this DSA instance has a private key associated with it or not. The private key may be retrieved with DSA#private_key.

public?

dsa.public? â true | false Instance Public methods Indicates whether this DSA instance has a public key associated with it or not. The public key may be retrieved with #public_key.

public_key

dsa.public_key â aDSA Instance Public methods Returns a new DSA instance that carries just the public key information. If the current instance has also private key information, this will no longer be present in the new instance. This feature is helpful for publishing the public key information without leaking any of the private information. Example dsa = OpenSSL::PKey::DSA.new(2048) # has public and private information pub_key = dsa.public_key # has only the public part available

syssign

dsa.syssign(string) â aString Instance Public methods Computes and returns the DSA signature of string, where string is expected to be an already-computed message digest of the original input data. The signature is issued using the private key of this DSA instance. Parameters string is a message digest of the original input data to be signed Example dsa = OpenSSL::PKey::DSA.new(2048) doc = "Sign me" digest = OpenSSL::Digest::SHA1.digest(doc) sig = dsa.syssign(digest)