libtropic
C library for TROPIC01 chip

◆ asn1der_find_object()

lt_ret_t asn1der_find_object ( const uint8_t *  stream,
uint16_t  len,
int32_t  obj_id,
uint8_t *  buf,
int  buf_len,
enum asn1der_crop_kind_t  crop_kind 
)
Parameters
streamByte stream with X509 certificate to be parsed
lenLength of the certificate in the byte-stream
obj_id3-byte OBJECT_IDENTIFIER to be searched for
bufBuffer where to copy the found object value
buf_lenSize of the buffer pointed to by "buf"
crop_kindIf size of the found object is bigger than "buf" buffer, the only part of the object is copied to "buf". ASN1DER_CROP_SUFFIX - Crop Suffix , copy to "buf" from 0 to "buf_len" - 1 ASN1DER_CROP_PREFIX - Crop Prefix, copy to "buf" from N - buf_len to N - 1 where N is length of the object being sampled.
Returns
lt_ret_t LT_OK if sucessfull (and the object was found) LT_CERT_STORE_INVALID if the stream does not contain valid ASN1 syntax LT_CERT_UNSUPPORTED if the ASN1 stream contains features unsupported by this parser LT_CERT_ITEM_NOT_FOUND if OBJECT_IDENTIFIER with "obj_id" value was not found!