The following Ruby signature examples use the OpenSSL cryptography toolkit.
Signing data using RSA private key with PKCS1 v1.5 padding and SHA256 hash:
def sign_data(key, data)
Decrypt a package using RSA private key with PKCS1-OAEP padding:
def verify_sign(key, signature, data)
# Verifies with a public key that the data was signed with their private key
pubkey = key.public_key
if pubkey.verify(OpenSSL::Digest::SHA256.new, signature, data)
puts 'the signature is valid'
puts 'the signature is invalid'
LaunchKey links to user contributed code as a resource to its community. LaunchKey does not in any way
guarantee or warrant the quality and security of these code bases. User contributed code is supported by the
creators. If you do find a link from the site to user contributed code that is malicious or inappropriate in any
way, please report that link to LaunchKey immediately and we will investigate the claim. Submit any issue to
LaunchKey support at https://launchkey.com./support.