RustCrypto / RSA

RSA implementation in pure Rust
Apache License 2.0
536 stars 148 forks source link

how to sign message by MD5withRSA? #365

Closed aa51513 closed 1 year ago

aa51513 commented 1 year ago

I looked back and forth in the rsa crate documentation and unfortunately I didn't find anything related to it,

I think I need some help

tarcieri commented 1 year ago

I'll assume you want a PKCS#1v1.5 signature.

The rsa::pkcs1v15::SigningKey type is generic around a digest, e.g. rsa::pkcs1v15::SigningKey<md5::Md5>.

You'll need to enable the oid feature of md5 in your Cargo.toml (for now, it will be automatic in the next release):

md5 = { package = "md-5", version = "0.10", features = ["oid"] }