Miroshin Stepan
Miroshin Stepan
I'm not sure it's possible by PKCS#11 interface
If you need to get an attribute value from the private key use `getAttribute` (see [example](https://github.com/PeculiarVentures/graphene/blob/master/test/object.ts#L72-L77)) function or [PrivateKey](https://github.com/PeculiarVentures/graphene/blob/master/src/objects/keys/private.ts#L6) getters If you need a private key for the crypto operation...
@Arsira-star Try to get fields like `extractable`, `sensitive`, `mechanism`
[xmldsigjs](https://github.com/PeculiarVentures/xmldsigjs) and [xadesjs](https://github.com/PeculiarVentures/xadesjs) These modules use WebCrypto. It allows using modules on NodeJS and Browsers. If you want to use PKCS#11 token for XML signing see [node-webcrypto-p11](https://github.com/PeculiarVentures/node-webcrypto-p11). For NodeJS Crypto...
### Hashing ```typescript import * as graphene from "graphene-pk11"; const softHsm = graphene.Module.load("/usr/local/lib/softhsm/libsofthsm2.so", "SoftHSMv2"); softHsm.initialize(); try { const slot = softHsm.getSlots(0); const session = slot.open(graphene.SessionFlag.SERIAL_SESSION); const hash = session.createDigest(graphene.MechanismEnum.GOSTR3411).once(Buffer.from("message")); console.log("GOSTR3411:",...
try to sign calculated hash ```js Buffer.from("4b582bce7d059e1c7a33f05761b5685de1e00bee5338da3931f50e8763994d33", "hex") ```
I'm trying to generate the same key in SoftHSMv2, but got `CKR_TEMPLATE_INCOMPLETE` error. GOST params are required https://github.com/opendnssec/SoftHSMv2/blob/cb2ddc07432edd4d4530c5aea22195142660d6d6/src/lib/SoftHSM.cpp#L9594
Which mechanism do you use for signing and verifying? Could you share source code of signing and verifying?
it's interesting. I checked code you sent me with SoftHSM and pvpkcs11. It works for me  Could you try to use `once` instead of `update/final`?
```js var data = 'simple text 1'; data += 'simple text 2'; // sign content var sign = session.createSign('SHA1_RSA_PKCS', keys.privateKey); var signature = sign.once(data); console.log('Signature RSA-SHA1:', signature.toString('hex')); // verify content...