p2ps.imp.group.certificates
Class GroupCertificateAuthority

java.lang.Object
  extended byp2ps.imp.group.certificates.GroupCertificateAuthority

public class GroupCertificateAuthority
extends java.lang.Object

A class that provides a certificate authority for a group. This class uses openssl to create a group certificate and to sign certificates for intermediate group peer certificate authorities.

Version:
$Revision: 295 $
Author:
Ian Wang

Field Summary
static int DEFAULT_CERT_DAYS
           
static int DEFAULT_CRL_DAYS
           
static java.lang.String DEFAULT_MESSAGE_DIGEST
           
 
Constructor Summary
GroupCertificateAuthority()
          Constructs a temporary group ca that is deleted when the peer is terminated.
GroupCertificateAuthority(java.io.File[] certchain, java.io.File conffile, char[] password)
          Constructs a group ca based on the specified ca certificate chain and configuration file.
GroupCertificateAuthority(Identity identity, java.io.File parent, char[] password)
          Constructs a group ca with the specified identity.
 
Method Summary
 void authorizeGroupPeer(java.io.File certreq, java.io.File certfile)
          Authorizes a group peer to act as an intermediate certificate authority
 void dispose()
           
 java.io.File[] getGroupCertificateChain()
           
 java.lang.String getGroupID()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CERT_DAYS

public static final int DEFAULT_CERT_DAYS
See Also:
Constant Field Values

DEFAULT_CRL_DAYS

public static final int DEFAULT_CRL_DAYS
See Also:
Constant Field Values

DEFAULT_MESSAGE_DIGEST

public static final java.lang.String DEFAULT_MESSAGE_DIGEST
See Also:
Constant Field Values
Constructor Detail

GroupCertificateAuthority

public GroupCertificateAuthority(java.io.File[] certchain,
                                 java.io.File conffile,
                                 char[] password)
                          throws java.io.FileNotFoundException,
                                 java.io.IOException
Constructs a group 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 group ca certificate chain (must include group ca certificate at index 0)
conffile - the openssl configuration file
password - the group certificate password

GroupCertificateAuthority

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


GroupCertificateAuthority

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

Method Detail

authorizeGroupPeer

public void authorizeGroupPeer(java.io.File certreq,
                               java.io.File certfile)
                        throws java.io.IOException
Authorizes a group peer to act as an intermediate certificate authority

Parameters:
certreq - the certificate request file
certfile - the group peer certificate file
Throws:
java.io.IOException

getGroupCertificateChain

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

getGroupID

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

dispose

public void dispose()