📄 certificatefactory.html
字号:
<DL><DD>Creates a CertificateFactory object of the given type, and encapsulates the given provider implementation (SPI object) in it.<DD><DL><DT><B>Parameters:</B><DD><CODE>certFacSpi</CODE> - the provider implementation.<DD><CODE>provider</CODE> - the provider.<DD><CODE>type</CODE> - the certificate type.</DL></DD></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getInstance(java.lang.String)"><!-- --></A><H3>getInstance</H3><PRE>public static final <A HREF="../../../java/security/cert/CertificateFactory.html">CertificateFactory</A> <B>getInstance</B>(<A HREF="../../../java/lang/String.html">String</A> type) throws <A HREF="../../../java/security/cert/CertificateException.html">CertificateException</A></PRE><DL><DD>Generates a certificate factory object that implements the specified certificate type. If the default provider package provides an implementation of the requested certificate type, an instance of certificate factory containing that implementation is returned. If the type is not available in the default package, other packages are searched.<DD><DL><DT><B>Parameters:</B><DD><CODE>type</CODE> - the name of the requested certificate type. See Appendix A in the <a href= "../../../../guide/security/CryptoSpec.html#AppA"> Java Cryptography Architecture API Specification & Reference </a> for information about standard certificate types.<DT><B>Returns:</B><DD>a certificate factory object for the specified type.<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/security/cert/CertificateException.html">CertificateException</A></CODE> - if the requested certificate type is not available in the default provider package or any of the other provider packages that were searched.</DL></DD></DL><HR><A NAME="getInstance(java.lang.String, java.lang.String)"><!-- --></A><H3>getInstance</H3><PRE>public static final <A HREF="../../../java/security/cert/CertificateFactory.html">CertificateFactory</A> <B>getInstance</B>(<A HREF="../../../java/lang/String.html">String</A> type, <A HREF="../../../java/lang/String.html">String</A> provider) throws <A HREF="../../../java/security/cert/CertificateException.html">CertificateException</A>, <A HREF="../../../java/security/NoSuchProviderException.html">NoSuchProviderException</A></PRE><DL><DD>Generates a certificate factory object for the specified certificate type from the specified provider.<DD><DL><DT><B>Parameters:</B><DD><CODE>type</CODE> - the certificate type<DD><CODE>provider</CODE> - the name of the provider.<DT><B>Returns:</B><DD>a certificate factory object for the specified type.<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/security/cert/CertificateException.html">CertificateException</A></CODE> - if the certificate type is not available from the specified provider.<DD><CODE><A HREF="../../../java/security/NoSuchProviderException.html">NoSuchProviderException</A></CODE> - if the provider has not been configured.<DT><B>See Also: </B><DD><A HREF="../../../java/security/Provider.html"><CODE>Provider</CODE></A></DL></DD></DL><HR><A NAME="getProvider()"><!-- --></A><H3>getProvider</H3><PRE>public final <A HREF="../../../java/security/Provider.html">Provider</A> <B>getProvider</B>()</PRE><DL><DD>Returns the provider of this certificate factory.<DD><DL><DT><B>Returns:</B><DD>the provider of this certificate factory.</DL></DD></DL><HR><A NAME="getType()"><!-- --></A><H3>getType</H3><PRE>public final <A HREF="../../../java/lang/String.html">String</A> <B>getType</B>()</PRE><DL><DD>Returns the name of the certificate type associated with this certificate factory.<DD><DL><DT><B>Returns:</B><DD>the name of the certificate type associated with this certificate factory.</DL></DD></DL><HR><A NAME="generateCertificate(java.io.InputStream)"><!-- --></A><H3>generateCertificate</H3><PRE>public final <A HREF="../../../java/security/cert/Certificate.html">Certificate</A> <B>generateCertificate</B>(<A HREF="../../../java/io/InputStream.html">InputStream</A> inStream) throws <A HREF="../../../java/security/cert/CertificateException.html">CertificateException</A></PRE><DL><DD>Generates a certificate object and initializes it with the data read from the input stream <code>inStream</code>. <p>The given input stream <code>inStream</code> must contain a single certificate. <p>In order to take advantage of the specialized certificate format supported by this certificate factory, the returned certificate object can be typecast to the corresponding certificate class. For example, if this certificate factory implements X.509 certificates, the returned certificate object can be typecast to the <code>X509Certificate</code> class. <p>In the case of a certificate factory for X.509 certificates, the certificate provided in <code>inStream</code> must be DER-encoded and may be supplied in binary or printable (Base64) encoding. If the certificate is provided in Base64 encoding, it must be bounded at the beginning by -----BEGIN CERTIFICATE-----, and must be bounded at the end by -----END CERTIFICATE-----. <p>Note that if the given input stream does not support <A HREF="../../../java/io/InputStream.html#mark(int)"><CODE>mark</CODE></A> and <A HREF="../../../java/io/InputStream.html#reset()"><CODE>reset</CODE></A>, this method will consume the entire input stream.<DD><DL><DT><B>Parameters:</B><DD><CODE>inStream</CODE> - an input stream with the certificate data.<DT><B>Returns:</B><DD>a certificate object initialized with the data from the input stream.<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/security/cert/CertificateException.html">CertificateException</A></CODE> - on parsing errors.</DL></DD></DL><HR><A NAME="generateCertificates(java.io.InputStream)"><!-- --></A><H3>generateCertificates</H3><PRE>public final <A HREF="../../../java/util/Collection.html">Collection</A> <B>generateCertificates</B>(<A HREF="../../../java/io/InputStream.html">InputStream</A> inStream) throws <A HREF="../../../java/security/cert/CertificateException.html">CertificateException</A></PRE><DL><DD>Returns a (possibly empty) collection view of the certificates read from the given input stream <code>inStream</code>. <p>In order to take advantage of the specialized certificate format supported by this certificate factory, each element in the returned collection view can be typecast to the corresponding certificate class. For example, if this certificate factory implements X.509 certificates, the elements in the returned collection can be typecast to the <code>X509Certificate</code> class. <p>In the case of a certificate factory for X.509 certificates, <code>inStream</code> may contain a sequence of DER-encoded certificates in the formats described for <A HREF="../../../java/security/cert/CertificateFactory.html#generateCertificate(java.io.InputStream)"><CODE>generateCertificate</CODE></A>. In addition, <code>inStream</code> may contain a PKCS#7 certificate chain. This is a PKCS#7 <i>SignedData</i> object, with the only significant field being <i>certificates</i>. In particular, the signature and the contents are ignored. This format allows multiple certificates to be downloaded at once. If no certificates are present, an empty collection is returned. <p>Note that if the given input stream does not support <A HREF="../../../java/io/InputStream.html#mark(int)"><CODE>mark</CODE></A> and <A HREF="../../../java/io/InputStream.html#reset()"><CODE>reset</CODE></A>, this method will consume the entire input stream.<DD><DL><DT><B>Parameters:</B><DD><CODE>inStream</CODE> - the input stream with the certificates.<DT><B>Returns:</B><DD>a (possibly empty) collection view of java.security.cert.Certificate objects initialized with the data from the input stream.<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/security/cert/CertificateException.html">CertificateException</A></CODE> - on parsing errors.</DL></DD></DL><HR><A NAME="generateCRL(java.io.InputStream)"><!-- --></A><H3>generateCRL</H3><PRE>public final <A HREF="../../../java/security/cert/CRL.html">CRL</A> <B>generateCRL</B>(<A HREF="../../../java/io/InputStream.html">InputStream</A> inStream) throws <A HREF="../../../java/security/cert/CRLException.html">CRLException</A></PRE><DL><DD>Generates a certificate revocation list (CRL) object and initializes it with the data read from the input stream <code>inStream</code>. <p>In order to take advantage of the specialized CRL format supported by this certificate factory, the returned CRL object can be typecast to the corresponding CRL class. For example, if this certificate factory implements X.509 CRLs, the returned CRL object can be typecast to the <code>X509CRL</code> class. <p>Note that if the given input stream does not support <A HREF="../../../java/io/InputStream.html#mark(int)"><CODE>mark</CODE></A> and <A HREF="../../../java/io/InputStream.html#reset()"><CODE>reset</CODE></A>, this method will consume the entire input stream.<DD><DL><DT><B>Parameters:</B><DD><CODE>inStream</CODE> - an input stream with the CRL data.<DT><B>Returns:</B><DD>a CRL object initialized with the data from the input stream.<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/security/cert/CRLException.html">CRLException</A></CODE> - on parsing errors.</DL></DD></DL><HR><A NAME="generateCRLs(java.io.InputStream)"><!-- --></A><H3>generateCRLs</H3><PRE>public final <A HREF="../../../java/util/Collection.html">Collection</A> <B>generateCRLs</B>(<A HREF="../../../java/io/InputStream.html">InputStream</A> inStream) throws <A HREF="../../../java/security/cert/CRLException.html">CRLException</A></PRE><DL><DD>Returns a (possibly empty) collection view of the CRLs read from the given input stream <code>inStream</code>. <p>In order to take advantage of the specialized CRL format supported by this certificate factory, each element in the returned collection view can be typecast to the corresponding CRL class. For example, if this certificate factory implements X.509 CRLs, the elements in the returned collection can be typecast to the <code>X509CRL</code> class. <p>In the case of a certificate factory for X.509 CRLs, <code>inStream</code> may contain a sequence of DER-encoded CRLs. In addition, <code>inStream</code> may contain a PKCS#7 CRL set. This is a PKCS#7 <i>SignedData</i> object, with the only significant field being <i>crls</i>. In particular, the signature and the contents are ignored. This format allows multiple CRLs to be downloaded at once. If no CRLs are present, an empty collection is returned. <p>Note that if the given input stream does not support <A HREF="../../../java/io/InputStream.html#mark(int)"><CODE>mark</CODE></A> and <A HREF="../../../java/io/InputStream.html#reset()"><CODE>reset</CODE></A>, this method will consume the entire input stream.<DD><DL><DT><B>Parameters:</B><DD><CODE>inStream</CODE> - the input stream with the CRLs.<DT><B>Returns:</B><DD>a (possibly empty) collection view of java.security.cert.CRL objects initialized with the data from the input stream.<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/security/cert/CRLException.html">CRLException</A></CODE> - on parsing errors.</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/CertificateFactory.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../java/security/cert/Certificate.CertificateRep.html"><B>PREV CLASS</B></A> <A HREF="../../../java/security/cert/CertificateFactorySpi.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="CertificateFactory.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="http://java.sun.com/products/jdk/1.3/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road<br>Palo Alto, California, 94303, U.S.A. All Rights Reserved.</font></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -