RustCrypto / RustCrypto/formats

pkcs8: better `no_alloc` support for `DecodePrivateKey`/`EncodePrivateKey` traits

Open
#2,307 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
338
Forks
188
Avg merge
4d 6h
Merged PRs (30d)
15

Description

I am punting on these for the forthcoming v0.11 release, but the next time we do make breaking changes it would be nice to get them resolved:

  • PEM decoding: currently the whole pem feature enables alloc, but it would be nice to support no_alloc decoding by way of the DecodePrivateKey trait, especially as the der crate is capable of on-the-fly PEM decoding
  • Encoding: currently the whole EncodePrivateKey trait is gated on alloc, but it would be nice to support a no_alloc encoder for both DER and PEM that can write into a supplied buffer and return a slice

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the DecodePrivateKey and EncodePrivateKey traits and the der crate's on-the-fly PEM decoding capability. Define how PEM decoding can avoid alloc and how DER and PEM encoding can write into a supplied buffer; done means both traits support the requested no_alloc paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cryptography
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.