org.ccnx.ccn.io.content.PublicKeyObject Class Reference

A CCNNetworkObject subclass specialized for reading and writing PublicKeys. More...

List of all members.

Public Member Functions

 PublicKeyObject (ContentName name, PublicKey data, SaveType saveType, CCNHandle handle) throws IOException
 Write constructor.
 PublicKeyObject (ContentName name, PublicKey data, SaveType saveType, PublisherPublicKeyDigest publisher, KeyLocator locator, CCNHandle handle) throws IOException
 Write constructor.
 PublicKeyObject (ContentName name, CCNHandle handle) throws ContentDecodingException, IOException
 Read constructor.
 PublicKeyObject (ContentName name, PublisherPublicKeyDigest publisher, CCNHandle handle) throws ContentDecodingException, IOException
 Read constructor.
 PublicKeyObject (ContentObject firstBlock, CCNHandle handle) throws ContentDecodingException, IOException
 Read constructor if you already have a block.
 PublicKeyObject (ContentName name, PublicKey data, PublisherPublicKeyDigest publisher, KeyLocator locator, CCNFlowControl flowControl) throws IOException
 Internal constructor used by low-level network operations.
 PublicKeyObject (ContentName name, PublisherPublicKeyDigest publisher, CCNFlowControl flowControl) throws ContentDecodingException, IOException
 Internal constructor used by low-level network operations.
 PublicKeyObject (ContentObject firstSegment, CCNFlowControl flowControl) throws ContentDecodingException, IOException
 Internal constructor used by low-level network operations.
 PublicKeyObject (CCNNetworkObject<?extends PublicKey > other)
 Copy constructor.
ContentType contentType ()
PublicKey publicKey () throws ContentNotReadyException, ContentGoneException, ErrorStateException
PublisherPublicKeyDigest publicKeyDigest () throws ContentNotReadyException, ContentGoneException, ErrorStateException
boolean equalsKey (PublicKey otherKey) throws ContentNotReadyException, ContentGoneException, ErrorStateException
 Many cryptographic providers don't implement equals() correctly.
boolean equalsKey (PublicKeyObject otherKeyObject) throws ContentNotReadyException, ContentGoneException, ErrorStateException
boolean isSelfSigned () throws ContentNotReadyException, IOException

Static Public Member Functions

static boolean equalsKey (PublicKey thisKey, PublicKey thatKey)
static boolean isSelfSigned (ContentName versionedKeyName, PublicKey theKey, KeyLocator publisherKeyLocator)
static boolean isSelfSigned (ContentName versionedKeyName, PublisherPublicKeyDigest keyDigest, KeyLocator publisherKeyLocator)

Protected Member Functions

PublicKey readObjectImpl (InputStream input) throws ContentDecodingException, IOException
void writeObjectImpl (OutputStream output) throws ContentEncodingException, IOException

Detailed Description

A CCNNetworkObject subclass specialized for reading and writing PublicKeys.

PublicKeys are Serializable. So we could use a subclass of CCNSerializableObject to serialize them to CCN. But, we want to control their on-the-wire data format -- using their serialization interface, the output will contain metadata only readable via the Java serialization interface. We want to write raw encoded keys. So have to override the serialization behavior.

This class also serves as an example of how to write a CCNNetworkObject subclass that needs to implement its own serialization.


Constructor & Destructor Documentation

org.ccnx.ccn.io.content.PublicKeyObject.PublicKeyObject ( ContentName  name,
PublicKey  data,
SaveType  saveType,
CCNHandle  handle 
) throws IOException

Write constructor.

Parameters:
name 
data 
handle 
Exceptions:
IOException 
org.ccnx.ccn.io.content.PublicKeyObject.PublicKeyObject ( ContentName  name,
PublicKey  data,
SaveType  saveType,
PublisherPublicKeyDigest  publisher,
KeyLocator  locator,
CCNHandle  handle 
) throws IOException

Write constructor.

Parameters:
name 
data 
publisher 
locator 
handle 
Exceptions:
IOException 
org.ccnx.ccn.io.content.PublicKeyObject.PublicKeyObject ( ContentName  name,
CCNHandle  handle 
) throws ContentDecodingException, IOException

Read constructor.

Parameters:
name 
handle 
Exceptions:
ContentDecodingException 
IOException 
org.ccnx.ccn.io.content.PublicKeyObject.PublicKeyObject ( ContentName  name,
PublisherPublicKeyDigest  publisher,
CCNHandle  handle 
) throws ContentDecodingException, IOException

Read constructor.

Parameters:
name 
publisher 
handle 
Exceptions:
ContentDecodingException 
IOException 
org.ccnx.ccn.io.content.PublicKeyObject.PublicKeyObject ( ContentObject  firstBlock,
CCNHandle  handle 
) throws ContentDecodingException, IOException

Read constructor if you already have a block.

Parameters:
firstBlock 
handle 
Exceptions:
ContentDecodingException 
IOException 
org.ccnx.ccn.io.content.PublicKeyObject.PublicKeyObject ( ContentName  name,
PublicKey  data,
PublisherPublicKeyDigest  publisher,
KeyLocator  locator,
CCNFlowControl  flowControl 
) throws IOException

Internal constructor used by low-level network operations.

Don't use unless you know what you are doing.

Parameters:
name name under which to save data
data data to save when save() is called; or null if the next call will be updateInBackground()
publisher key (identity) to use to sign the content (null for default)
locator key locator to use to tell people where to find our key, should match publisher, (null for default for key)
flowControl flow controller to use for network output
Exceptions:
IOException 
org.ccnx.ccn.io.content.PublicKeyObject.PublicKeyObject ( ContentName  name,
PublisherPublicKeyDigest  publisher,
CCNFlowControl  flowControl 
) throws ContentDecodingException, IOException

Internal constructor used by low-level network operations.

Don't use unless you know what you are doing.

Parameters:
name name under which to save data
data data to save when save() is called; or null if the next call will be updateInBackground()
publisher key (identity) to use to sign the content (null for default)
locator key locator to use to tell people where to find our key, should match publisher, (null for default for key)
flowControl flow controller to use for network output
Exceptions:
IOException 
org.ccnx.ccn.io.content.PublicKeyObject.PublicKeyObject ( ContentObject  firstSegment,
CCNFlowControl  flowControl 
) throws ContentDecodingException, IOException

Internal constructor used by low-level network operations.

Don't use unless you know what you are doing.

Parameters:
name name under which to save data
data data to save when save() is called; or null if the next call will be updateInBackground()
publisher key (identity) to use to sign the content (null for default)
locator key locator to use to tell people where to find our key, should match publisher, (null for default for key)
flowControl flow controller to use for network output
Exceptions:
IOException 

Member Function Documentation

boolean org.ccnx.ccn.io.content.PublicKeyObject.equalsKey ( PublicKey  otherKey  )  throws ContentNotReadyException, ContentGoneException, ErrorStateException

Many cryptographic providers don't implement equals() correctly.

Exceptions:
ContentGoneException 
ContentNotReadyException 
ErrorStateException 

The documentation for this class was generated from the following file:
Generated on Fri May 13 16:27:46 2011 for Content-Centric Networking in Java by  doxygen 1.6.3