Jeff Thompson | 8238d00 | 2013-07-10 11:56:49 -0700 | [diff] [blame] | 1 | /** |
| 2 | * @author: Jeff Thompson |
| 3 | * See COPYING for copyright and distribution information. |
| 4 | */ |
| 5 | |
| 6 | #ifndef NDN_BINARYXMLPUBLISHERPUBLICKEYDIGEST_H |
Jeff Thompson | 2d27e2f | 2013-08-09 12:55:00 -0700 | [diff] [blame] | 7 | #define NDN_BINARYXMLPUBLISHERPUBLICKEYDIGEST_H |
Jeff Thompson | 8238d00 | 2013-07-10 11:56:49 -0700 | [diff] [blame] | 8 | |
| 9 | #include "../errors.h" |
Jeff Thompson | 5341219 | 2013-08-06 13:35:50 -0700 | [diff] [blame] | 10 | #include "../publisher-public-key-digest.h" |
| 11 | #include "binary-xml-encoder.h" |
| 12 | #include "binary-xml-decoder.h" |
Jeff Thompson | 8238d00 | 2013-07-10 11:56:49 -0700 | [diff] [blame] | 13 | |
Jeff Thompson | 2d27e2f | 2013-08-09 12:55:00 -0700 | [diff] [blame] | 14 | #ifdef __cplusplus |
Jeff Thompson | 8238d00 | 2013-07-10 11:56:49 -0700 | [diff] [blame] | 15 | extern "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 Thompson | f0fea00 | 2013-07-30 17:22:42 -0700 | [diff] [blame] | 22 | * @param encoder pointer to the ndn_BinaryXmlEncoder struct |
Jeff Thompson | 8238d00 | 2013-07-10 11:56:49 -0700 | [diff] [blame] | 23 | * @return 0 for success, else an error code |
| 24 | */ |
Jeff Thompson | f0fea00 | 2013-07-30 17:22:42 -0700 | [diff] [blame] | 25 | ndn_Error ndn_encodeBinaryXmlPublisherPublicKeyDigest |
| 26 | (struct ndn_PublisherPublicKeyDigest *publisherPublicKeyDigest, struct ndn_BinaryXmlEncoder *encoder); |
Jeff Thompson | 8238d00 | 2013-07-10 11:56:49 -0700 | [diff] [blame] | 27 | |
| 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 Thompson | f0fea00 | 2013-07-30 17:22:42 -0700 | [diff] [blame] | 31 | * @param decoder pointer to the ndn_BinaryXmlDecoder struct |
Jeff Thompson | 8238d00 | 2013-07-10 11:56:49 -0700 | [diff] [blame] | 32 | * @return 0 for success, else an error code, including if the next element is not PublisherPublicKeyDigest. |
| 33 | */ |
Jeff Thompson | f0fea00 | 2013-07-30 17:22:42 -0700 | [diff] [blame] | 34 | ndn_Error ndn_decodeBinaryXmlPublisherPublicKeyDigest |
| 35 | (struct ndn_PublisherPublicKeyDigest *publisherPublicKeyDigest, struct ndn_BinaryXmlDecoder *decoder); |
Jeff Thompson | 8238d00 | 2013-07-10 11:56:49 -0700 | [diff] [blame] | 36 | |
Jeff Thompson | 5633c30 | 2013-07-11 10:24:27 -0700 | [diff] [blame] | 37 | /** |
| 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 Thompson | f0fea00 | 2013-07-30 17:22:42 -0700 | [diff] [blame] | 41 | * @param decoder pointer to the ndn_BinaryXmlDecoder struct |
Jeff Thompson | 5633c30 | 2013-07-11 10:24:27 -0700 | [diff] [blame] | 42 | * @return 0 for success, else an error code, including if the next element is not PublisherPublicKeyDigest. |
| 43 | */ |
Jeff Thompson | f0fea00 | 2013-07-30 17:22:42 -0700 | [diff] [blame] | 44 | ndn_Error ndn_decodeOptionalBinaryXmlPublisherPublicKeyDigest |
| 45 | (struct ndn_PublisherPublicKeyDigest *publisherPublicKeyDigest, struct ndn_BinaryXmlDecoder *decoder); |
Jeff Thompson | 5633c30 | 2013-07-11 10:24:27 -0700 | [diff] [blame] | 46 | |
Jeff Thompson | 2d27e2f | 2013-08-09 12:55:00 -0700 | [diff] [blame] | 47 | #ifdef __cplusplus |
Jeff Thompson | 8238d00 | 2013-07-10 11:56:49 -0700 | [diff] [blame] | 48 | } |
| 49 | #endif |
| 50 | |
| 51 | #endif |