com.Sericon.ProductAgents.AutoSSLAgent
Class ProductRegistrationAgentKeystore

java.lang.Object
  extended by com.Sericon.ProductAgents.AutoSSLAgent.ProductRegistrationAgent
      extended by com.Sericon.ProductAgents.AutoSSLAgent.ProductRegistrationAgentKeystore

public class ProductRegistrationAgentKeystore
extends ProductRegistrationAgent

ProductRegistrationAgentKeystore is one of the main classes of the AutoSSL Agent, and may be instantiated by an application that wishes to connect to an AutoSSL Server in order to provision an SSL certificate. ProductRegistrationAgentCSR should be used by an application that wishes to delegate all of the control of the provisioning of an SSL certificate to the ProductRegistrationAgentCSR.

ProductRegistrationAgentKeystore is responsible for:

Finally, the ProductRegistrationAgentKeystore is responsible to periodically contact the Naming Server (a service of the AutoSSL Server) to ensure that the resolution of its DNS name is properly updated, especially if the network that the application runs on has a dynamic IP address.

For information on an alternate main class for the AutoSSL Agent, please see:

See Also:
ProductRegistrationAgentCSR

Constructor Summary
ProductRegistrationAgentKeystore(StatusCheck statusCheck, java.lang.String autosslServerHost, int autosslServerPort, java.lang.String productName, java.lang.String productVersion, java.lang.String storedInfoDirectory, java.util.Locale locale)
          Construct a ProductRegistrationAgent
 
Method Summary
 KeystoreAccess getKeystore()
          Gets an object to give access to all aspects of the Keystore.
 void provisionSSLCertificate(java.lang.String reservationID, AuthorizationInfo authorizationInfo, BasicCustomerInfo customerInfo, int numYears)
          Registers this application with the AutoSSL Server and provisions a trusted, signed SSL certificate to that application.
 void renewSSLCertificate(AuthorizationInfo authorizationInfo, BasicCustomerInfo customerInfo, int numYears)
          Renews a certificate that's about to expire.
 
Methods inherited from class com.Sericon.ProductAgents.AutoSSLAgent.ProductRegistrationAgent
applicationFinished, daysUntilCertificateExpires, getBaseDomain, getCustomerInformation, getFTAgent, getServerID, getSSLCertificate, hasCertificate, registerForPeriodicServices, reserveServerID, validateLocationInformation
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProductRegistrationAgentKeystore

public ProductRegistrationAgentKeystore(StatusCheck statusCheck,
                                        java.lang.String autosslServerHost,
                                        int autosslServerPort,
                                        java.lang.String productName,
                                        java.lang.String productVersion,
                                        java.lang.String storedInfoDirectory,
                                        java.util.Locale locale)
                                 throws PRAException
Construct a ProductRegistrationAgent

Parameters:
statusCheck - An object that will receive update status messages from the AutoSSL Agent. These messages may be displayed to the user to help him know what the AutoSSL Agent is doing. If an application does not wish to receive such messages, this value may be set to null.
autosslServerHost - The host name of the AutoSSL Server.
autosslServerPort - The port of the AutoSSL Server.
productName - The name of the application that contains this AutoSSL Agent.
productVersion - The version of the application that contains this AutoSSL Agent.
storedInfoDirectory - The name of the directory to be used to store information that the ProductRegistrationAgent needs between runs.
locale - The locale to be used for any user-facing text. If the requested locale is not supported, en_US will be used instead.
Throws:
PRAException
Method Detail

getKeystore

public KeystoreAccess getKeystore()
Gets an object to give access to all aspects of the Keystore. NOTE: This method should only be called after a certificate has been provisioned to the application.

Returns:
A KeystoreAccess that may be used to get access to the SSL certificate and private key.

provisionSSLCertificate

public void provisionSSLCertificate(java.lang.String reservationID,
                                    AuthorizationInfo authorizationInfo,
                                    BasicCustomerInfo customerInfo,
                                    int numYears)
                             throws PRAException
Registers this application with the AutoSSL Server and provisions a trusted, signed SSL certificate to that application. This method will perform the following actions:

Parameters:
reservationID - The string returned by reserveServerID(...).
authorizationInfo - Information that proves to the AutoSSL Server that the AutoSSL Agent with which it is communicating is not an imposter. The information contained in this is dependant on how the AutoSSL Server is configured.
customerInfo - Basic information about the customer (e.g. name, location, etc.) that will be written into the SSL certificate.
numYears - Specify the number of years that this certificate will be valid
Throws:
PRAException

renewSSLCertificate

public void renewSSLCertificate(AuthorizationInfo authorizationInfo,
                                BasicCustomerInfo customerInfo,
                                int numYears)
                         throws PRAException
Renews a certificate that's about to expire. The new certificate should contain the same identification information as the current certificate (although the user can change it), but will have a new serial number, encryption keypair, and expiration date. Because the renewal will most likely not happen on the date of expiration of the old certificate, any unused time from the old certificate will be added onto the end of the new certificate.

Parameters:
authorizationInfo - Information that proves to the AutoSSL Server that the AutoSSL Agent with which it is communicating is not an imposter. The information contained in this is dependant on how the AutoSSL Server is configured.
customerInfo - Information about the customer that will either go into the certificate or used in other ways. This information may be retrieved from the old certificate.
numYears - Specify the number of years that this certificate will be valid
Throws:
PRAException