📄 keystoreinfo.java
字号:
/*
* This file is part of the QuickServer library
* Copyright (C) 2003-2005 QuickServer.org
*
* Use, modification, copying and distribution of this software is subject to
* the terms and conditions of the GNU Lesser General Public License.
* You should have received a copy of the GNU LGP License along with this
* library; if not, you can download a copy from <http://www.quickserver.org/>.
*
* For questions, suggestions, bug-reports, enhancement-requests etc.
* visit http://www.quickserver.org
*
*/
package org.quickserver.util.xmlreader;
/**
* This class encapsulate Key Store.
* The example xml is <pre>
....
<key-store-info>
<store-file>NONE</store-file>
<store-password></store-password>
<key-password></key-password>
</key-store-info>
....
</pre>
* @see TrustStoreInfo
* @see SecureStore
* @see Secure
* @author Akshathkumar Shetty
* @since 1.4
*/
public class KeyStoreInfo implements java.io.Serializable {
private String storeFile = "NONE";
private String storePassword = null;
private String keyPassword = null;
/**
* Sets the store file path. This can be either absolute or
* relative(to config file) path to the store file.
* XML Tag: <store-file>NONE</store-file>
* @param storeFile store file.
* @see #getStoreFile
*/
public void setStoreFile(String storeFile) {
if(storeFile!=null && storeFile.trim().length()!=0)
this.storeFile = storeFile;
}
/**
* Returns the store file path. This can be either absolute or
* relative(to config file) path to the store file.
* @see #setStoreFile
*/
public String getStoreFile() {
return storeFile;
}
/**
* Sets the store password.
* XML Tag: <store-password></store-password>
* @param storePassword store password
* @see #getStorePassword
*/
public void setStorePassword(String storePassword) {
if(storePassword!=null)
this.storePassword = storePassword;
}
/**
* Returns store password.
* @see #setStorePassword
*/
public String getStorePassword() {
return storePassword;
}
/**
* Sets the key password.
* XML Tag: <key-password></key-password>
* @param keyPassword key password
* @see #getKeyPassword
*/
public void setKeyPassword(String keyPassword) {
if(keyPassword!=null)
this.keyPassword = keyPassword;
}
/**
* Returns key password.
* @see #setKeyPassword
*/
public String getKeyPassword() {
return keyPassword;
}
/**
* Returns XML config of this class.
*/
public String toXML(String pad) {
if(pad==null) pad="";
StringBuffer sb = new StringBuffer();
sb.append(pad+"<key-store-info>\n");
sb.append(pad+"\t<store-file>"+getStoreFile()+"</store-file>\n");
if(getStorePassword()!=null)
sb.append(pad+"\t<store-password>"+getStorePassword()+"</store-password>\n");
else
sb.append(pad+"\t</store-password>\n");
if(getKeyPassword()!=null)
sb.append(pad+"\t<key-password>"+getKeyPassword()+"</key-password>\n");
else
sb.append(pad+"\t</key-password>\n");
sb.append(pad+"</key-store-info>\n");
return sb.toString();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -