Read public key
| 553 | |
| 554 | // Read public key |
| 555 | void 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 |