Giter VIP home page Giter VIP logo

Comments (8)

hcldan avatar hcldan commented on June 14, 2024

hmm... the dll says it's for pkcs11 2.20... i guess that attribute isn't in that spec.

from rust-cryptoki.

wiktor-k avatar wiktor-k commented on June 14, 2024

I'm not sure if you can query these attributes directly. IIUC you need to first get the X.509 certificate object from the card (for example using this object class: https://docs.rs/cryptoki/latest/cryptoki/object/struct.ObjectClass.html#associatedconstant.CERTIFICATE) and then parse the X.509 cert to get the field you want (the last part is outside of this library's scope).

Does it answer your question or am I completely wrong? 😅

from rust-cryptoki.

hcldan avatar hcldan commented on June 14, 2024

@wiktor-k That's interesting. I am going to try to go that route, as my options are rather limited.

FWIW, it looks like in pkcs11 2.40 those attributes are defined and should work. But I found the driver I have only supports pkcs11 2.20 (which does not define those attributes)

from rust-cryptoki.

hcldan avatar hcldan commented on June 14, 2024

@wiktor-k I have the object_handle for the cert... how do I get the bytes?
edit: nevermind, I found it.

from rust-cryptoki.

wiktor-k avatar wiktor-k commented on June 14, 2024

I think you used Attribute::Value right? (In general it's good to paste your solution for the next person that has the same problem 😅 )

from rust-cryptoki.

hcldan avatar hcldan commented on June 14, 2024

@wiktor-k Yes, I was actually hoping to wrap things up with my task and contribute a few examples.

Is that something that would be welcome? Is there a good place to put them?

from rust-cryptoki.

wiktor-k avatar wiktor-k commented on June 14, 2024

Yep, most certainly! I was just today casually browsing documentation and the lack of doctests saddens me 😔

I think adding examples to functions would be the best. Just in case you need inspiration see our "sister" repo: https://docs.rs/tss-esapi/latest/tss_esapi/struct.Context.html#method.ecdh_z_gen

You can file a PR and then we can iteratively improve what you have there 😊

from rust-cryptoki.

hcldan avatar hcldan commented on June 14, 2024

@wiktor-k Sent a pr. I'm not sure the doctests will work well seeing as you need a library to init the card.

from rust-cryptoki.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.