libcoap 4.3.5-develop-fe41b51
Loading...
Searching...
No Matches
coap_asn1_internal.h
Go to the documentation of this file.
1/*
2 * coap_asn1_internal.h -- ASN.1 functions for libcoap
3 *
4 * Copyright (C) 2020-2026 Jon Shallow <supjps-libcoap@jpshallow.com>
5 *
6 * SPDX-License-Identifier: BSD-2-Clause
7 *
8 * This file is part of the CoAP library libcoap. Please see README for terms
9 * of use.
10 */
11
17#ifndef COAP_ASN1_INTERNAL_H_
18#define COAP_ASN1_INTERNAL_H_
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
39
50typedef int (*asn1_validate)(const uint8_t *data, size_t size);
51
63size_t asn1_len(const uint8_t **ptr, size_t *plen);
64
78coap_asn1_tag_t asn1_tag_c(const uint8_t **ptr, size_t *plen, int *constructed, int *cls);
79
93coap_binary_t *get_asn1_tag(coap_asn1_tag_t ltag, const uint8_t *ptr,
94 size_t tlen, asn1_validate validate);
95
107coap_binary_t *get_asn1_spki(const uint8_t *data, size_t size);
108
111#ifdef __cplusplus
112}
113#endif
114
115#endif /* COAP_ASN1_INTERNAL_H_ */
size_t asn1_len(const uint8_t **ptr, size_t *plen)
Get the asn1 length from the current ptr.
Definition coap_asn1.c:19
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.
Definition coap_asn1.c:88
coap_asn1_tag_t
coap_binary_t * get_asn1_spki(const uint8_t *data, size_t size)
Abstract SPKI public key from the ASN1.
Definition coap_asn1.c:153
int(* asn1_validate)(const uint8_t *data, size_t size)
Callback to validate the asn1 tag and data.
coap_asn1_tag_t asn1_tag_c(const uint8_t **ptr, size_t *plen, int *constructed, int *cls)
Get the asn1 tag from the current ptr.
Definition coap_asn1.c:49
@ COAP_ASN1_NONE
@ COAP_ASN1_OCTETSTRING
@ COAP_ASN1_INTEGER
@ COAP_ASN1_BITSTRING
@ COAP_ASN1_FAIL
@ COAP_ASN1_IDENTIFIER
CoAP binary data definition.
Definition coap_str.h:57