Comments (7)
Oh, hi there! I guess you could say I've mostly moved on from contributing here. The work I was doing that motivated my contributions was OBE, and the general frustration with Oasis' silence about licensing stalling #66 was a little more than I was interested in dealing with for what was intended to be a fun side project.
I think this change is mostly orthogonal to my earlier changes. Those were to remove an argument that didn't really make sense. The bool was the closest match for a replacement type for what was left. But it wasn't an opinionated choice.
I'd say among the proposed choices I prefer two functions.
Without advocating one way or another for it, I'll also mention that some APIs will opt for a marker type here. A good example of this pattern is openssl's PKey
struct which is generic over empty Private
and Public
types. A private key can do anything a public key can but the reverse isn't true. Likewise here with RW sessions being able to do anything a RO session can. Just something to consider.
from rust-cryptoki.
Hmm, I don't particularly like the bool, but an enum just for this seems like overkill. What would you think if I just removed the parameter and introduced another method, open_read_write_session
(or open_rw_session
...)?
from rust-cryptoki.
I'm fine with either suggestion as they are both more obvious than the current bool
. As "rw" is used by the PKCS#11 standard itself as an abbreviation I would be fine with that (e.g. ulMaxRwSessionCount
and CKS_RW_PUBLIC_SESSION
).
from rust-cryptoki.
Thanks @vkkoskie, that's a sad story, and very useful interesting API design feedback, thanks!
from rust-cryptoki.
The generic approach sounds good, but beyond my bandwidth right now :( I can do the "two functions" for now and change it to a generic-based solution for a later release when I get some free time, or I can let someone else take this over?
from rust-cryptoki.
That someone wouldn't be me as I don't have the bandwidth to take this on at the moment.
from rust-cryptoki.
Apologies for the delay. I've implemented the "two methods" approach in #101 , will look at maybe implementing the generics approach after I get up to speed following the summer lull.
Let me know if that approach seems sensible to you.
from rust-cryptoki.
Related Issues (20)
- Remove psa_crypto dependency
- Vendored mechanisms HOT 1
- Expose more fine-grained control over `find_objects` HOT 4
- RSA OAEP interface is unsound HOT 6
- Underlying library access / vendor extensions HOT 5
- `#[hsm_test]` attribute/macro HOT 9
- Session Pool Management HOT 1
- Set homepage in GitHub project info HOT 1
- Missing constants for x86_64-unknown-linux-gnu HOT 6
- Function name as part of errors HOT 3
- Force cache flush? HOT 5
- `get_attributes()` with AttributeType::Class fails for private key with YubiHSM2 Nano HOT 4
- Add `is_initialized()` to `Pkcs11` HOT 1
- How to test for supported functions? HOT 4
- Signing with RSA-PSS does not hash the message with the given function HOT 4
- EDDSA contrib HOT 1
- Digest HOT 2
- Add support for SHA-based KDFs for ECDH HOT 1
- Thread safety? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust-cryptoki.