parallaxsecond / parallaxsecond/rust-cryptoki

Construct Pkcs11 from cryptoki_sys::Pkcs11

Open
#366 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
115
Forks
96
Avg merge
22h 56m
Merged PRs (30d)
2

Description

Hi! I’d like to use cryptoki to test a PKCS11 module that is written in Rust. As far as I see, I currently have to compile the module to a binary and then load it with cryptoki::context::Pkcs11::new. Internally, this function constructs a cryptoki_sys::Pkcs11 instance from the loaded library and passes it to cryptoki::context::Pkcs11::_new. I think I should be able to construct the cryptoki_sys::Pkcs11 directly using function pointers to the Rust implementation, avoiding the additional compilation step. Would you accept a PR to make Pkcs11::_new part of the public API, maybe as Pkcs11::new_from_sys or Pkcs11::new_from_raw?

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 by reading cryptoki::context::Pkcs11::new and Pkcs11::_new, including how cryptoki_sys::Pkcs11 is passed between them. Check the surrounding context API and existing tests before deciding how the raw constructor should be exposed. Done means a Rust PKCS#11 implementation can provide function pointers and construct Pkcs11 without compiling and loading a separate binary.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
security
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.