Skip to content

pkcs1 crate has no examples, no obvious way of using #1611

Open
@kornelski

Description

@kornelski

The docs for pkcs1 have no examples how to use the crate to decode an RsaPrivateKey.

The crate has a DecodeRsaPrivateKey trait, but pkcs1::RsaPrivateKey does not implement it? (or if it does, then only indirectly via a blanket impl on a pkcs8 feature in another crate???)

This seems very weird. Is that a mistake? Why is the type and trait in the same crate if they don't work together?

The only apparent way of creating pkcs1::RsaPrivateKey is via TryFrom<&[u8]> implementation, which is not mentioned anywhere, and the impl itself has zero documentation, so it needs diving into the crate's source code to discover it takes DER.

It's weird that the pkcs1 crate has a pem Cargo feature, and describes possibility of using PEM format, but as far as I can tell, PEM decoding is not supported by the crate.

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