instance method
OpenSSL::PKey::DSA#syssign
(::String digest) -> ::String
dsa.syssign(string) → string
ext/openssl/lib/openssl/pkey.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/ext/openssl/lib/openssl/pkey.rb, line 250
def syssign(string)
q or raise PKeyError, "incomplete DSA"
private? or raise PKeyError, "Private DSA key needed!"
sign_raw(nil, string)
end
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