blob: 2d76205b39c68dfa7a520a028447139fe8637479 [file] [log] [blame]
Jeff Thompson8238d002013-07-10 11:56:49 -07001/**
Jeff Thompson7687dc02013-09-13 11:54:07 -07002 * Copyright (C) 2013 Regents of the University of California.
3 * @author: Jeff Thompson <jefft0@remap.ucla.edu>
Jeff Thompson8238d002013-07-10 11:56:49 -07004 * See COPYING for copyright and distribution information.
5 */
6
7#ifndef NDN_BINARYXMLPUBLISHERPUBLICKEYDIGEST_H
Jeff Thompson2d27e2f2013-08-09 12:55:00 -07008#define NDN_BINARYXMLPUBLISHERPUBLICKEYDIGEST_H
Jeff Thompson8238d002013-07-10 11:56:49 -07009
10#include "../errors.h"
Jeff Thompson53412192013-08-06 13:35:50 -070011#include "../publisher-public-key-digest.h"
12#include "binary-xml-encoder.h"
13#include "binary-xml-decoder.h"
Jeff Thompson8238d002013-07-10 11:56:49 -070014
Jeff Thompson2d27e2f2013-08-09 12:55:00 -070015#ifdef __cplusplus
Jeff Thompson8238d002013-07-10 11:56:49 -070016extern "C" {
17#endif
18
19/**
20 * Encode the ndn_PublisherPublicKeyDigest struct using Binary XML. If publisherPublicKeyDigest->publisherPublicKeyDigest or
21 * publisherPublicKeyDigestLength is 0, then do nothing.
22 * @param publisherPublicKeyDigest pointer to the ndn_PublisherPublicKeyDigest struct
Jeff Thompsonf0fea002013-07-30 17:22:42 -070023 * @param encoder pointer to the ndn_BinaryXmlEncoder struct
Jeff Thompson8238d002013-07-10 11:56:49 -070024 * @return 0 for success, else an error code
25 */
Jeff Thompsonf0fea002013-07-30 17:22:42 -070026ndn_Error ndn_encodeBinaryXmlPublisherPublicKeyDigest
27 (struct ndn_PublisherPublicKeyDigest *publisherPublicKeyDigest, struct ndn_BinaryXmlEncoder *encoder);
Jeff Thompson8238d002013-07-10 11:56:49 -070028
29/**
30 * Expect the next element to be a Binary XML PublisherPublicKeyDigest and decode into the ndn_PublisherPublicKeyDigest struct.
31 * @param publisherPublicKeyDigest pointer to the ndn_PublisherPublicKeyDigest struct
Jeff Thompsonf0fea002013-07-30 17:22:42 -070032 * @param decoder pointer to the ndn_BinaryXmlDecoder struct
Jeff Thompson8238d002013-07-10 11:56:49 -070033 * @return 0 for success, else an error code, including if the next element is not PublisherPublicKeyDigest.
34 */
Jeff Thompsonf0fea002013-07-30 17:22:42 -070035ndn_Error ndn_decodeBinaryXmlPublisherPublicKeyDigest
36 (struct ndn_PublisherPublicKeyDigest *publisherPublicKeyDigest, struct ndn_BinaryXmlDecoder *decoder);
Jeff Thompson8238d002013-07-10 11:56:49 -070037
Jeff Thompson5633c302013-07-11 10:24:27 -070038/**
39 * Peek the next element and if it is a Binary XML PublisherPublicKeyDigest and decode into the ndn_PublisherPublicKeyDigest struct.
40 * Otherwise, set the ndn_PublisherPublicKeyDigest struct to none.
41 * @param publisherPublicKeyDigest pointer to the ndn_PublisherPublicKeyDigest struct
Jeff Thompsonf0fea002013-07-30 17:22:42 -070042 * @param decoder pointer to the ndn_BinaryXmlDecoder struct
Jeff Thompson5633c302013-07-11 10:24:27 -070043 * @return 0 for success, else an error code, including if the next element is not PublisherPublicKeyDigest.
44 */
Jeff Thompsonf0fea002013-07-30 17:22:42 -070045ndn_Error ndn_decodeOptionalBinaryXmlPublisherPublicKeyDigest
46 (struct ndn_PublisherPublicKeyDigest *publisherPublicKeyDigest, struct ndn_BinaryXmlDecoder *decoder);
Jeff Thompson5633c302013-07-11 10:24:27 -070047
Jeff Thompson2d27e2f2013-08-09 12:55:00 -070048#ifdef __cplusplus
Jeff Thompson8238d002013-07-10 11:56:49 -070049}
50#endif
51
52#endif