Get the peer's certificate, extract and save public key
| 375 | |
| 376 | // Get the peer's certificate, extract and save public key |
| 377 | void CertManager::SetPeerKey() |
| 378 | { |
| 379 | // first cert is the peer's |
| 380 | x509* main = peerList_.front(); |
| 381 | |
| 382 | Bytes_struct cert; |
| 383 | cert.num = main->get_length(); |
| 384 | cert.data = main->set_buffer(); |
| 385 | |
| 386 | CML::Certificate cm(cert); |
| 387 | const CML::ASN::Cert& raw = cm.base(); |
| 388 | CTIL::CSM_Buffer key = raw.pubKeyInfo.key; |
| 389 | |
| 390 | uint sz; |
| 391 | opaque* key_buffer = reinterpret_cast<opaque*>(key.Get(sz)); |
| 392 | peerPublicKey_.allocate(sz); |
| 393 | peerPublicKey_.assign(key_buffer, sz); |
| 394 | } |
| 395 | |
| 396 | |
| 397 | #endif // USE_CML_LIB |
nothing calls this directly
no test coverage detected