Class CertificateChain
java.lang.Object
org.mozilla.jss.netscape.security.x509.CertificateChain
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an empty certificate chain.constructs a certificate chain from a certificate.CertificateChain
(X509Certificate[] certs) constructs a certificate chain from a X509 certificate array. -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addCertificateChain
(CertificateChain certChain) void
void
decode
(InputStream in) decode from PKCS7 blob.void
encode
(OutputStream out) void
encode
(OutputStream out, boolean sort) encode in PKCS7 blob.static CertificateChain
fromPEMString
(String input) Convert a series of PEM certificates or a PKCS #7 data into a certificate chain.getCertificate
(int index) returns the certificate at specified index in chain.Returns the certificate list.getChain()
returns the certificate chain as an array of X509 certificates.returns the first certificate in chain.private void
for serializationvoid
sort()
Sorts certificate chain from root to leaf.Convert the certificate chain into a series of PEM certificates.toPKCS7()
Convert the certificate chain into a PKCS #7 object.toString()
Converts the certificate chain to a readable string.private void
for serialization
-
Field Details
-
certs
-
-
Constructor Details
-
CertificateChain
public CertificateChain()Constructs an empty certificate chain. -
CertificateChain
constructs a certificate chain from a certificate.- Parameters:
cert
- a certificate
-
CertificateChain
constructs a certificate chain from a X509 certificate array.- Parameters:
certs
- a certificate array.
-
-
Method Details
-
getCertificates
Returns the certificate list.- Returns:
- The certificate list.
-
getCertificate
returns the certificate at specified index in chain.- Parameters:
index
- the index.- Returns:
- the X509 certificate at the given index.
-
getFirstCertificate
returns the first certificate in chain.- Returns:
- the X509 certificate at the given index.
-
getChain
returns the certificate chain as an array of X509 certificates.- Returns:
- an array of X509 Certificates.
-
sort
Sorts certificate chain from root to leaf.- Throws:
Exception
-
encode
- Throws:
IOException
-
encode
encode in PKCS7 blob.- Throws:
IOException
-
decode
decode from PKCS7 blob.- Throws:
IOException
-
writeObject
for serialization- Throws:
IOException
-
readObject
for serialization- Throws:
IOException
-
addCertificate
-
addCertificateChain
-
addPKCS7
-
fromPEMString
Convert a series of PEM certificates or a PKCS #7 data into a certificate chain. This method will only accept a single chain, so it cannot be used to load CA bundle.- Throws:
Exception
-
toPEMString
Convert the certificate chain into a series of PEM certificates.- Throws:
Exception
-
toPKCS7
Convert the certificate chain into a PKCS #7 object.- Throws:
Exception
-
toString
Converts the certificate chain to a readable string.
-