This structure is used for representing both node keys and group (private) keys. More...
Public Member Functions | |
PrincipalKeyDirectory (GroupAccessControlManager manager, ContentName directoryName, CCNHandle handle) throws IOException | |
Directory name should be versioned, else we pull the latest version; start enumeration. | |
PrincipalKeyDirectory (GroupAccessControlManager manager, ContentName directoryName, boolean enumerate, CCNHandle handle) throws IOException | |
Directory name should be versioned, else we pull the latest version. | |
HashMap< String, PrincipalInfo > | getCopyOfPrincipals () throws ContentNotReadyException |
Return a copy to avoid synchronization problems. | |
WrappedKeyObject | addWrappedKeyBlock (Key secretKeyToWrap, ContentName publicKeyName, PublicKey publicKey) throws ContentEncodingException, IOException, InvalidKeyException, VersionMissingException |
Store an additional link object pointing to the wrapped key object in the KeyDirectory. | |
Protected Member Functions | |
void | processNewChild (byte[] wkChildName) |
Called each time new data comes in, gets to parse it and load processed arrays. | |
void | addPrincipal (byte[] wkChildName) |
Adds a principal name. | |
KeyDirectory | factory (ContentName name) throws IOException |
WrappedKeyObject | getWrappedKeyForPrincipal (String principalName) throws ContentNotReadyException, ContentDecodingException, IOException |
Returns the wrapped key object corresponding to a specified principal. | |
ContentName | getWrappedKeyNameForPrincipal (PrincipalInfo pi) |
Returns the wrapped key name for a specified principal. | |
ContentName | getWrappedKeyNameForPrincipal (ContentName principalPublicKeyName) throws VersionMissingException, ContentEncodingException |
Returns the wrapped key name for a principal specified by the name of its public key. | |
Key | findUnwrappedKey (byte[] expectedKeyID) throws IOException, ContentNotReadyException, InvalidKeyException, ContentDecodingException, NoSuchAlgorithmException |
Key | unwrapKeyViaKnownGroupMembership () throws InvalidKeyException, ContentDecodingException, IOException, NoSuchAlgorithmException |
Key | unwrapKeyViaNotKnownGroupMembership () throws InvalidKeyException, ContentDecodingException, IOException, NoSuchAlgorithmException |
Key | unwrapKeyForPrincipal (String principal, Key unwrappingKey) throws InvalidKeyException, ContentNotReadyException, ContentDecodingException, ContentGoneException, IOException, NoSuchAlgorithmException |
Unwrap the key wrapped under a specified principal, with a specified unwrapping key. | |
Package Attributes | |
GroupAccessControlManager | _manager |
HashMap< String, PrincipalInfo > | _principals = new HashMap<String, PrincipalInfo>() |
Maps the friendly names of principals (typically groups) to their information. | |
final ReadWriteLock | _principalsLock = new ReentrantReadWriteLock() |
This structure is used for representing both node keys and group (private) keys.
We encapsulate functionality to walk such a directory and find our target key here.
We store links providing additional information about how to retrieve this key -- e.g. a link from a given group or principal name to a key ID-named block, in case a group member does not know an earlier version of their group public key. Or links to keys this key supercedes or precedes.
org.ccnx.ccn.profiles.security.access.group.PrincipalKeyDirectory.PrincipalKeyDirectory | ( | GroupAccessControlManager | manager, | |
ContentName | directoryName, | |||
CCNHandle | handle | |||
) | throws IOException |
Directory name should be versioned, else we pull the latest version; start enumeration.
manager | the access control manager. | |
directoryName | the root of the KeyDirectory. | |
handle |
IOException |
org.ccnx.ccn.profiles.security.access.group.PrincipalKeyDirectory.PrincipalKeyDirectory | ( | GroupAccessControlManager | manager, | |
ContentName | directoryName, | |||
boolean | enumerate, | |||
CCNHandle | handle | |||
) | throws IOException |
Directory name should be versioned, else we pull the latest version.
manager | the access control manager - must not be null | |
directoryName | the root of the KeyDirectory. | |
handle |
IOException |
void org.ccnx.ccn.profiles.security.access.group.PrincipalKeyDirectory.addPrincipal | ( | byte[] | wkChildName | ) | [protected] |
Adds a principal name.
wkChildName | the principal name |
WrappedKeyObject org.ccnx.ccn.profiles.security.access.group.PrincipalKeyDirectory.addWrappedKeyBlock | ( | Key | secretKeyToWrap, | |
ContentName | publicKeyName, | |||
PublicKey | publicKey | |||
) | throws ContentEncodingException, IOException, InvalidKeyException, VersionMissingException |
Store an additional link object pointing to the wrapped key object in the KeyDirectory.
The link object is named with the Principal's name to allow searching the KeyDirectory by Principal name rather than KeyID.
Reimplemented from org.ccnx.ccn.io.content.KeyDirectory.
HashMap<String, PrincipalInfo> org.ccnx.ccn.profiles.security.access.group.PrincipalKeyDirectory.getCopyOfPrincipals | ( | ) | throws ContentNotReadyException |
Return a copy to avoid synchronization problems.
ContentNotReadyException |
WrappedKeyObject org.ccnx.ccn.profiles.security.access.group.PrincipalKeyDirectory.getWrappedKeyForPrincipal | ( | String | principalName | ) | throws ContentNotReadyException, ContentDecodingException, IOException [protected] |
Returns the wrapped key object corresponding to a specified principal.
principalName | the principal. |
IOException | ||
ContentNotReadyException | ||
ContentDecodingException |
ContentName org.ccnx.ccn.profiles.security.access.group.PrincipalKeyDirectory.getWrappedKeyNameForPrincipal | ( | ContentName | principalPublicKeyName | ) | throws VersionMissingException, ContentEncodingException [protected] |
Returns the wrapped key name for a principal specified by the name of its public key.
principalPublicKeyName | the name of the public key of the principal. |
VersionMissingException | ||
ContentEncodingException |
ContentName org.ccnx.ccn.profiles.security.access.group.PrincipalKeyDirectory.getWrappedKeyNameForPrincipal | ( | PrincipalInfo | pi | ) | [protected] |
Returns the wrapped key name for a specified principal.
isGroup | whether the principal is a group. | |
principalName | the name of the principal. | |
principalVersion | the version of the principal. |
Key org.ccnx.ccn.profiles.security.access.group.PrincipalKeyDirectory.unwrapKeyForPrincipal | ( | String | principal, | |
Key | unwrappingKey | |||
) | throws InvalidKeyException, ContentNotReadyException, ContentDecodingException, ContentGoneException, IOException, NoSuchAlgorithmException [protected] |
Unwrap the key wrapped under a specified principal, with a specified unwrapping key.
principal | ||
unwrappingKey |
ContentGoneException | ||
ContentNotReadyException | ||
ContentDecodingException | ||
InvalidKeyException | ||
IOException | ||
NoSuchAlgorithmException |