4 * @brief Interface of der_decoder_t.
9 * Copyright (C) 2006 Martin Willi
10 * Hochschule fuer Technik Rapperswil
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 #ifndef DER_DECODER_H_
24 #define DER_DECODER_H_
27 #include <asn1/asn1.h>
29 typedef struct der_decoder_t der_decoder_t
;
32 * @brief Decode ASN1 DER encoded chunks.
35 * - der_decoder_create()
41 struct der_decoder_t
{
44 * @brief Decode a chunk of bytes to a data structure
46 * @param der_decoder calling object
47 * @param input chunk of data to decode
48 * @param output data structure where decoded data is written
53 * - or SUCCESS sometimes
55 status_t (*decode
) (der_decoder_t
*this, chunk_t input
, void *output
);
58 * @brief Destroys a der_decoder object.
60 * @param der_decoder calling object
62 void (*destroy
) (der_decoder_t
*this);
67 * @brief Create a der_decoder instance.
69 * The instance needs ASN1 rules to know how to decode
72 * @param rules set of ASN1 coding rules
73 * @return der_decoder_t object
77 der_decoder_t
* der_decoder_create(asn1_rule_t
* rules
);
79 #endif /* DER_DECODER_H_ */