com.enterprisedt.net.ftp.ssl
Class SSLFTPCertificate

java.lang.Object
  extended by com.enterprisedt.net.ftp.ssl.SSLFTPCertificate

public class SSLFTPCertificate
extends java.lang.Object

A SSLFTPCertificate contains information regarding an X.509 certificate. Details include:

Subject Name
Distinguished Name of the entity to which the certificate was issued.
Validity Period
Period in which the certificate is valid.
Issuer Name
Name of the entity which issued the certificate (usually a CA).
Serial Number
Serial number of the certificate.
Extensions
Any extensions that are included in the certificate.

Author:
Hans Andersen

Nested Class Summary
static class SSLFTPCertificate.DistinguishedName
          Distinguished Name (DN) of an entity.
static class SSLFTPCertificate.Extension
          Extension of a certificate.
 
Constructor Summary
SSLFTPCertificate(java.security.cert.Certificate certificate)
          Constructs an SSLFTPCertificate instance from the given Certificate.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 byte[] getCertDER()
          Returns the raw DER encoding of the certificate.
 java.util.Vector getExtensions()
          Returns a vector containing the extensions of the certificate.
 SSLFTPCertificate.DistinguishedName getIssuerName()
          Returns the Distinguished Name of the issuer of the certificate or null if there isn't one.
 java.math.BigInteger getSerial()
          Returns the serial number of the certificate.
 SSLFTPCertificate.DistinguishedName getSubjectName()
          Returns the Distinguished Name of the subject of the certificate.
 java.util.Date getValidityNotAfter()
          Returns the start-date of the period of validity of the certificate.
 java.util.Date getValidityNotBefore()
          Returns the end of the period of validity of the certificate.
 java.lang.String toString()
           
 java.lang.String toString(boolean showHeader)
           
 void writePEM(java.io.OutputStream outStr)
          Writes the certificate in PEM format to the given OutputStream.
 void writePEM(java.io.Writer writer)
          Writes the certificate in PEM format to the given Writer.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SSLFTPCertificate

public SSLFTPCertificate(java.security.cert.Certificate certificate)
                  throws SSLFTPCertificateException
Constructs an SSLFTPCertificate instance from the given Certificate.

Parameters:
certificate - Certificate
Throws:
SSLFTPException - thrown if the certificate was found to be invalid.
SSLFTPCertificateException
Method Detail

getCertDER

public byte[] getCertDER()
Returns the raw DER encoding of the certificate.

Returns:
byte-array containing the DER.

getExtensions

public java.util.Vector getExtensions()
Returns a vector containing the extensions of the certificate.

Returns:
A vector of SSLFTPCertificate.Extension objects.

getIssuerName

public SSLFTPCertificate.DistinguishedName getIssuerName()
Returns the Distinguished Name of the issuer of the certificate or null if there isn't one.

Returns:
Distinguished Name or null.

getSerial

public java.math.BigInteger getSerial()
Returns the serial number of the certificate.

Returns:
Serial Number.

getSubjectName

public SSLFTPCertificate.DistinguishedName getSubjectName()
Returns the Distinguished Name of the subject of the certificate. The subject is the entity to which the certificate was issued.

Returns:
Distinguished Name

getValidityNotAfter

public java.util.Date getValidityNotAfter()
Returns the start-date of the period of validity of the certificate.

Returns:
The start-date.

getValidityNotBefore

public java.util.Date getValidityNotBefore()
Returns the end of the period of validity of the certificate.

Returns:
The end-date.

writePEM

public void writePEM(java.io.OutputStream outStr)
              throws java.io.IOException
Writes the certificate in PEM format to the given OutputStream.

Parameters:
outStr - OutputStream to write to.
Throws:
java.io.IOException - Thrown if an error occurred while writing the certificate.

writePEM

public void writePEM(java.io.Writer writer)
              throws java.io.IOException
Writes the certificate in PEM format to the given Writer.

Parameters:
writer -
Throws:
java.io.IOException - Thrown if an error occurred while writing the certificate.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(boolean showHeader)

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2001-2006 Enterprise Distributed Technologies Ltd. All Rights Reserved.