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

Method GetKey

extra/yassl/taocrypt/src/asn.cpp:555–583  ·  view source on GitHub ↗

Read public key

Source from the content-addressed store, hash-verified

553
554// Read public key
555void CertDecoder::GetKey()
556{
557 if (source_.GetError().What()) return;
558
559 GetSequence();
560 keyOID_ = GetAlgoId();
561
562 if (keyOID_ == RSAk) {
563 byte b = source_.next();
564 if (b != BIT_STRING) {
565 source_.SetError(BIT_STR_E);
566 return;
567 }
568 b = source_.next(); // length, future
569 b = source_.next();
570 while(b != 0)
571 b = source_.next();
572 }
573 else if (keyOID_ == DSAk)
574 ; // do nothing
575 else {
576 source_.SetError(UNKNOWN_OID_E);
577 return;
578 }
579
580 StoreKey();
581 if (keyOID_ == DSAk)
582 AddDSA();
583}
584
585
586// Save public key

Callers 5

rsa_testFunction · 0.45
ValidateSelfSignatureMethod · 0.45
ValidateSignatureMethod · 0.45
CopyCaCertMethod · 0.45
ValidateMethod · 0.45

Calls 4

WhatMethod · 0.45
GetErrorMethod · 0.45
nextMethod · 0.45
SetErrorMethod · 0.45

Tested by 1

rsa_testFunction · 0.36