Giter Club home page Giter Club logo

Comments (7)

ZZMarquis avatar ZZMarquis commented on July 28, 2024

BCECUtil里增加了createEcPublicKey方法,结合Sm2UtilTest里的测试代码,参考一下

from gmhelper.

shijl80 avatar shijl80 commented on July 28, 2024

BCECUtil没看到啊,是还没提交么?

from gmhelper.

ZZMarquis avatar ZZMarquis commented on July 28, 2024

提交了,你pull一下

from gmhelper.

shijl80 avatar shijl80 commented on July 28, 2024

看到了,不过还是没搞懂那个x、y是啥。
我是想先生成一对公私钥,然后把公钥HexString发给别人,用私钥来解密,暂时是用convertEcPubKeyToX509Der转了后,再写个方法把X509Der转回来成ECPublicKeyParameters。
另外,SM2Util.encryt方法名称拼写错误......

from gmhelper.

ZZMarquis avatar ZZMarquis commented on July 28, 2024

@shijl80 感谢指正错误
xy是ecc公钥的两个分量,是两个大数,在知道曲线和xy分量的情况下就可以确定一个ecc公钥

from gmhelper.

shijl80 avatar shijl80 commented on July 28, 2024

非常感谢!已经成功通过
new ECPublicKeyParameters(curve.decodePoint(ByteUtils.fromHexString(encodedPubHex)), domainParameters)
生成公钥,
通过new ECPrivateKeyParameters(new BigInteger(ByteUtils.fromHexString(priHex)), domainParameters)
生成私钥。
网上国密相关资料太少,要是有个系列的教程就好了。
已经验证SM4可以与guan zhi的那个Gmssl互相加解密。

from gmhelper.

ZZMarquis avatar ZZMarquis commented on July 28, 2024

@shijl80
嗯。我也用过guan zhi的GmSSL。原生OpenSLL-1.1.1也开始支持国密算法了,有空可以研究交流一下。
那这个issue就先关了。有别的问题可以再开issue。

from gmhelper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.