MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / SetPeerKey

Method SetPeerKey

extra/yassl/src/cert_wrapper.cpp:377–394  ·  view source on GitHub ↗

Get the peer's certificate, extract and save public key

Source from the content-addressed store, hash-verified

375
376// Get the peer's certificate, extract and save public key
377void 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

Callers

nothing calls this directly

Calls 6

set_bufferMethod · 0.80
GetMethod · 0.80
frontMethod · 0.45
get_lengthMethod · 0.45
allocateMethod · 0.45
assignMethod · 0.45

Tested by

no test coverage detected