org.jdesktop.swingx.auth.KeyChain.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(162)

本文整理了Java中org.jdesktop.swingx.auth.KeyChain.<init>()方法的一些代码示例,展示了KeyChain.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。KeyChain.<init>()方法的具体详情如下:
包路径:org.jdesktop.swingx.auth.KeyChain
类名称:KeyChain
方法名:<init>

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);
  }
}

相关文章