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