Closed lcmgh closed 11 months ago
Hi!
I tried to extend this test to make it sign a claim with rsa256:
https://github.com/mikkyang/rust-jwt/blob/a09172fcbf667db7a982c787ff709c6d6294ef18/src/algorithm/openssl.rs#L129C1-L140 but sign_with_key neither accepts the pem bytes or PKey::private_key_from_pem(pem).unwrap();
sign_with_key
PKey::private_key_from_pem(pem).unwrap();
How can I get the key from within this test to be accepted by Token::new(header, claims).sign_with_key(&pem).unwrap(); ?
Token::new(header, claims).sign_with_key(&pem).unwrap();
I checked the code and found impl SigningAlgorithm for PKeyWithDigest<Private> so I had to pass over algorithm
impl SigningAlgorithm for PKeyWithDigest<Private>
algorithm
let algorithm = PKeyWithDigest { digest: MessageDigest::sha256(), key: key.clone(), };
Hi!
I tried to extend this test to make it sign a claim with rsa256:
https://github.com/mikkyang/rust-jwt/blob/a09172fcbf667db7a982c787ff709c6d6294ef18/src/algorithm/openssl.rs#L129C1-L140 but
sign_with_key
neither accepts the pem bytes orPKey::private_key_from_pem(pem).unwrap();
How can I get the key from within this test to be accepted by
Token::new(header, claims).sign_with_key(&pem).unwrap();
?