This closure only allows returning errors of type der::Error. However, the closure's sole argument is an x509_cert::builder::CertificateBuilder, the methods for which (in particular CertificateBuilder::add_extension) all return x509_cert::builder::Error. The latter contains der::Error as a sub-error, but we can't represent all of the builder's errors in that.
The extensions closure in Certificate::generate_self_signed should be changed to return Result<_, x509_cert::builder::Error> instead of der::Result.
https://github.com/iqlusioninc/yubikey.rs/blob/0a90dc3ca8217d728064cbd23335091976636e46/src/certificate.rs#L109-L112
This closure only allows returning errors of type
der::Error
. However, the closure's sole argument is anx509_cert::builder::CertificateBuilder
, the methods for which (in particularCertificateBuilder::add_extension
) all returnx509_cert::builder::Error
. The latter containsder::Error
as a sub-error, but we can't represent all of the builder's errors in that.The
extensions
closure inCertificate::generate_self_signed
should be changed to returnResult<_, x509_cert::builder::Error>
instead ofder::Result
.