Skip to content
instance method

OpenSSL::PKey::DSA#syssign

(::String digest) -> ::String
dsa.syssign(string) → string

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.

Deprecated in version 3.0. Consider using PKey::PKey#sign_raw and PKey::PKey#verify_raw instead.

string

A message digest of the original input data to be signed.

Example:

Example
dsa = OpenSSL::PKey::DSA.new(2048)
doc = "Sign me"
digest = OpenSSL::Digest.digest('SHA1', doc)

# With legacy #syssign and #sysverify:
sig = dsa.syssign(digest)
p dsa.sysverify(digest, sig) #=> true

# With #sign_raw and #verify_raw:
sig = dsa.sign_raw(nil, digest)
p dsa.verify_raw(nil, sig, digest) #=> true
See also #set_pqg #sysverify #set_key #to_der also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0