本文整理汇总了C++中BER_Decoder::end_cons方法的典型用法代码示例。如果您正苦于以下问题:C++ BER_Decoder::end_cons方法的具体用法?C++ BER_Decoder::end_cons怎么用?C++ BER_Decoder::end_cons使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BER_Decoder
的用法示例。
在下文中一共展示了BER_Decoder::end_cons方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: decode_from
/*
* Decode a BER encoded CRL_Entry
*/
void CRL_Entry::decode_from(BER_Decoder& source)
{
BigInt serial_number_bn;
std::unique_ptr<CRL_Entry_Data> data(new CRL_Entry_Data);
BER_Decoder entry = source.start_cons(SEQUENCE);
entry.decode(serial_number_bn).decode(data->m_time);
data->m_serial = BigInt::encode(serial_number_bn);
if(entry.more_items())
{
entry.decode(data->m_extensions);
if(auto ext = data->m_extensions.get_extension_object_as<Cert_Extension::CRL_ReasonCode>())
{
data->m_reason = ext->get_reason();
}
else
{
data->m_reason = UNSPECIFIED;
}
}
entry.end_cons();
m_data.reset(data.release());
}
示例2: decode_from
/*
* Decode a BER encoded CRL_Entry
*/
void CRL_Entry::decode_from(BER_Decoder& source)
{
BigInt serial_number_bn;
reason = UNSPECIFIED;
BER_Decoder entry = source.start_cons(SEQUENCE);
entry.decode(serial_number_bn).decode(time);
if(entry.more_items())
{
Extensions extensions(throw_on_unknown_critical);
entry.decode(extensions);
Data_Store info;
extensions.contents_to(info, info);
reason = CRL_Code(info.get1_u32bit("X509v3.CRLReasonCode"));
}
entry.end_cons();
serial = BigInt::encode(serial_number_bn);
}