Decode a BER encoded RSA Private Key
| 328 | |
| 329 | // Decode a BER encoded RSA Private Key |
| 330 | void 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 | |
| 348 | void RSA_Private_Decoder::ReadHeader() |
no test coverage detected