Lockbox 3 load public key not possible - stream reading error

后端 未结 2 1314
耶瑟儿~
耶瑟儿~ 2020-12-20 08:55

Well i generated a keypair with openssl

openssl genrsa -des3 -out _private.pem 1024

openssl rsa -pubout -in _private.pem -out public.pem

P

相关标签:
2条回答
  • 2020-12-20 09:22

    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

    0 讨论(0)
  • 2020-12-20 09:42

    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]);
    
    0 讨论(0)
提交回复
热议问题