libcoap 4.3.4-develop-749e16f

Internal API for CoAP ASN.1 handling. More...

+ Collaboration diagram for ASN.1 Support:

Typedefs

typedef int(* asn1_validate) (const uint8_t *data, size_t size)
 Callback to validate the asn1 tag and data. More...
 

Enumerations

enum  coap_asn1_tag_t {
  COAP_ASN1_NONE = 0 , COAP_ASN1_INTEGER = 2 , COAP_ASN1_BITSTRING = 3 , COAP_ASN1_OCTETSTRING = 4 ,
  COAP_ASN1_IDENTIFIER = 6
}
 

Functions

size_t asn1_len (const uint8_t **ptr)
 Get the asn1 length from the current ptr. More...
 
coap_asn1_tag_t asn1_tag_c (const uint8_t **ptr, int *constructed, int *cls)
 Get the asn1 tag from the current ptr. More...
 
coap_binary_tget_asn1_tag (coap_asn1_tag_t ltag, const uint8_t *ptr, size_t tlen, asn1_validate validate)
 Get the asn1 tag and data from the current ptr. More...
 
coap_binary_tget_asn1_spki (const uint8_t *data, size_t size)
 Abstract SPKI public key from the ASN1. More...
 

Detailed Description

Internal API for CoAP ASN.1 handling.

Typedef Documentation

◆ asn1_validate

typedef int(* asn1_validate) (const uint8_t *data, size_t size)

Callback to validate the asn1 tag and data.

Internal function.

Parameters
dataThe start of the tag and data
sizeThe size of the tag and data
Returns
1 if pass, else 0 if fail

Definition at line 47 of file coap_asn1_internal.h.

Enumeration Type Documentation

◆ coap_asn1_tag_t

Enumerator
COAP_ASN1_NONE 
COAP_ASN1_INTEGER 
COAP_ASN1_BITSTRING 
COAP_ASN1_OCTETSTRING 
COAP_ASN1_IDENTIFIER 

Definition at line 29 of file coap_asn1_internal.h.

Function Documentation

◆ asn1_len()

size_t asn1_len ( const uint8_t **  ptr)

Get the asn1 length from the current ptr.

Internal function.

Parameters
ptrThe current asn.1 object length pointer
Returns
The length of the asn.1 object. ptr is updated to be after the length.

Definition at line 19 of file coap_asn1.c.

+ Here is the caller graph for this function:

◆ asn1_tag_c()

coap_asn1_tag_t asn1_tag_c ( const uint8_t **  ptr,
int *  constructed,
int *  cls 
)

Get the asn1 tag from the current ptr.

Internal function.

Parameters
ptrThe current asn.1 object tag pointer
constructed1 if current tag is constructed
clsThe current class of the tag
Returns
The tag value.ptr is updated to be after the tag.

Definition at line 38 of file coap_asn1.c.

+ Here is the caller graph for this function:

◆ get_asn1_spki()

coap_binary_t * get_asn1_spki ( const uint8_t *  data,
size_t  size 
)

Abstract SPKI public key from the ASN1.

Internal function.

Parameters
dataPointer to ASN1 object containing EC Private Key
sizeLength of ASN1 object
Returns
The publick key (to be freed off by caller) or NULL if not found

Definition at line 122 of file coap_asn1.c.

+ Here is the call graph for this function:

◆ get_asn1_tag()

coap_binary_t * get_asn1_tag ( coap_asn1_tag_t  ltag,
const uint8_t *  ptr,
size_t  tlen,
asn1_validate  validate 
)

Get the asn1 tag and data from the current ptr.

Internal function.

Parameters
ltagThe tag to look for
ptrThe current asn.1 object pointer
tlenThe remaining size oof the asn.1 data
validateCall validate to verify tag data or NULL
Returns
The asn.1 tag and data (to be freed off by caller) or NULL if not found

Definition at line 65 of file coap_asn1.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: