本文整理了Java中org.jdesktop.swingx.auth.KeyChain.<init>()
方法的一些代码示例,展示了KeyChain.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。KeyChain.<init>()
方法的具体详情如下:
包路径:org.jdesktop.swingx.auth.KeyChain
类名称:KeyChain
方法名:<init>
[英]Creates an instance of KeyChain and initializes the store from the InputStream.
[中]创建KeyChain实例并从InputStream初始化存储。
代码示例来源:origin: org.swinglabs.swingx/swingx-core
public static void main(String[] args) {
try {
File file = new File("c:\\test.txt");
FileInputStream fis;
if (!file.exists()) {
file.createNewFile();
fis = null;
} else {
fis = new FileInputStream(file);
}
KeyChain kc = new KeyChain("test".toCharArray(), fis);
kc.addPassword("bino", "sun-ds.sfbay", "test123".toCharArray());
LOG.fine("pass = "
+ kc.getPassword("bino", "sun-ds.sfbay"));
LOG.fine("More testing :");
for (int i = 0; i < 100; i++) {
kc.addPassword("" + i, "sun-ds.sfbay", ("" + i).toCharArray());
}
for (int i = 0; i < 100; i++) {
LOG.fine("key =" + i + " pass ="
+ kc.getPassword("" + i, "sun-ds.sfbay"));
}
kc.store(new FileOutputStream(file));
} catch (Exception e) {
LOG.log(Level.WARNING, "", e);
}
}
代码示例来源:origin: org.codehaus.jtstand/jtstand-desktop
public static void main(String[] args) {
try {
File file = new File("c:\\test.txt");
FileInputStream fis;
if (!file.exists()) {
file.createNewFile();
fis = null;
} else {
fis = new FileInputStream(file);
}
KeyChain kc = new KeyChain("test".toCharArray(), fis);
kc.addPassword("bino", "sun-ds.sfbay", "test123".toCharArray());
LOG.fine("pass = "
+ kc.getPassword("bino", "sun-ds.sfbay"));
LOG.fine("More testing :");
for (int i = 0; i < 100; i++) {
kc.addPassword("" + i, "sun-ds.sfbay", ("" + i).toCharArray());
}
for (int i = 0; i < 100; i++) {
LOG.fine("key =" + i + " pass ="
+ kc.getPassword("" + i, "sun-ds.sfbay"));
}
kc.store(new FileOutputStream(file));
} catch (Exception e) {
LOG.log(Level.WARNING, "", e);
}
}
代码示例来源:origin: com.haulmont.thirdparty/swingx-core
public static void main(String[] args) {
try {
File file = new File("c:\\test.txt");
FileInputStream fis;
if (!file.exists()) {
file.createNewFile();
fis = null;
} else {
fis = new FileInputStream(file);
}
KeyChain kc = new KeyChain("test".toCharArray(), fis);
kc.addPassword("bino", "sun-ds.sfbay", "test123".toCharArray());
LOG.fine("pass = "
+ kc.getPassword("bino", "sun-ds.sfbay"));
LOG.fine("More testing :");
for (int i = 0; i < 100; i++) {
kc.addPassword("" + i, "sun-ds.sfbay", ("" + i).toCharArray());
}
for (int i = 0; i < 100; i++) {
LOG.fine("key =" + i + " pass ="
+ kc.getPassword("" + i, "sun-ds.sfbay"));
}
kc.store(new FileOutputStream(file));
} catch (Exception e) {
LOG.log(Level.WARNING, "", e);
}
}
代码示例来源:origin: org.swinglabs.swingx/swingx-all
public static void main(String[] args) {
try {
File file = new File("c:\\test.txt");
FileInputStream fis;
if (!file.exists()) {
file.createNewFile();
fis = null;
} else {
fis = new FileInputStream(file);
}
KeyChain kc = new KeyChain("test".toCharArray(), fis);
kc.addPassword("bino", "sun-ds.sfbay", "test123".toCharArray());
LOG.fine("pass = "
+ kc.getPassword("bino", "sun-ds.sfbay"));
LOG.fine("More testing :");
for (int i = 0; i < 100; i++) {
kc.addPassword("" + i, "sun-ds.sfbay", ("" + i).toCharArray());
}
for (int i = 0; i < 100; i++) {
LOG.fine("key =" + i + " pass ="
+ kc.getPassword("" + i, "sun-ds.sfbay"));
}
kc.store(new FileOutputStream(file));
} catch (Exception e) {
LOG.log(Level.WARNING, "", e);
}
}
代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core
public static void main(String[] args) {
try {
File file = new File("c:\\test.txt");
FileInputStream fis;
if (!file.exists()) {
file.createNewFile();
fis = null;
} else {
fis = new FileInputStream(file);
}
KeyChain kc = new KeyChain("test".toCharArray(), fis);
kc.addPassword("bino", "sun-ds.sfbay", "test123".toCharArray());
LOG.fine("pass = "
+ kc.getPassword("bino", "sun-ds.sfbay"));
LOG.fine("More testing :");
for (int i = 0; i < 100; i++) {
kc.addPassword("" + i, "sun-ds.sfbay", ("" + i).toCharArray());
}
for (int i = 0; i < 100; i++) {
LOG.fine("key =" + i + " pass ="
+ kc.getPassword("" + i, "sun-ds.sfbay"));
}
kc.store(new FileOutputStream(file));
} catch (Exception e) {
LOG.log(Level.WARNING, "", e);
}
}
内容来源于网络,如有侵权,请联系作者删除!