📄 certificatemanager.html
字号:
<HR><A NAME="createRSACert(java.security.KeyStore, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)"><!-- --></A><H3>createRSACert</H3><PRE>public static <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/cert/X509Certificate.html" title="class or interface in java.security.cert">X509Certificate</A> <B>createRSACert</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/KeyStore.html" title="class or interface in java.security">KeyStore</A> ksKeys, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> keyPassword, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> alias, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> issuerDN, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> subjectDN, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> domain) throws <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/GeneralSecurityException.html" title="class or interface in java.security">GeneralSecurityException</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Creates a new X509 certificate using the RSA algorithm. The new certificate together with its private key are stored in the specified key store. However, the key store is not saved to the disk. This means that it is up to the "caller" to save the key store to disk after new certificates have been added to the store.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>ksKeys</CODE> - key store where the new certificate and private key are going to be stored.<DD><CODE>keyPassword</CODE> - password of the keystore.<DD><CODE>alias</CODE> - name to use when storing the certificate in the key store.<DD><CODE>issuerDN</CODE> - Issuer string e.g "O=Grid,OU=OGSA,CN=ACME"<DD><CODE>subjectDN</CODE> - Subject string e.g "O=Grid,OU=OGSA,CN=John Doe"<DD><CODE>domain</CODE> - domain of the server to store in the subject alternative name extension.<DT><B>Returns:</B><DD>the new X509 V3 Certificate.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/GeneralSecurityException.html" title="class or interface in java.security">GeneralSecurityException</A></CODE><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE></DL></DD></DL><HR><A NAME="deleteCertificate(java.security.KeyStore, java.lang.String)"><!-- --></A><H3>deleteCertificate</H3><PRE>public static void <B>deleteCertificate</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/KeyStore.html" title="class or interface in java.security">KeyStore</A> ksKeys, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> alias) throws <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/GeneralSecurityException.html" title="class or interface in java.security">GeneralSecurityException</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Deletes the specified certificate from the<P><DD><DL><DT><B>Parameters:</B><DD><CODE>ksKeys</CODE> - key store where the certificate is stored.<DD><CODE>alias</CODE> - alias of the certificate to delete.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/GeneralSecurityException.html" title="class or interface in java.security">GeneralSecurityException</A></CODE><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE></DL></DD></DL><HR><A NAME="getPeerIdentities(java.security.cert.X509Certificate)"><!-- --></A><H3>getPeerIdentities</H3><PRE>public static <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/List.html" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>> <B>getPeerIdentities</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/cert/X509Certificate.html" title="class or interface in java.security.cert">X509Certificate</A> x509Certificate)</PRE><DL><DD>Returns the identities of the remote server as defined in the specified certificate. The identities are defined in the subjectDN of the certificate and it can also be defined in the subjectAltName extensions of type "xmpp". When the extension is being used then the identities defined in the extension are going to be returned. Otherwise, the value stored in the subjectDN is returned.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>x509Certificate</CODE> - the certificate the holds the identities of the remote server.<DT><B>Returns:</B><DD>the identities of the remote server as defined in the specified certificate.</DL></DD></DL><HR><A NAME="isRSACertificate(java.security.KeyStore, java.lang.String)"><!-- --></A><H3>isRSACertificate</H3><PRE>public static boolean <B>isRSACertificate</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/KeyStore.html" title="class or interface in java.security">KeyStore</A> ksKeys, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> domain) throws <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/KeyStoreException.html" title="class or interface in java.security">KeyStoreException</A></PRE><DL><DD>Returns true if an RSA certificate was found in the specified keystore for the specified domain.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>ksKeys</CODE> - the keystore that contains the certificates.<DD><CODE>domain</CODE> - domain of the server signed by the certificate.<DT><B>Returns:</B><DD>true if an RSA certificate was found in the specified keystore for the specified domain.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/KeyStoreException.html" title="class or interface in java.security">KeyStoreException</A></CODE></DL></DD></DL><HR><A NAME="isDSACertificate(java.security.KeyStore, java.lang.String)"><!-- --></A><H3>isDSACertificate</H3><PRE>public static boolean <B>isDSACertificate</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/KeyStore.html" title="class or interface in java.security">KeyStore</A> ksKeys, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> domain) throws <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/KeyStoreException.html" title="class or interface in java.security">KeyStoreException</A></PRE><DL><DD>Returns true if an DSA certificate was found in the specified keystore for the specified domain.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>ksKeys</CODE> - the keystore that contains the certificates.<DD><CODE>domain</CODE> - domain of the server signed by the certificate.<DT><B>Returns:</B><DD>true if an DSA certificate was found in the specified keystore for the specified domain.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/KeyStoreException.html" title="class or interface in java.security">KeyStoreException</A></CODE></DL></DD></DL><HR><A NAME="isDSACertificate(java.security.cert.X509Certificate)"><!-- --></A><H3>isDSACertificate</H3><PRE>public static boolean <B>isDSACertificate</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/cert/X509Certificate.html" title="class or interface in java.security.cert">X509Certificate</A> certificate) throws <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/KeyStoreException.html" title="class or interface in java.security">KeyStoreException</A></PRE><DL><DD>Returns true if the specified certificate is using the DSA algorithm. The DSA algorithm is not good for encryption but only for authentication. On the other hand, the RSA algorithm is good for encryption and authentication.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>certificate</CODE> - the certificate to analyze.<DT><B>Returns:</B><DD>true if the specified certificate is using the DSA algorithm.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/KeyStoreException.html" title="class or interface in java.security">KeyStoreException</A></CODE></DL></DD></DL><HR><A NAME="isSelfSignedCertificate(java.security.KeyStore, java.lang.String)"><!-- --></A><H3>isSelfSignedCertificate</H3><PRE>public static boolean <B>isSelfSignedCertificate</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/KeyStore.html" title="class or interface in java.security">KeyStore</A> keyStore, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> alias) throws <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/KeyStoreException.html" title="class or interface in java.security">KeyStoreException</A></PRE><DL><DD>Returns true if the specified certificate is a self-signed certificate.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>keyStore</CODE> - key store that holds the certificate to verify.<DD><CODE>alias</CODE> - alias of the certificate in the key store.<DT><B>Returns:</B><DD>true if the specified certificate is a self-signed certificate.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/KeyStoreException.html" title="class or interface in java.security">KeyStoreException</A></CODE> - if an error happens while usign the keystore</DL></DD></DL><HR><A NAME="isSelfSignedCertificate(java.security.KeyStore, java.security.cert.X509Certificate)"><!-- --></A><H3>isSelfSignedCertificate</H3><PRE>public static boolean <B>isSelfSignedCertificate</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/KeyStore.html" title="class or interface in java.security">KeyStore</A> keyStore, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/cert/X509Certificate.html" title="class or interface in java.security.cert">X509Certificate</A> certificate) throws <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/KeyStoreException.html" title="class or interface in java.security">KeyStoreException</A></PRE><DL><DD>Returns true if the specified certificate is a self-signed certificate. If the certificate was not found in the store then a KeyStoreException is returned.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>keyStore</CODE> - key store that holds the certificate to verify.<DD><CODE>certificate</CODE> - the certificate in the key store.<DT><B>Returns:</B><DD>true if the specified certificate is a self-signed certificate.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/KeyStoreException.html" title="class or interface in java.security">KeyStoreException</A></CODE> - if an error happens while usign the keystore</DL></DD></DL><HR><A NAME="isSigningRequestPending(java.security.KeyStore, java.lang.String)"><!-- --></A><H3>isSigningRequestPending</H3><PRE>public static boolean <B>isSigningRequestPending</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/KeyStore.html" title="class or interface in java.security">KeyStore</A> keyStore, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> alias) throws <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/KeyStoreException.html" title="class or interface in java.security">KeyStoreException</A></PRE><DL><DD>Returns true if the specified certificate is ready to be signed by a Certificate Authority. Self-signed certificates need to get their issuer information entered to be able to generate a Certificate Signing Request (CSR).<P><DD><DL><DT><B>Parameters:</B><DD><CODE>keyStore</CODE> - key store that holds the certificate to verify.<DD><CODE>alias</CODE> - alias of the certificate in the key store.<DT><B>Returns:</B><DD>true if the specified certificate is ready to be signed by a Certificate Authority.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/KeyStoreException.html" title="class or interface in java.security">KeyStoreException</A></CODE> - if an error happens while usign the keystore</DL></DD></DL>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -