Show
Ignore:
Timestamp:
01/25/11 08:51:55 (2 years ago)
Author:
ahu
Message:

'multi-algorithm support' - for now we still only do RSA, but the whole signer stuff has been abstracted out, and we could in theory add KnapsackCRC32 code!
Or of course ECDSA or GOST ;-)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/pdnssec.cc

    r1894 r1905  
    201201    BOOST_FOREACH(DNSSECKeeper::keyset_t::value_type value, keyset) { 
    202202      cout<<"ID = "<<value.second.id<<" ("<<(value.second.keyOrZone ? "KSK" : "ZSK")<<"), tag = "<<value.first.getDNSKEY().getTag(); 
    203       cout<<", algo = "<<(int)value.first.d_algorithm<<", bits = "<<value.first.d_key.getConstContext().len*8<<"\tActive: "<<value.second.active<< endl; // humanTime(value.second.beginValidity)<<" - "<<humanTime(value.second.endValidity)<<endl; 
     203      cout<<", algo = "<<(int)value.first.d_algorithm<<", bits = "<<value.first.getKey()->getBits()<<"\tActive: "<<value.second.active<< endl; // humanTime(value.second.beginValidity)<<" - "<<humanTime(value.second.endValidity)<<endl; 
    204204      if(value.second.keyOrZone) { 
    205205        cout<<"KSK DNSKEY = "<<zone<<" IN DNSKEY "<< value.first.getDNSKEY().getZoneRepresentation() << endl; 
     
    414414    unsigned int id=atoi(cmds[2].c_str()); 
    415415    DNSSECPrivateKey dpk=dk.getKeyById(zone, id); 
    416     cout << dpk.d_key.convertToISC(dpk.d_algorithm) <<endl; 
     416    cout << dpk.getKey()->convertToISC(dpk.d_algorithm) <<endl; 
    417417  }   
    418418  else if(cmds[0]=="import-zone-key-pem") { 
     
    434434    B64Decode(interim, raw); 
    435435    DNSSECPrivateKey dpk; 
    436     getRSAKeyFromPEMString(&dpk.d_key.getContext(), raw); 
     436    DNSKEYRecordContent drc; 
     437    shared_ptr<DNSPrivateKey> key(DNSPrivateKey::fromPEMString(drc, raw)); 
     438    dpk.setKey(key); 
    437439     
    438440    dpk.d_algorithm = atoi(cmds[3].c_str()); 
     
    467469    string fname=cmds[2]; 
    468470    DNSSECPrivateKey dpk; 
    469     DNSKEYRecordContent drc = getRSAKeyFromISC(&dpk.d_key.getContext(), fname.c_str()); 
     471    DNSKEYRecordContent drc; 
     472    shared_ptr<DNSPrivateKey> key(DNSPrivateKey::fromISCFile(drc, fname.c_str())); 
     473    dpk.setKey(key); 
    470474    dpk.d_algorithm = drc.d_algorithm; 
    471475