本文整理汇总了C++中BER_Decoder::more_items方法的典型用法代码示例。如果您正苦于以下问题:C++ BER_Decoder::more_items方法的具体用法?C++ BER_Decoder::more_items怎么用?C++ BER_Decoder::more_items使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BER_Decoder
的用法示例。
在下文中一共展示了BER_Decoder::more_items方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sequence
/*
* Decode a BER encoded DistinguishedName
*/
void X509_DN::decode_from(BER_Decoder& source)
{
MemoryVector<byte> bits;
source.start_cons(SEQUENCE)
.raw_bytes(bits)
.end_cons();
BER_Decoder sequence(bits);
while(sequence.more_items())
{
BER_Decoder rdn = sequence.start_cons(SET);
while(rdn.more_items())
{
OID oid;
ASN1_String str;
rdn.start_cons(SEQUENCE)
.decode(oid)
.decode(str)
.verify_end()
.end_cons();
add_attribute(oid, str.value());
}
}
dn_bits = bits;
}
示例2: 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());
}
示例3: decode_from
/*
* Decode a BER encoded CRL_Entry
*/
void CRL_Entry::decode_from(BER_Decoder& source)
{
BigInt serial_number_bn;
source.start_cons(SEQUENCE)
.decode(serial_number_bn)
.decode(time);
if(source.more_items())
{
Extensions extensions(throw_on_unknown_critical);
source.decode(extensions);
Data_Store info;
extensions.contents_to(info, info);
reason = CRL_Code(info.get1_u32bit("X509v3.CRLReasonCode"));
}
serial = BigInt::encode(serial_number_bn);
}