Lockbox 3 load public key not possible - stream reading error

梦想与她 提交于 2019-11-29 13:01:14

In my experience, LockBox 3 needs a PKCS#1 public key when working with OpenSSL generated keys. You must convert the public key to PKCS#1 before Lockbox3 can load it. (OpenSSL generates a PKCS#8 key). Use the RSAPublicKey keyword.

openssl rsa -pubin -in yourpublickey -RSAPublicKey_out -out publicpkcs1

https://www.openssl.org/docs/apps/rsa.html

http://lockbox.seanbdurkin.id.au/tiki-view_forum_thread.php?comments_parentId=298&display=print

After loading the stream you should reset it to the beginning before handing it over to LoadKeysFromStream.

  //====Signatory1=====================
  Signatory1.Codec :=codecRSA;
  //===Load public key=============
  f.Position := 0;
  Signatory1.LoadKeysFromStream(f, [partPrivate]);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!