📄 keystore.html
字号:
<TD><CODE><B><A HREF="../../java/security/KeyStore.html#getCertificateAlias(java.security.cert.Certificate)">getCertificateAlias</A></B>(<A HREF="../../java/security/cert/Certificate.html">Certificate</A> cert)</CODE><BR> Returns the (alias) name of the first keystore entry whose certificate matches the given certificate.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/security/cert/Certificate.html">Certificate</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/security/KeyStore.html#getCertificateChain(java.lang.String)">getCertificateChain</A></B>(<A HREF="../../java/lang/String.html">String</A> alias)</CODE><BR> Returns the certificate chain associated with the given alias.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/util/Date.html">Date</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/security/KeyStore.html#getCreationDate(java.lang.String)">getCreationDate</A></B>(<A HREF="../../java/lang/String.html">String</A> alias)</CODE><BR> Returns the creation date of the entry identified by the given alias.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/security/KeyStore.html#getDefaultType()">getDefaultType</A></B>()</CODE><BR> Returns the default keystore type as specified in the Java security properties file, or the string "jks" (acronym for "Java keystore") if no such property exists.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../java/security/KeyStore.html">KeyStore</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/security/KeyStore.html#getInstance(java.lang.String)">getInstance</A></B>(<A HREF="../../java/lang/String.html">String</A> type)</CODE><BR> Generates a keystore object of the given type.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static <A HREF="../../java/security/KeyStore.html">KeyStore</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/security/KeyStore.html#getInstance(java.lang.String, java.lang.String)">getInstance</A></B>(<A HREF="../../java/lang/String.html">String</A> type, <A HREF="../../java/lang/String.html">String</A> provider)</CODE><BR> Generates a keystore object for the specified keystore type from the specified provider.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/security/Key.html">Key</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/security/KeyStore.html#getKey(java.lang.String, char[])">getKey</A></B>(<A HREF="../../java/lang/String.html">String</A> alias, char[] password)</CODE><BR> Returns the key associated with the given alias, using the given password to recover it.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/security/Provider.html">Provider</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/security/KeyStore.html#getProvider()">getProvider</A></B>()</CODE><BR> Returns the provider of this keystore.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/security/KeyStore.html#getType()">getType</A></B>()</CODE><BR> Returns the type of this keystore.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/security/KeyStore.html#isCertificateEntry(java.lang.String)">isCertificateEntry</A></B>(<A HREF="../../java/lang/String.html">String</A> alias)</CODE><BR> Returns true if the entry identified by the given alias is a <i>trusted certificate entry</i>, and false otherwise.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/security/KeyStore.html#isKeyEntry(java.lang.String)">isKeyEntry</A></B>(<A HREF="../../java/lang/String.html">String</A> alias)</CODE><BR> Returns true if the entry identified by the given alias is a <i>key entry</i>, and false otherwise.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/security/KeyStore.html#load(java.io.InputStream, char[])">load</A></B>(<A HREF="../../java/io/InputStream.html">InputStream</A> stream, char[] password)</CODE><BR> Loads this KeyStore from the given input stream.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/security/KeyStore.html#setCertificateEntry(java.lang.String, java.security.cert.Certificate)">setCertificateEntry</A></B>(<A HREF="../../java/lang/String.html">String</A> alias, <A HREF="../../java/security/cert/Certificate.html">Certificate</A> cert)</CODE><BR> Assigns the given certificate to the given alias.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/security/KeyStore.html#setKeyEntry(java.lang.String, byte[], java.security.cert.Certificate[])">setKeyEntry</A></B>(<A HREF="../../java/lang/String.html">String</A> alias, byte[] key, <A HREF="../../java/security/cert/Certificate.html">Certificate</A>[] chain)</CODE><BR> Assigns the given key (that has already been protected) to the given alias.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/security/KeyStore.html#setKeyEntry(java.lang.String, java.security.Key, char[], java.security.cert.Certificate[])">setKeyEntry</A></B>(<A HREF="../../java/lang/String.html">String</A> alias, <A HREF="../../java/security/Key.html">Key</A> key, char[] password, <A HREF="../../java/security/cert/Certificate.html">Certificate</A>[] chain)</CODE><BR> Assigns the given key to the given alias, protecting it with the given password.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/security/KeyStore.html#size()">size</A></B>()</CODE><BR> Retrieves the number of entries in this keystore.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/security/KeyStore.html#store(java.io.OutputStream, char[])">store</A></B>(<A HREF="../../java/io/OutputStream.html">OutputStream</A> stream, char[] password)</CODE><BR> Stores this keystore to the given output stream, and protects its integrity with the given password.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/lang/Object.html#clone()">clone</A>, <A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#toString()">toString</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="KeyStore(java.security.KeyStoreSpi, java.security.Provider, java.lang.String)"><!-- --></A><H3>KeyStore</H3><PRE>protected <B>KeyStore</B>(<A HREF="../../java/security/KeyStoreSpi.html">KeyStoreSpi</A> keyStoreSpi, <A HREF="../../java/security/Provider.html">Provider</A> provider, <A HREF="../../java/lang/String.html">String</A> type)</PRE><DL><DD>Creates a KeyStore object of the given type, and encapsulates the given provider implementation (SPI object) in it.<DD><DL><DT><B>Parameters:</B><DD><CODE>keyStoreSpi</CODE> - the provider implementation.<DD><CODE>provider</CODE> - the provider.<DD><CODE>type</CODE> - the keystore 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 <A HREF="../../java/security/KeyStore.html">KeyStore</A> <B>getInstance</B>(<A HREF="../../java/lang/String.html">String</A> type) throws <A HREF="../../java/security/KeyStoreException.html">KeyStoreException</A></PRE><DL><DD>Generates a keystore object of the given type. <p>If the default provider package provides a keystore implementation of the given type, an instance of <code>KeyStore</code> containing that implementation is returned. If the requested keystore type is not available in the default package, other packages are searched.<DD><DL><DT><B>Parameters:</B><DD><CODE>type</CODE> - the type of keystore. See Appendix A in the <a href=
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -