/* * Read a BER encoded X.509 object */ void X509_Object::decode_from(BER_Decoder& from) { from.start_cons(SEQUENCE) .start_cons(SEQUENCE) .raw_bytes(m_tbs_bits) .end_cons() .decode(m_sig_algo) .decode(m_sig, BIT_STRING) .end_cons(); force_decode(); }
/* * Try to decode the actual information */ void X509_Object::do_decode() { try { force_decode(); } catch(Decoding_Error& e) { throw Decoding_Error(m_PEM_label_pref + " decoding failed (" + e.what() + ")"); } catch(Invalid_Argument& e) { throw Decoding_Error(m_PEM_label_pref + " decoding failed (" + e.what() + ")"); } }
/* * Try to decode the actual information */ void EAC_Signed_Object::do_decode() { try { force_decode(); } catch(Decoding_Error& e) { const std::string what = e.what(); throw Decoding_Error(PEM_label_pref + " decoding failed (" + what + ")"); } catch(Invalid_Argument& e) { const std::string what = e.what(); throw Decoding_Error(PEM_label_pref + " decoding failed (" + what + ")"); } }