I was wondering if I'd be able to do as the subject line says with this library.
Namely, I'm trying to replicate some Ruby code: Base64.strict_encode64(keypair.sign(OpenSSL::Digest::SHA256.new, "string")). I'm, specifically, looking at the keypair.sign(OpenSSL::Digest::SHA256.new, "string") part, right now.
Is there a way to do that with this library?
Also of curiosity, does it provide Base64 as well? I worked on my own module of it not that long ago but I could just use this library's if I'm able to do the signing with it.
Thanks for any help!
I was wondering if I'd be able to do as the subject line says with this library.
Namely, I'm trying to replicate some Ruby code: `Base64.strict_encode64(keypair.sign(OpenSSL::Digest::SHA256.new, "string"))`. I'm, specifically, looking at the `keypair.sign(OpenSSL::Digest::SHA256.new, "string")` part, right now.
Is there a way to do that with this library?
Also of curiosity, does it provide Base64 as well? I worked on my own module of it not that long ago but I could just use this library's if I'm able to do the signing with it.
Thanks for any help!
And there's now a complete sign/verify example in the manual, in the "Public-Key Cryptography" section.
HTH!
It's veeery late, but yes, you can do that with this library.
To compute a hash, use `sha256` from `(guix hash)`, as in:
```scheme
(use-modules (gcrypt hash) (rnrs bytevectors))
(sha256 (string->utf8 "Some string."))
```
And there's now a complete sign/verify example in the manual, in the "Public-Key Cryptography" section.
HTH!
I was wondering if I'd be able to do as the subject line says with this library.
Namely, I'm trying to replicate some Ruby code:
Base64.strict_encode64(keypair.sign(OpenSSL::Digest::SHA256.new, "string"))
. I'm, specifically, looking at thekeypair.sign(OpenSSL::Digest::SHA256.new, "string")
part, right now.Is there a way to do that with this library?
Also of curiosity, does it provide Base64 as well? I worked on my own module of it not that long ago but I could just use this library's if I'm able to do the signing with it.
Thanks for any help!
It's veeery late, but yes, you can do that with this library.
To compute a hash, use
sha256
from(guix hash)
, as in:And there's now a complete sign/verify example in the manual, in the "Public-Key Cryptography" section.
HTH!