1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef _LINUX_ASN1_ENCODER_H
4 #define _LINUX_ASN1_ENCODER_H
6 #include <linux/types.h>
7 #include <linux/asn1.h>
8 #include <linux/asn1_ber_bytecode.h>
10 #define asn1_oid_len(oid) (sizeof(oid)/sizeof(u32))
12 asn1_encode_integer(unsigned char *data
, const unsigned char *end_data
,
15 asn1_encode_oid(unsigned char *data
, const unsigned char *end_data
,
16 u32 oid
[], int oid_len
);
18 asn1_encode_tag(unsigned char *data
, const unsigned char *end_data
,
19 u32 tag
, const unsigned char *string
, int len
);
21 asn1_encode_octet_string(unsigned char *data
,
22 const unsigned char *end_data
,
23 const unsigned char *string
, u32 len
);
25 asn1_encode_sequence(unsigned char *data
, const unsigned char *end_data
,
26 const unsigned char *seq
, int len
);
28 asn1_encode_boolean(unsigned char *data
, const unsigned char *end_data
,