Read ExplicitVersion, return it or 0 if not there (not an error)
| 310 | |
| 311 | // Read ExplicitVersion, return it or 0 if not there (not an error) |
| 312 | word32 BER_Decoder::GetExplicitVersion() |
| 313 | { |
| 314 | if (source_.GetError().What()) return 0; |
| 315 | |
| 316 | byte b = source_.next(); |
| 317 | |
| 318 | if (b == (CONTEXT_SPECIFIC | CONSTRUCTED)) { // not an error if not here |
| 319 | source_.next(); |
| 320 | return GetVersion(); |
| 321 | } |
| 322 | else |
| 323 | source_.prev(); // put back |
| 324 | |
| 325 | return 0; |
| 326 | } |
| 327 | |
| 328 | |
| 329 | // Decode a BER encoded RSA Private Key |