Closed ribose-jeffreylau closed 6 years ago
Should be easy to do now.
require 'rnp'
rnp = Rnp.new
# generate a primary key
generated = rnp.generate_key(
primary: {
type: 'RSA',
length: 1024,
userid: 'Example User',
usage: ['sign']
}
)
key = generated[:primary]
# best to add some protection before saving
key.protect('password')
# we can sign without a password, because the key is still unlocked
puts rnp.sign(input: Rnp::Input.from_string('some data to sign'),
signers: key,
armored: true)
I apologize for it taking so long. :(
Would like to use this gem to:
As I understand, keys are generated like so, like in the README:
Is signing implemented? If so, how does one go about signing a file, etc.? If not, we're very much looking forward to having this feature asap! :-) Thanks!
cc: @dewyatt