org.jasig.cas.adaptors.x509.util
Class CertUtils

java.lang.Object
  extended by org.jasig.cas.adaptors.x509.util.CertUtils

public final class CertUtils
extends Object

Utility class with methods to support various operations on X.509 certs.

Since:
3.4.6
Version:
$Revision$
Author:
Marvin S. Addison

Field Summary
static String X509_CERTIFICATE_TYPE
          X509 certificate type.
 
Method Summary
static X509CRL fetchCRL(org.springframework.core.io.Resource resource)
          Fetches an X.509 CRL from a resource such as a file or URL.
static CertificateFactory getCertificateFactory()
          Gets a certificate factory for creating X.509 artifacts.
static boolean isExpired(X509CRL crl)
          Determines whether the given CRL is expired by examining the nextUpdate field.
static boolean isExpired(X509CRL crl, Date reference)
          Determines whether the given CRL is expired by comparing the nextUpdate field with a given date.
static String toString(X509Certificate cert)
          Creates a unique and human-readable representation of the given certificate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

X509_CERTIFICATE_TYPE

public static final String X509_CERTIFICATE_TYPE
X509 certificate type.

See Also:
Constant Field Values
Method Detail

isExpired

public static boolean isExpired(X509CRL crl)
Determines whether the given CRL is expired by examining the nextUpdate field.

Parameters:
crl - CRL to examine.
Returns:
True if current system time is after CRL next update, false otherwise.

isExpired

public static boolean isExpired(X509CRL crl,
                                Date reference)
Determines whether the given CRL is expired by comparing the nextUpdate field with a given date.

Parameters:
crl - CRL to examine.
reference - Reference date for comparison.
Returns:
True if reference date is after CRL next update, false otherwise.

fetchCRL

public static X509CRL fetchCRL(org.springframework.core.io.Resource resource)
                        throws CRLException,
                               IOException
Fetches an X.509 CRL from a resource such as a file or URL.

Parameters:
resource - Resource descriptor.
Returns:
X.509 CRL
Throws:
IOException - On IOErrors.
CRLException - On CRL parse errors.

toString

public static String toString(X509Certificate cert)
Creates a unique and human-readable representation of the given certificate.

Parameters:
cert - Certificate.
Returns:
String representation of a certificate that includes the subject and serial number.

getCertificateFactory

public static CertificateFactory getCertificateFactory()
Gets a certificate factory for creating X.509 artifacts.

Returns:
X509 certificate factory.


Copyright © 2004-2013 Jasig. All Rights Reserved.