#1 [[Question]] Signing a Private RSA Key with SHA256 and a String?

已關閉
WammKD6 年之前創建 · 1 條評論

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!
civodul 評論 2 年之前'
協同者

It's veeery late, but yes, you can do that with this library.

To compute a hash, use sha256 from (guix hash), as in:

(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!

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!
civodul2 年之前 關閉
登入 才能加入這對話。
未選擇標籤
未選擇里程碑
未指派成員
2 參與者
正在加載...
取消
保存
尚未有任何內容