blob: a64900392558f4ad6794f7687d623a454ad50418 [file] [log] [blame]
Jeff Thompson8238d002013-07-10 11:56:49 -07001/**
2 * @author: Jeff Thompson
3 * See COPYING for copyright and distribution information.
4 */
5
6#ifndef NDN_BINARYXMLPUBLISHERPUBLICKEYDIGEST_H
Jeff Thompson2d27e2f2013-08-09 12:55:00 -07007#define NDN_BINARYXMLPUBLISHERPUBLICKEYDIGEST_H
Jeff Thompson8238d002013-07-10 11:56:49 -07008
9#include "../errors.h"
Jeff Thompson53412192013-08-06 13:35:50 -070010#include "../publisher-public-key-digest.h"
11#include "binary-xml-encoder.h"
12#include "binary-xml-decoder.h"
Jeff Thompson8238d002013-07-10 11:56:49 -070013
Jeff Thompson2d27e2f2013-08-09 12:55:00 -070014#ifdef __cplusplus
Jeff Thompson8238d002013-07-10 11:56:49 -070015extern "C" {
16#endif
17
18/**
19 * Encode the ndn_PublisherPublicKeyDigest struct using Binary XML. If publisherPublicKeyDigest->publisherPublicKeyDigest or
20 * publisherPublicKeyDigestLength is 0, then do nothing.
21 * @param publisherPublicKeyDigest pointer to the ndn_PublisherPublicKeyDigest struct
Jeff Thompsonf0fea002013-07-30 17:22:42 -070022 * @param encoder pointer to the ndn_BinaryXmlEncoder struct
Jeff Thompson8238d002013-07-10 11:56:49 -070023 * @return 0 for success, else an error code
24 */
Jeff Thompsonf0fea002013-07-30 17:22:42 -070025ndn_Error ndn_encodeBinaryXmlPublisherPublicKeyDigest
26 (struct ndn_PublisherPublicKeyDigest *publisherPublicKeyDigest, struct ndn_BinaryXmlEncoder *encoder);
Jeff Thompson8238d002013-07-10 11:56:49 -070027
28/**
29 * Expect the next element to be a Binary XML PublisherPublicKeyDigest and decode into the ndn_PublisherPublicKeyDigest struct.
30 * @param publisherPublicKeyDigest pointer to the ndn_PublisherPublicKeyDigest struct
Jeff Thompsonf0fea002013-07-30 17:22:42 -070031 * @param decoder pointer to the ndn_BinaryXmlDecoder struct
Jeff Thompson8238d002013-07-10 11:56:49 -070032 * @return 0 for success, else an error code, including if the next element is not PublisherPublicKeyDigest.
33 */
Jeff Thompsonf0fea002013-07-30 17:22:42 -070034ndn_Error ndn_decodeBinaryXmlPublisherPublicKeyDigest
35 (struct ndn_PublisherPublicKeyDigest *publisherPublicKeyDigest, struct ndn_BinaryXmlDecoder *decoder);
Jeff Thompson8238d002013-07-10 11:56:49 -070036
Jeff Thompson5633c302013-07-11 10:24:27 -070037/**
38 * Peek the next element and if it is a Binary XML PublisherPublicKeyDigest and decode into the ndn_PublisherPublicKeyDigest struct.
39 * Otherwise, set the ndn_PublisherPublicKeyDigest struct to none.
40 * @param publisherPublicKeyDigest pointer to the ndn_PublisherPublicKeyDigest struct
Jeff Thompsonf0fea002013-07-30 17:22:42 -070041 * @param decoder pointer to the ndn_BinaryXmlDecoder struct
Jeff Thompson5633c302013-07-11 10:24:27 -070042 * @return 0 for success, else an error code, including if the next element is not PublisherPublicKeyDigest.
43 */
Jeff Thompsonf0fea002013-07-30 17:22:42 -070044ndn_Error ndn_decodeOptionalBinaryXmlPublisherPublicKeyDigest
45 (struct ndn_PublisherPublicKeyDigest *publisherPublicKeyDigest, struct ndn_BinaryXmlDecoder *decoder);
Jeff Thompson5633c302013-07-11 10:24:27 -070046
Jeff Thompson2d27e2f2013-08-09 12:55:00 -070047#ifdef __cplusplus
Jeff Thompson8238d002013-07-10 11:56:49 -070048}
49#endif
50
51#endif