DoubleLi

qq: 517712484 wx: ldbgliet

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

string and StringSource (load):

 
  1.  
    string spki = ...;
  2.  
    StringSource ss(spki, true /*pumpAll*/);
  3.  
     
  4.  
    RSA::PublicKey publicKey;
  5.  
    publicKey.Load(ss);
 

vector and ArraySource (load):

 
  1.  
    vector<byte> spki = ...;
  2.  
    ArraySource as(&spki[0], spki.length(), true /*pumpAll*/);
  3.  
     
  4.  
    RSA::PublicKey publicKey;
  5.  
    publicKey.Load(as);
 

string and StringSink (save)

 
  1.  
    string spki;
  2.  
    StringSink ss(spki);
  3.  
     
  4.  
    RSA::PublicKey publicKey(...);
  5.  
    publicKey.Save(ss);
 
 
 
posted on 2023-06-09 15:27  DoubleLi  阅读(96)  评论(0)    收藏  举报