p2ps.imp.group.certificates
Class GroupPeerCertificateAuthority

java.lang.Object
  extended byp2ps.imp.group.certificates.GroupPeerCertificateAuthority
All Implemented Interfaces:
MessageListener

public class GroupPeerCertificateAuthority
extends java.lang.Object
implements MessageListener

The GroupPeerCertificateAuthority is an intermediate certificate authority, authorized by the GroupCertificateAuthority to sign group membership applications. When a new connection to the membership pipe is received the following occurs:

1 - The connecting peer sends a certificate signing request to the GroupPeerCertificateAuthority for signing.

2 - If the GroupPeerCertificateAuthority accepts the membership application a signed certificate chain in the PKCS#7 format is returned, otherwise a rejection message is returned.

Version:
$Revision: 295 $
Author:
Ian Wang

Constructor Summary
GroupPeerCertificateAuthority()
          Constructs a temporary group peer ca that is deleted when the peer is terminated.
GroupPeerCertificateAuthority(java.io.File[] certchain, int groupcert, java.io.File conffile, char[] password)
          Constructs a group peer ca based on the specified ca certificate chain and configuration file.
GroupPeerCertificateAuthority(Identity identity, java.io.File parent, char[] password)
          Constructs a group peer ca with the specified identity.
 
Method Summary
 void addMembershipPipe(InputPipe inpipe)
          Adds a membership pipe to the GroupPeerCertificateAuthority
 void authorizeGroupPeer(GroupCertificateAuthority groupauth)
          Authorizes the GroupPeerCertificateAuthority to act as a intermediate certificate authority for the specified group
 GroupAdvertisement createGroupAdvertisement(Peer peer)
          Convenience method that generates a template group advertisement for the group handled by this GroupPeerCertificateAuthority.
 java.lang.String getAuthorizationType()
           
 java.lang.String getGroupID()
           
 java.io.File[] getGroupPeerCertificateChain()
           
 java.net.URI[] getMembershipPipeURI()
           
 void messageReceived(MessageReceivedEvent event)
          Called when a message is received by the pipe
 void removeMembershipPipe(InputPipe inpipe)
          Adds a membership pipe to the GroupPeerCertificateAuthority
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupPeerCertificateAuthority

public GroupPeerCertificateAuthority(java.io.File[] certchain,
                                     int groupcert,
                                     java.io.File conffile,
                                     char[] password)
                              throws java.io.FileNotFoundException,
                                     java.io.IOException
Constructs a group peer ca based on the specified ca certificate chain and configuration file. It is assumed that the file structure required by the configuration already exists.

Parameters:
certchain - the specified ca certificate chain (must include group peer ca certificate at index 0)
groupcert - the index of the group certificate in the certificate chain
conffile - the openssl configuration file
password - the group certificate password

GroupPeerCertificateAuthority

public GroupPeerCertificateAuthority(Identity identity,
                                     java.io.File parent,
                                     char[] password)
                              throws java.io.IOException
Constructs a group peer ca with the specified identity. If the ca file structure and certificates already exist then these are adopted, otherwise a new file structure and keys are generated.


GroupPeerCertificateAuthority

public GroupPeerCertificateAuthority()
                              throws java.io.IOException
Constructs a temporary group peer ca that is deleted when the peer is terminated.

Method Detail

authorizeGroupPeer

public void authorizeGroupPeer(GroupCertificateAuthority groupauth)
                        throws java.io.IOException
Authorizes the GroupPeerCertificateAuthority to act as a intermediate certificate authority for the specified group

Throws:
java.io.IOException

getGroupPeerCertificateChain

public java.io.File[] getGroupPeerCertificateChain()
Returns:
the certificate chain for the group peer ca (includes group peer ca certificate at index 0)

getGroupID

public java.lang.String getGroupID()
Returns:
the group id

getAuthorizationType

public java.lang.String getAuthorizationType()
Returns:
the authorization type handled by this certificate authority

addMembershipPipe

public void addMembershipPipe(InputPipe inpipe)
Adds a membership pipe to the GroupPeerCertificateAuthority


removeMembershipPipe

public void removeMembershipPipe(InputPipe inpipe)
Adds a membership pipe to the GroupPeerCertificateAuthority


getMembershipPipeURI

public java.net.URI[] getMembershipPipeURI()
Returns:
a list of the membership pipe uri

createGroupAdvertisement

public GroupAdvertisement createGroupAdvertisement(Peer peer)
                                            throws java.io.IOException
Convenience method that generates a template group advertisement for the group handled by this GroupPeerCertificateAuthority. Creates a new GroupAdvertisement using the peers AdvertisementFactory, then populates the AuthorizationType, Group ID and Membership Pipe URIs. Note that the Name and Group Service URIs are not set.

Throws:
java.io.IOException

messageReceived

public void messageReceived(MessageReceivedEvent event)
Called when a message is received by the pipe

Specified by:
messageReceived in interface MessageListener