usn.net.ssl.util.KeyStoreWrapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of install-cert Show documentation
Show all versions of install-cert Show documentation
A utility to add certs to the trust store from a connection attempt, originially written by Oracle
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package usn.net.ssl.util;
import java.io.File;
import java.security.KeyStore;
/**
*
* @author AO
*/
public class KeyStoreWrapper {
private KeyStore store;
private File keyStoreLocation;
private char[] keyStorePassword;
public KeyStore getStore() {
return store;
}
public void clear() {
for (int i = 0; i < keyStorePassword.length; i++) {
keyStorePassword[i] = (char) 0;
}
keyStorePassword = null;
keyStoreLocation = null;
}
public void setStore(KeyStore store) {
this.store = store;
}
public File getKeyStoreLocation() {
return keyStoreLocation;
}
public void setKeyStoreLocation(File keyStoreLocation) {
this.keyStoreLocation = keyStoreLocation;
}
public char[] getKeyStorePassword() {
return keyStorePassword;
}
public void setKeyStorePassword(char[] keyStorePassword) {
this.keyStorePassword = keyStorePassword;
}
@Override
public boolean equals(Object other) {
if (other instanceof KeyStoreWrapper) {
return keyStoreLocation.equals(((KeyStoreWrapper) other).keyStoreLocation);
}
return false;
}
@Override
public int hashCode() {
int hash = 7;
hash = 41 * hash + (this.keyStoreLocation != null ? this.keyStoreLocation.hashCode() : 0);
return hash;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy