RustCrypto / RSA

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

How to create a Sha1 Signature? #363

Closed thep0y closed 1 year ago

thep0y commented 1 year ago

Currently only Sha2 implements the AssociatedOid trait?

let signature = Pkcs1v15Sign::new::<Sha256>(); // => OK
let signature = Pkcs1v15Sign::new::<Sha1>(); // => the trait bound `Sha1Core: AssociatedOid` is not satisfied
tarcieri commented 1 year ago

You either need to enable the sha1 feature of rsa and import it as rsa::sha1::Sha1 or you need to enable the oid feature of the sha1 crate if you're importing it that way.

This will hopefully be a bit more automatic in the next release of sha1/sha2.