Skip to content

From<RsaPrivateKey> impl for pkcs1v15::SigningKey is a footgun #556

@atro7318

Description

@atro7318

I was trying to use the rsa crate to calculate a signature with the RSASSA-PKCS1-V1_5-SIGN algorithm and fell into the trap of constructing a pkcs1v15::SigningKey using the From<RsaPrivateKey> implementation. There is no documentation that states that it calls new_unprefixed under the hood and I spent several hours debugging (assuming I was making errors elsewhere) to discover this nuance. It's a little odd to me that From<RsaPrivateKey> would use the less commonly needed constructor, but nonetheless, some documentation similar to that used on new_unprefixed on the From<RsaPrivateKey> impl would be helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions