Javacard上的椭圆曲线DSA-我还需要最初的内容?
我正在尝试在Javacard上实施ECDSA。到目前为止,我有此代码:
Signature sig = Signature.getInstance(Signature.ALG_ECDSA_SHA_256, false);
KeyPair key = new KeyPair(KeyPair.ALG_EC_FP, (short)256);
key.genKeyPair();
sig.init(key.Private(), Signature.MODE_SIGN);
sig.sign(data, (short)0, dataLen, outputBuf, (short)0);
当我尝试使用getk()
方法退休K时,以便我可以在APDU中发送公共密钥,我会得到错误代码6f 00。
根据文档<代码> getk()可以扔cryptoexception.uninitialized_key
如果键曲线的固定点g的“ cofactor”尚未成功初始化
'设置密钥/签名时需要初始化吗?
I am trying to implement ECDSA on JavaCard. So far I have this code:
Signature sig = Signature.getInstance(Signature.ALG_ECDSA_SHA_256, false);
KeyPair key = new KeyPair(KeyPair.ALG_EC_FP, (short)256);
key.genKeyPair();
sig.init(key.Private(), Signature.MODE_SIGN);
sig.sign(data, (short)0, dataLen, outputBuf, (short)0);
When I try to retire K using the getK()
method so that I can send the public key in an APDU I get the error code 6F 00.
According to the documentation getK()
can throw CryptoException.UNINITIALIZED_KEY
if the 'cofactor of the order of the fixed point G of the curve of the key has not been successfully initialized'
Is there something else I need to initialise when setting up the keys/signature?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要初始化域参数:A,B,G,R,K和字段。对于建议曲线的NIST列表,您可以在此处查看: https”> https: //nvlpubs.nist.gov/nistpubs/fips/nist.fips.186-4.pdf
You need to initialise the domain parameters: A,B, G, R, K and the field. For a list of NIST recommended curves you can look here: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf