Skip to content

How can I get privatekey #128

@Arsira-star

Description

@Arsira-star

I have PrivateKey PublicKey and Certificate in HSM
I can get Certificate with no problem.
Next I need to get private key here this is my code

===========================
const fetchedPrivateKey = session.find({label: 'xxxxxxx'})
const privateKey = fetchedPrivateKey.items(0).toType()

and this is my result

PrivateKey {
handle: <Buffer 28 00 00 00 00 00 00 00>,
session:
Session {
handle: <Buffer 01 00 00 00 00 00 00 00>,
slot:
Slot {
handle: <Buffer 00 00 00 00 00 00 00 00>,
module: [Object],
slotDescription: 'Net Token Slot',
manufacturerID: 'Safenet, Inc.',
flags: 7,
hardwareVersion: [Object],
firmwareVersion: [Object] },
state: 0,
flags: 4,
deviceError: 0 }
}

I need value from "privateKey" to use with Certificate for sign
How to get that ? I don't see in example

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions