|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.glite.security.util.FileCertReader
public class FileCertReader
Reads all certificates from given files, accepts binary form of DER encoded certs and the Base64 form of the DER encoded certs (PEM). The base64 certs can contain garbage in front of the actual certificate that has to begin with "-----BEGIN". Should accept multiple certs in one file, not tested!
Constructor Summary | |
---|---|
FileCertReader()
Creates a new instance of CertReader. |
|
FileCertReader(java.security.Provider provider)
Creates a new instance of CertReader with the specified provider. |
|
FileCertReader(java.lang.String provider)
Creates a new instance of CertReader with the specified provider |
Method Summary | |
---|---|
java.lang.Object |
objectReader(java.io.BufferedInputStream binStream,
int type)
Reads a certificate or a CRL from the stream, doing some error correction. |
java.util.Vector |
readAnchors(java.lang.String files)
Reads the certificates from the files defined in the argument and makes TrustAnchors from them. |
java.util.Vector<java.security.cert.X509Certificate> |
readCertChain(java.io.BufferedInputStream stream)
Reads a certificate chain from the stream. |
java.util.Vector |
readCerts(java.lang.String files)
Reads the certificates from the files defined in the argument. |
java.util.Vector |
readCRLs(java.lang.String files)
|
java.util.Vector |
readFile(java.io.File certFile,
int type)
Reads the objects of given type from the File. |
java.lang.Object |
readObject(java.io.BufferedInputStream binStream,
int type)
Does the actual reading of the object. |
java.security.KeyStore |
readProxy(java.io.BufferedInputStream stream,
java.lang.String storePasswd)
Reads a grid proxy from a stream. |
static void |
skipEmptyLines(java.io.BufferedInputStream stream)
Skips empty lines in the stream. |
static void |
skipToCertBeginning(java.io.BufferedInputStream stream)
Skips everything in front of "-----BEGIN" in the stream. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileCertReader() throws java.security.cert.CertificateException
java.security.cert.CertificateException
- in case the certificate factory creation fails.public FileCertReader(java.security.Provider provider) throws java.security.cert.CertificateException
provider
- the provider to be used in creating the certificates etc.
java.security.cert.CertificateException
- in case the certificate factory creation fails.public FileCertReader(java.lang.String provider) throws java.security.cert.CertificateException
provider
- the provider to be used in creating the certificates etc.
java.security.cert.CertificateException
- in case the certificate factory creation fails.Method Detail |
---|
public java.util.Vector readCerts(java.lang.String files) throws java.io.IOException, java.security.cert.CertificateException
files
- The file definition.
java.io.IOException
- in case the certificate file reading fails.
java.security.cert.CertificateException
- in case the certificate factory creation fails.DirectoryList
public java.util.Vector readAnchors(java.lang.String files) throws java.io.IOException, java.security.cert.CertificateException
files
- The file definition.
java.security.cert.CertificateException
- Thrown if the certificate handling fails.
java.io.IOException
- Thrown in case the certificate reading fails.DirectoryList
public java.util.Vector readCRLs(java.lang.String files) throws java.io.IOException, java.security.cert.CertificateException
files
- The file definition.
java.io.IOException
- Thrown if the CRL reading failed.
java.security.cert.CertificateException
- Thrown in case the CRL parsing or handling fails.DirectoryList
public java.util.Vector readFile(java.io.File certFile, int type) throws java.io.IOException
certFile
- The file to read.type
- The type of objects to read form the file.
java.io.IOException
- Thrown if the reading of objects of given type fails.public java.lang.Object objectReader(java.io.BufferedInputStream binStream, int type) throws java.security.cert.CertificateException, java.io.IOException
binStream
- The stream to read the object from.type
- The type of object to read from the stream.
java.security.cert.CertificateException
- Thrown if an error occurs while reading the object.
java.io.IOException
- Thrown if an error occurs while reading the object.public java.lang.Object readObject(java.io.BufferedInputStream binStream, int type) throws java.security.cert.CertificateException
binStream
- The stream to read the object from.type
- The type of the object.
java.security.cert.CertificateException
- Thrown if there is a problem reading the object.public static void skipToCertBeginning(java.io.BufferedInputStream stream) throws java.io.IOException
stream
- The stream to read and skip.
java.io.IOException
- Thrown if there is a problem skipping.public static void skipEmptyLines(java.io.BufferedInputStream stream) throws java.io.IOException
stream
- The stream possibly containing empty lines.
java.io.IOException
- Thrown if a problem occurs.public java.util.Vector<java.security.cert.X509Certificate> readCertChain(java.io.BufferedInputStream stream) throws java.io.IOException
stream
- The stream to read certificates from.
java.io.IOException
- In case the reading failed.public java.security.KeyStore readProxy(java.io.BufferedInputStream stream, java.lang.String storePasswd) throws java.io.IOException
stream
- the stream to read the proxy from.storePasswd
- the password used for the private key if any.
java.io.IOException
- in case of error.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |