-
-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GOST examples #106
Comments
Hashingimport * 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:", hash.toString("hex")); // GOSTR3411: 4b582bce7d059e1c7a33f05761b5685de1e00bee5338da3931f50e8763994d33
}
finally {
softHsm.finalize();
} Unfortunately PR is appreciated |
I'm using Rutoken ECP 2.0
|
try to sign calculated hash Buffer.from("4b582bce7d059e1c7a33f05761b5685de1e00bee5338da3931f50e8763994d33", "hex") |
I'm trying to generate the same key in SoftHSMv2, but got |
It finally worked this way:
It seems that only "once" sign option available, and it should take GOSTR3411 hash. "CKR_TEMPLATE_INCOMPLETE" seems to happen only when I try to generate keys outside token: "token: false". It seems that the token can generate this only by its hardware means. Thanks for the help, I think everyone will like to see all GOST examples, including encrypt/decrypt. |
Here https://dev.rutoken.ru/pages/viewpage.action?pageId=13795364
How to I set them? |
Hi. Can you please provide GOST signing / hashing / encryption exaples?
The text was updated successfully, but these errors were encountered: