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

Method Decode

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

Decode a BER encoded RSA Private Key

Source from the content-addressed store, hash-verified

328
329// Decode a BER encoded RSA Private Key
330void RSA_Private_Decoder::Decode(RSA_PrivateKey& key)
331{
332 ReadHeader();
333 if (source_.GetError().What()) return;
334 // public
335 key.SetModulus(GetInteger(Integer().Ref()));
336 key.SetPublicExponent(GetInteger(Integer().Ref()));
337
338 // private
339 key.SetPrivateExponent(GetInteger(Integer().Ref()));
340 key.SetPrime1(GetInteger(Integer().Ref()));
341 key.SetPrime2(GetInteger(Integer().Ref()));
342 key.SetModPrime1PrivateExponent(GetInteger(Integer().Ref()));
343 key.SetModPrime2PrivateExponent(GetInteger(Integer().Ref()));
344 key.SetMultiplicativeInverseOfPrime2ModPrime1(GetInteger(Integer().Ref()));
345}
346
347
348void RSA_Private_Decoder::ReadHeader()

Callers 6

asn.cppFile · 0.45
AgreeMethod · 0.45
InitializeMethod · 0.45
InitializeMethod · 0.45
InitializeMethod · 0.45
VerifyMethod · 0.45

Calls 15

SetPublicExponentMethod · 0.80
SetPrivateExponentMethod · 0.80
SetPrime1Method · 0.80
SetPrime2Method · 0.80
SetSubGroupOrderMethod · 0.80
SetSubGroupGeneratorMethod · 0.80
SetPublicPartMethod · 0.80
SetPrivatePartMethod · 0.80
SetPMethod · 0.80

Tested by

no test coverage detected