org.rhq.enterprise.server.plugins.rhnhosted.certificate
Class CertificateFactory

java.lang.Object
  extended by org.rhq.enterprise.server.plugins.rhnhosted.certificate.CertificateFactory

public class CertificateFactory
extends Object

A class for parsing rhq certificates from their XML form. The XML format is identical to the one used by the perl code.


Method Summary
static Certificate read(File file)
          Parse a certificate from file.
static Certificate read(String certString)
          Parse the certificate from certString.
static Certificate read(URL url)
          Parse a certificate from the contents of url.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

read

public static Certificate read(String certString)
                        throws org.jdom.JDOMException,
                               IOException
Parse the certificate from certString.

Parameters:
certString - valid Satellite Certificate in string form
Returns:
the certificate from certString
Throws:
org.jdom.JDOMException - XML parsing fails
IOException - unknown

read

public static Certificate read(File file)
                        throws org.jdom.JDOMException,
                               IOException
Parse a certificate from file. The file must contain the certificate in XML form.

Parameters:
file - the file with the XML certificate
Returns:
the certificate from fle
Throws:
org.jdom.JDOMException - if parsing the XML fails
IOException - if reading the file fails

read

public static Certificate read(URL url)
                        throws org.jdom.JDOMException,
                               IOException
Parse a certificate from the contents of url. The file must contain the certificate in XML form.

Parameters:
url - the URL at which the XML certificate is located
Returns:
the certificate from fle
Throws:
org.jdom.JDOMException - if parsing the XML fails
IOException - if reading the contents of url fails


Copyright © 2008-2011 Red Hat, Inc.. All Rights Reserved.