}
return CmpMessageHelper.createUnprotectedErrorMessage(msg, ResponseStatus.FAILURE, FailInfo.BAD_MESSAGE_CHECK, errMsg);
}
}
// Create a username and password and register the new user in EJBCA
final UsernameGenerator gen = UsernameGenerator.getInstance(this.usernameGenParams);
// Don't convert this DN to an ordered EJBCA DN string with CertTools.stringToBCDNString because we don't want double escaping of some characters
final IRequestMessage req = this.extendedUserDataHandler!=null ? this.extendedUserDataHandler.processRequestMessage(crmfreq, certProfileName) : crmfreq;
final X509Name dnname = req.getRequestX509Name();
if (LOG.isDebugEnabled()) {
LOG.debug("Creating username from base dn: "+dnname.toString());
}
final String username = gen.generateUsername(dnname.toString());
final String pwd;
if (StringUtils.equals(this.userPwdParams, "random")) {
if (LOG.isDebugEnabled()) {
LOG.debug("Setting 12 char random user password.");
}