|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.glite.slcs.pki.Certificate
public class Certificate
Certificate is a wrapper class for the X509Certificate. Used to store a certificate with its chain and read/write it from/to file.
Field Summary | |
---|---|
static int |
CRT_FILE_PERMISSION
Default unix file permissions for the certificate file |
Constructor Summary | |
---|---|
Certificate(java.security.cert.X509Certificate cert)
Creates a certificate without chain. |
|
Certificate(java.security.cert.X509Certificate cert,
java.security.cert.X509Certificate[] chain)
Creates a certificate with its chain. |
Method Summary | |
---|---|
java.security.cert.X509Certificate |
getCertificate()
|
java.security.cert.X509Certificate[] |
getCertificateChain()
|
java.lang.String |
getPEM()
Returns the PEM encoded certificate |
static Certificate |
readPEM(java.io.Reader reader)
Read a PEM source to extract the certificate and its chain. |
void |
storePEM(java.io.File file)
Stores the ceritifcate and its chain in PEM format in the given file. |
void |
storePEM(java.lang.String filename)
Stores the certificate and its chain in PEM format in the given file name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int CRT_FILE_PERMISSION
Constructor Detail |
---|
public Certificate(java.security.cert.X509Certificate cert, java.security.cert.X509Certificate[] chain) throws java.security.GeneralSecurityException
cert
- The X509Certificatechain
- The chain as an array of X509Ceritificate.
java.security.GeneralSecurityException
- If the certificate is null.public Certificate(java.security.cert.X509Certificate cert) throws java.security.GeneralSecurityException
cert
- The X509Certificate.
java.security.GeneralSecurityException
- If the X509Certificate is null.Method Detail |
---|
public static Certificate readPEM(java.io.Reader reader) throws java.io.IOException, java.security.GeneralSecurityException
reader
- The Reader to read the source.
java.io.IOException
- If an error occurs while reading the source.
java.security.GeneralSecurityException
- If an error occurs while creating the Certificate.public void storePEM(java.lang.String filename) throws java.io.IOException
filename
- The file name to store into.
java.io.IOException
- If an error occurs while writing the cert.public void storePEM(java.io.File file) throws java.io.IOException
file
- The file to write into.
java.io.IOException
public java.lang.String getPEM()
public java.security.cert.X509Certificate[] getCertificateChain()
public java.security.cert.X509Certificate getCertificate()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |