use of com.ibm.as400.access.AS400SecurityException in project DCM-tools by ThePrez.
the class DcmApiCaller method callQycdUpdateCertUsage.
public void callQycdUpdateCertUsage(final AppLogger _logger, final String _appId, final String _certStoreName, final String _certId) throws PropertyVetoException, AS400SecurityException, ErrorCompletingRequestException, IOException, InterruptedException, ObjectDoesNotExistException {
final ServiceProgramCall program = new ServiceProgramCall(m_conn);
final String programName = "/QSYS.LIB/QICSS.LIB/QYCDCUSG.SRVPGM";
final ProgramParameter[] parameterList = new ProgramParameter[8];
// 1 Application ID Output Char(*)
parameterList[0] = new ProgramParameter(new AS400Text(_appId.length()).toBytes(_appId));
// 2 Length of application ID Input Binary(4)
parameterList[1] = new ProgramParameter(new AS400Bin4().toBytes(_appId.length()));
// 3 Certificate store name Input Char(*)
parameterList[2] = new ProgramParameter(new AS400Text(_certStoreName.length()).toBytes(_certStoreName));
// 4 Length of certificate store name Input Binary(4)
parameterList[3] = new ProgramParameter(new AS400Bin4().toBytes(_certStoreName.length()));
// 5 Certificate ID type Input Char(*)
parameterList[4] = new ProgramParameter(new AS400Text(1).toBytes("1"));
// 6 Certificate ID Input Char(*)
parameterList[5] = new ProgramParameter(new AS400Text(_certId.length()).toBytes(_certId));
// 7 Length of certificate ID Input Binary(4)
parameterList[6] = new ProgramParameter(new AS400Bin4().toBytes(_certId.length()));
// 8 Error code I/O Char(*)
final ErrorCodeParameter ec = new ErrorCodeParameter(true, true);
parameterList[7] = ec;
program.setProgram(programName, parameterList);
program.setProcedureName("QycdUpdateCertUsage");
// Run the program.
runProgram(_logger, program, ec);
}
use of com.ibm.as400.access.AS400SecurityException in project openicf by Evolveum.
the class OS400Connector method init.
/**
* Callback method to receive the {@link Configuration}.
*
* @see Connector#init(org.identityconnectors.framework.spi.Configuration)
*/
public void init(Configuration configuration1) {
this.configuration = (OS400Configuration) configuration1;
if (as400 == null) {
try {
final StringBuilder clear = new StringBuilder();
GuardedString.Accessor accessor = new GuardedString.Accessor() {
public void access(char[] clearChars) {
clear.append(clearChars);
}
};
configuration.getPassword().access(accessor);
if (configuration.isSsl()) {
as400 = new SecureAS400(configuration.getHost(), configuration.getRemoteUser(), clear.toString());
} else {
as400 = new AS400(configuration.getHost(), configuration.getRemoteUser(), clear.toString());
}
clear.setLength(0);
if (as400 == null) {
throw new ConnectorException("Connection Exception");
}
if (!as400.validateSignon()) {
throw new ConnectorSecurityException("Login Error");
}
try {
as400.setGuiAvailable(false);
fetchPasswordLevel();
} catch (Exception e) {
}
} catch (AS400SecurityException e) {
throw new ConnectorSecurityException(e);
} catch (IOException e) {
throw new ConnectorIOException(e);
}
}
}
Aggregations