public class CertificateVerifier
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected java.security.cert.X509Certificate[] |
ivCerts
The certificate(s) for the current site being processed.
|
protected boolean |
ivCertsOK
A flag that indicates if a site's certificates are ok.
|
protected java.util.Date |
ivCutoff
The cutoff date for expiration notifiations.
|
protected java.lang.String |
ivHost
The host for the current site being processed.
|
protected java.lang.String |
ivName
The name for the current site being processed.
|
protected java.lang.String |
ivPort
The port for the current site being processed.
|
protected javax.net.ssl.SSLSocket |
ivSocket
The socket for the current site's connection.
|
protected boolean |
ivWaiting
A flag that indicates if processing needs to wait before continuing.
|
private static long |
serialVersionUID
The class' serialization version id.
|
Constructor and Description |
---|
CertificateVerifier()
Constructs a new instance of
CertificateVerifier and initiates the
verifier's processing. |
Modifier and Type | Method and Description |
---|---|
protected void |
doConnect(javax.net.ssl.SSLSocketFactory factory)
Performs connection to the current site's host and port.
|
protected void |
doHandshake()
Performs SSL handshake for the current connection's socket.
|
protected void |
doHandshakeListening()
Performs SSL handshake listening for the current connection's socket.
|
protected void |
doHousekeeping()
Performs housekeeping tasks, such as deleting old or unnecessary log files.
|
protected java.lang.String |
getMessage(java.lang.String msgid,
java.lang.String... values)
A convenience method for retrieving message text from message.properties.
|
protected void |
logCertificates()
A convenience method for writing certificate info to the MAIN log file.
|
protected void |
logMessage(java.lang.String msgid,
java.lang.String... values)
A convenience method for writing entries to the MAIN log file.
|
static void |
main(java.lang.String[] args)
The main entry point for when the class is started from a command line.
|
protected void |
sendNotification()
Sends a notification when a pending certificate expiration is found.
|
protected javax.net.ssl.SSLSocketFactory |
setDefaultSSLContext()
Sets the default SSL context for SSL connections so that all hosts are
considered as trusted hosts and then returns an SSL socket factory that
uses the context.
|
private static final long serialVersionUID
protected java.util.Date ivCutoff
protected java.lang.String ivName
protected java.lang.String ivHost
protected java.lang.String ivPort
protected javax.net.ssl.SSLSocket ivSocket
protected java.security.cert.X509Certificate[] ivCerts
protected boolean ivCertsOK
protected boolean ivWaiting
public CertificateVerifier()
CertificateVerifier
and initiates the
verifier's processing.protected void doConnect(javax.net.ssl.SSLSocketFactory factory)
factory
- (SSLSocketFactory) The socket factory to use for
making the connection.protected void doHandshake()
protected void doHandshakeListening()
protected void doHousekeeping() throws java.lang.Exception
java.lang.Exception
- - if an error occurs during processing.protected java.lang.String getMessage(java.lang.String msgid, java.lang.String... values)
msgid
- (String) The id for the message to get. The msgid is
automatically prefixed with "MSG.CertificateVerifier.".values
- (String) Zero or more values to replace in the message
text. This parameter uses the varargs feature and can therefore
be passed as multiple parms (msgid, value1, value2, value3, valueN)
or as an array (msgid, values[]).protected void logCertificates()
protected void logMessage(java.lang.String msgid, java.lang.String... values)
msgid
- (String) The id for the message to log. The msgid is
automatically prefixed with "MSG.CertificateVerifier.".values
- (String) Zero or more values to replace in the message
text. This parameter uses the varargs feature and can therefore
be passed as multiple parms (msgid, value1, value2, value3, valueN)
or as an array (msgid, values[]).protected void sendNotification()
protected javax.net.ssl.SSLSocketFactory setDefaultSSLContext() throws java.lang.Exception
java.lang.Exception
- - if an error occurs while setting the context.public static void main(java.lang.String[] args)
args
- (String[]) A string array of startup parameters.