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 |
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.
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.
theKey | public key to remember | |
keyObject | key Object to remember |
ContentGoneException | ||
ContentNotReadyException | ||
ErrorStateException |
void org.ccnx.ccn.impl.security.keys.PublicKeyCache.remember | ( | PublicKey | theKey, | |
CCNTime | version | |||
) |
Remember a public key.
theKey | public key to remember |
void org.ccnx.ccn.impl.security.keys.PublicKeyCache.remember | ( | Certificate | theCertificate, | |
CCNTime | version | |||
) |
Remember a certificate.
theCertificate | the certificate to remember |
void org.ccnx.ccn.impl.security.keys.PublicKeyCache.recordKeyToFile | ( | PublicKeyObject | keyObject | ) | throws ContentNotReadyException, ContentGoneException, ErrorStateException [protected] |
Write encoded key to file for debugging purposes.
ContentGoneException | ||
ContentNotReadyException | ||
ErrorStateException |
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();.
desiredKeyID | the digest of the desired public key. | |
locator | locator for the key | |
timeout | timeout value |
IOException |
PublicKey org.ccnx.ccn.impl.security.keys.PublicKeyCache.getPublicKeyFromCache | ( | PublisherPublicKeyDigest | desiredKeyID | ) |
Retrieve the public key from cache given a key digest.
desiredKeyID | the digest of the desired public key. |
PublicKeyObject org.ccnx.ccn.impl.security.keys.PublicKeyCache.retrieve | ( | PublisherPublicKeyDigest | keyID | ) |
Retrieve key object from cache given key name.
keyName | key digest |
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.
name | contentname of the key | |
publisherID | publisher id |
IOException |