}

  if (certparam.sbjpubkey === "%PUBKEY%") {
    var pubkey = KEYUTIL.getKey(f1.pubkey1.value);
    certparam.sbjpubkey = pubkey;
  }

  if (certparam.cakey === "%PRVKEY%") {
    var prvkey;
    if (f1.cakeypass1 !== "") {
      prvkey = KEYUTIL.getKey(f1.cakey1.value, f1.cakeypass1.value);
    } else {
      prvkey = KEYUTIL.getKey(f1.cakey1.value);
    }
    certparam.cakey = prvkey;
  }

  var certpem = null;
  try {
    certpem = (new KJUR.asn1.x509.Certificate(certparam)).getPEM();