Closed BrunoVernay closed 1 year ago
Hey, I am trying to do the same thing, would you mind sharing how you solved this? :) Thank you!
This should do it:
public_key = oscrypto.keys.parse_public(pubkey.dump())
What you are doing is dumping the ASN.1 representation of the public key to a byte string and then loading that up into an OS-specific format that can be used with asymmetric.rsa_pkcs1v15_verify().
https://github.com/wbond/oscrypto/blob/master/docs/keys.md#parse_public-function
It does not seem logical to me to get this error
TypeError: certificate_or_public_key must be an instance of the Certificate or PublicKey class, not asn1crypto.keys.PublicKeyInfo
When trying to do this:But maybe I am wrong (and I cannot find an easy way to convert PublicKeyInfo to PublicKey ....)