-
Hey, pub fn create_key_pair() -> Result<(),()> {
let (pkcs111,slit) = init_pins();
let session = pkcs111.open_rw_session(slit).unwrap();
session.login(cryptoki::session::UserType::User, Some("1234"));
let class = ObjectClass::PUBLIC_KEY;
let pub_template = Attribute::Class(class);
let publickeyhandle = session.find_objects(&[pub_template]).unwrap()[0];
let new_pub_key = session.get_attributes(publickeyhandle, &[AttributeType::Value]).unwrap();
} Now how do I use |
Beta Was this translation helpful? Give feedback.
Answered by
wiktor-k
Mar 28, 2023
Replies: 1 comment 1 reply
-
Maybe this snippet taken from tests would help? https://github.com/parallaxsecond/rust-cryptoki/blob/main/cryptoki/tests/basic.rs#L184-L191 |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
shivam560
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Maybe this snippet taken from tests would help?
https://github.com/parallaxsecond/rust-cryptoki/blob/main/cryptoki/tests/basic.rs#L184-L191