use of java.security.KeyStore.ProtectionParameter in project XobotOS by xamarin.
the class JDKPKCS12KeyStore method engineStore.
public void engineStore(LoadStoreParameter param) throws IOException, NoSuchAlgorithmException, CertificateException {
if (param == null) {
throw new IllegalArgumentException("'param' arg cannot be null");
}
if (!(param instanceof JDKPKCS12StoreParameter)) {
throw new IllegalArgumentException("No support for 'param' of type " + param.getClass().getName());
}
JDKPKCS12StoreParameter bcParam = (JDKPKCS12StoreParameter) param;
char[] password;
ProtectionParameter protParam = param.getProtectionParameter();
if (protParam == null) {
password = null;
} else if (protParam instanceof KeyStore.PasswordProtection) {
password = ((KeyStore.PasswordProtection) protParam).getPassword();
} else {
throw new IllegalArgumentException("No support for protection parameter of type " + protParam.getClass().getName());
}
doStore(bcParam.getOutputStream(), password, bcParam.isUseDEREncoding());
}
Aggregations