org.ccnx.ccn.impl.security.keys.PublicKeyCache Class Reference

This class performs the following:

More...

List of all members.

Public Member Functions

void remember (PublicKeyObject theKey) throws ContentNotReadyException, ContentGoneException, ErrorStateException, IOException
 Remember a public key and the corresponding key object.
void remember (PublicKey theKey, CCNTime version)
 Remember a public key.
void remember (Certificate theCertificate, CCNTime version)
 Remember a certificate.
PublicKey getPublicKey (PublisherPublicKeyDigest desiredKeyID, KeyLocator locator, long timeout, CCNHandle handle) throws IOException
 Retrieve the public key from CCN given a key digest and a key locator the function blocks and waits for the public key until a certain timeout.
PublicKeyObject getPublicKeyObject (PublisherPublicKeyDigest desiredKeyID, KeyLocator locator, long timeout, CCNHandle handle) throws IOException
PublicKey getPublicKeyFromCache (PublisherPublicKeyDigest desiredKeyID)
 Retrieve the public key from cache given a key digest.
CCNTime getPublicKeyVersionFromCache (PublisherPublicKeyDigest desiredKeyID)
PublicKeyObject retrieve (PublisherPublicKeyDigest keyID)
 Retrieve key object from cache given key name.
PublicKeyObject retrieve (ContentName name, PublisherID publisherID) throws IOException
 Retrieve key object from cache given content name and publisher id check if the retrieved content has the expected publisher id.
ArrayList< Certificate > retrieveCertificates (PublisherPublicKeyDigest keyID)

Protected Member Functions

void rememberContentName (PublisherPublicKeyDigest id, ContentName name)
void rememberCertificate (PublisherPublicKeyDigest id, Certificate certificate)
void recordKeyToFile (PublicKeyObject keyObject) throws ContentNotReadyException, ContentGoneException, ErrorStateException
 Write encoded key to file for debugging purposes.

Protected Attributes

int _refCount = 0
HashMap< ContentName,
PublicKeyObject
_keyMap = new HashMap<ContentName, PublicKeyObject>()
HashMap
< PublisherPublicKeyDigest,
ArrayList< ContentName > > 
_idMap = new HashMap<PublisherPublicKeyDigest, ArrayList<ContentName>>()
HashMap
< PublisherPublicKeyDigest,
PublicKey > 
_rawKeyMap = new HashMap<PublisherPublicKeyDigest, PublicKey>()
HashMap
< PublisherPublicKeyDigest,
ArrayList< Certificate > > 
_rawCertificateMap = new HashMap<PublisherPublicKeyDigest, ArrayList<Certificate>>()
HashMap
< PublisherPublicKeyDigest,
CCNTime
_rawVersionMap = new HashMap<PublisherPublicKeyDigest, CCNTime>()

Static Protected Attributes

static final boolean _DEBUG = false

Detailed Description

This class performs the following:

This class is used by the initial KeyManager bootstrapping code. As such, it has to be very careful not to introduce a circular dependency -- to rely on parts of the network stack that need that boostrapping to be complete in order to work. At the same time, we'd like to not have to reimplement segmentation, etc, in order to cache keys; we'd like to be able to use those parts of the library. So we allow the KeyRepository to have a CCNHandle, we can use all of the library functionality to write keys once that handle is sufficiently initialized.


Member Function Documentation

PublicKey org.ccnx.ccn.impl.security.keys.PublicKeyCache.getPublicKey ( PublisherPublicKeyDigest  desiredKeyID,
KeyLocator  locator,
long  timeout,
CCNHandle  handle 
) throws IOException

Retrieve the public key from CCN given a key digest and a key locator the function blocks and waits for the public key until a certain timeout.

As a side effect, caches network storage information for this key, which can be obtained using retrieve();.

Parameters:
desiredKeyID the digest of the desired public key.
locator locator for the key
timeout timeout value
Exceptions:
IOException 
PublicKey org.ccnx.ccn.impl.security.keys.PublicKeyCache.getPublicKeyFromCache ( PublisherPublicKeyDigest  desiredKeyID  ) 

Retrieve the public key from cache given a key digest.

Parameters:
desiredKeyID the digest of the desired public key.
void org.ccnx.ccn.impl.security.keys.PublicKeyCache.recordKeyToFile ( PublicKeyObject  keyObject  )  throws ContentNotReadyException, ContentGoneException, ErrorStateException [protected]

Write encoded key to file for debugging purposes.

Exceptions:
ContentGoneException 
ContentNotReadyException 
ErrorStateException 
void org.ccnx.ccn.impl.security.keys.PublicKeyCache.remember ( Certificate  theCertificate,
CCNTime  version 
)

Remember a certificate.

Parameters:
theCertificate the certificate to remember
void org.ccnx.ccn.impl.security.keys.PublicKeyCache.remember ( PublicKey  theKey,
CCNTime  version 
)

Remember a public key.

Parameters:
theKey public key to remember
void org.ccnx.ccn.impl.security.keys.PublicKeyCache.remember ( PublicKeyObject  theKey  )  throws ContentNotReadyException, ContentGoneException, ErrorStateException, IOException

Remember a public key and the corresponding key object.

Parameters:
theKey public key to remember
keyObject key Object to remember
Exceptions:
ContentGoneException 
ContentNotReadyException 
ErrorStateException 
PublicKeyObject org.ccnx.ccn.impl.security.keys.PublicKeyCache.retrieve ( ContentName  name,
PublisherID  publisherID 
) throws IOException

Retrieve key object from cache given content name and publisher id check if the retrieved content has the expected publisher id.

Parameters:
name contentname of the key
publisherID publisher id
Exceptions:
IOException 
PublicKeyObject org.ccnx.ccn.impl.security.keys.PublicKeyCache.retrieve ( PublisherPublicKeyDigest  keyID  ) 

Retrieve key object from cache given key name.

Parameters:
keyName key digest

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