log.debug("Returning a pre-set password in CRMF request");
}
ret = password;
} else {
// If there is "Registration Token Control" in the CertReqMsg regInfo containing a password, we can use that
AttributeTypeAndValue av = null;
int i = 0;
do {
av = getReq().getRegInfo(i);
if (av != null) {
if (StringUtils.equals(CRMFObjectIdentifiers.regCtrl_regToken.getId(), av.getObjectId().getId())) {
final DEREncodable enc = av.getParameters();
final DERUTF8String str = DERUTF8String.getInstance(enc);
ret = str.getString();
if (log.isDebugEnabled()) {
log.debug("Found a request password in CRMF request regCtrl_regToken");
}
}
}
i++;
} while ( (av != null) && (ret == null) );
}
if (ret == null) {
// If there is "Registration Token Control" in the CertRequest controls containing a password, we can use that
// Note, this is the correct way to use the regToken according to RFC4211, section "6.1. Registration Token Control"
AttributeTypeAndValue av = null;
int i = 0;
do {
av = getReq().getCertReq().getControls(i);
if (av != null) {
if (StringUtils.equals(CRMFObjectIdentifiers.regCtrl_regToken.getId(), av.getObjectId().getId())) {
final DEREncodable enc = av.getParameters();
final DERUTF8String str = DERUTF8String.getInstance(enc);
ret = str.getString();
if (log.isDebugEnabled()) {
log.debug("Found a request password in CRMF request regCtrl_regToken");
}