Public Member Functions | List of all members
ndn::EncryptedContent Class Reference

An EncryptedContent holds an encryption type, a payload and other fields representing encrypted content. More...

#include <encrypted-content.hpp>

Public Member Functions

 EncryptedContent ()
 Create an EncryptedContent where all the values are unspecified.
 
ndn_EncryptAlgorithmType getAlgorithmType () const
 Get the algorithm type. More...
 
const KeyLocatorgetKeyLocator () const
 Get the key locator. More...
 
KeyLocatorgetKeyLocator ()
 
const BlobgetInitialVector () const
 Get the initial vector. More...
 
const BlobgetPayload () const
 Get the payload. More...
 
EncryptedContentsetAlgorithmType (ndn_EncryptAlgorithmType algorithmType)
 Set the algorithm type. More...
 
EncryptedContentsetKeyLocator (const KeyLocator &keyLocator)
 Set this object to use a copy of the given KeyLocator object. More...
 
EncryptedContentsetInitialVector (const Blob &initialVector)
 Set the initial vector. More...
 
EncryptedContentsetPayload (const Blob &payload)
 Set the encrypted payload. More...
 
Blob wireEncode (WireFormat &wireFormat=*WireFormat::getDefaultWireFormat()) const
 Encode this EncryptedContent for a particular wire format. More...
 
void wireDecode (const uint8_t *input, size_t inputLength, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
 Decode the input using a particular wire format and update this EncryptedContent. More...
 
void wireDecode (const std::vector< uint8_t > &input, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
 Decode the input using a particular wire format and update this EncryptedContent. More...
 
void wireDecode (const Blob &input, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
 Decode the input using a particular wire format and update this EncryptedContent. More...
 
void get (EncryptedContentLite &encryptedContentLite) const
 Set encryptedContentLite to point to the values in this EncryptedContent object, without copying any memory. More...
 
void set (const EncryptedContentLite &encryptedContentLite)
 Clear this EncryptedContent, and set the values by copying from encryptedContentLite. More...
 

Detailed Description

An EncryptedContent holds an encryption type, a payload and other fields representing encrypted content.

Note
This class is an experimental feature. The API may change.

Member Function Documentation

void ndn::EncryptedContent::get ( EncryptedContentLite encryptedContentLite) const

Set encryptedContentLite to point to the values in this EncryptedContent object, without copying any memory.

WARNING: The resulting pointers in encryptedContentLite are invalid after a further use of this object which could reallocate memory.

Parameters
encryptedContentLiteAn EncryptedContentLite object where the key locator name components array is already allocated.
ndn_EncryptAlgorithmType ndn::EncryptedContent::getAlgorithmType ( ) const
inline

Get the algorithm type.

Returns
The algorithm type, or -1 if not specified.
const Blob& ndn::EncryptedContent::getInitialVector ( ) const
inline

Get the initial vector.

Returns
The initial vector. If not specified, isNull() is true.
const KeyLocator& ndn::EncryptedContent::getKeyLocator ( ) const
inline

Get the key locator.

Returns
The key locator. If not specified, getType() is -1.
const Blob& ndn::EncryptedContent::getPayload ( ) const
inline

Get the payload.

Returns
The payload. If not specified, isNull() is true.
void ndn::EncryptedContent::set ( const EncryptedContentLite encryptedContentLite)

Clear this EncryptedContent, and set the values by copying from encryptedContentLite.

Parameters
encryptedContentLiteAn EncryptedContentLite object.
EncryptedContent& ndn::EncryptedContent::setAlgorithmType ( ndn_EncryptAlgorithmType  algorithmType)
inline

Set the algorithm type.

Parameters
algorithmTypeThe algorithm type. If not specified, set to -1.
Returns
This EncryptedContent so that you can chain calls to update values.
EncryptedContent& ndn::EncryptedContent::setInitialVector ( const Blob initialVector)
inline

Set the initial vector.

Parameters
initialVectorThe initial vector. If not specified, set to the default Blob() where isNull() is true.
Returns
This EncryptedContent so that you can chain calls to update values.
EncryptedContent& ndn::EncryptedContent::setKeyLocator ( const KeyLocator keyLocator)
inline

Set this object to use a copy of the given KeyLocator object.

Note
You can also call getKeyLocator and change the key locator directly.
Parameters
keyLocatorThe KeyLocator object. This makes a copy of the object. If no key locator is specified, set to a new default KeyLocator(), or to a KeyLocator with an unspecified type.
Returns
This EncryptedContent so that you can chain calls to update values.
EncryptedContent& ndn::EncryptedContent::setPayload ( const Blob payload)
inline

Set the encrypted payload.

Parameters
payloadThe encrypted payload. If not specified, set to the default Blob() where isNull() is true.
Returns
This EncryptedContent so that you can chain calls to update values.
void ndn::EncryptedContent::wireDecode ( const uint8_t *  input,
size_t  inputLength,
WireFormat wireFormat = *WireFormat::getDefaultWireFormat() 
)
inline

Decode the input using a particular wire format and update this EncryptedContent.

Parameters
inputThe input byte array to be decoded.
inputLengthThe length of input.
wireFormat(optional) A WireFormat object used to decode the input. If omitted, use WireFormat::getDefaultWireFormat().
void ndn::EncryptedContent::wireDecode ( const std::vector< uint8_t > &  input,
WireFormat wireFormat = *WireFormat::getDefaultWireFormat() 
)
inline

Decode the input using a particular wire format and update this EncryptedContent.

Parameters
inputThe input byte array to be decoded.
wireFormat(optional) A WireFormat object used to decode the input. If omitted, use WireFormat::getDefaultWireFormat().
void ndn::EncryptedContent::wireDecode ( const Blob input,
WireFormat wireFormat = *WireFormat::getDefaultWireFormat() 
)
inline

Decode the input using a particular wire format and update this EncryptedContent.

Parameters
inputThe input byte array to be decoded as an immutable Blob.
wireFormat(optional) A WireFormat object used to decode the input. If omitted, use WireFormat::getDefaultWireFormat().
Blob ndn::EncryptedContent::wireEncode ( WireFormat wireFormat = *WireFormat::getDefaultWireFormat()) const
inline

Encode this EncryptedContent for a particular wire format.

Parameters
wireFormat(optional) A WireFormat object used to encode this EncryptedContent. If omitted, use WireFormat::getDefaultWireFormat().
Returns
The encoded byte array.

The documentation for this class was generated from the following files: