diff --git a/pom.xml b/pom.xml index 4180f16a..30691b6f 100644 --- a/pom.xml +++ b/pom.xml @@ -494,6 +494,20 @@ poi-ooxml 3.9 --> + + + + com.sci.v2.ipin.secu + sciSecuIPIN_Publish + 2.0 + + + + + com.sci.v2.ipin.secu + sciSecuPCC + 1.0 + diff --git a/src/main/java/kcc/com/uss/ion/pwm/web/EgovPopupManageController.java b/src/main/java/kcc/com/uss/ion/pwm/web/EgovPopupManageController.java index 8c33f19c..b156cdd8 100644 --- a/src/main/java/kcc/com/uss/ion/pwm/web/EgovPopupManageController.java +++ b/src/main/java/kcc/com/uss/ion/pwm/web/EgovPopupManageController.java @@ -1144,7 +1144,10 @@ public class EgovPopupManageController { } //------------------------------------------------------------ FileVO fvo = fileService.selectFileInf(vo); - + if(fvo == null) { + throw new Exception("파일이 데이터베이스에서 조회되지 않습니다."); + } + String fileNm = fvo.getStreFileNm(); // 섬네일 이미지 경우 if (isThumbFile != null && ("thumbFile").equals(isThumbFile) && fvo.getThumbFileNm() != null) { diff --git a/src/main/java/kcc/let/uat/uia/service/CertVO.java b/src/main/java/kcc/let/uat/uia/service/CertVO.java new file mode 100644 index 00000000..78d67c90 --- /dev/null +++ b/src/main/java/kcc/let/uat/uia/service/CertVO.java @@ -0,0 +1,36 @@ +package kcc.let.uat.uia.service; + +import java.io.Serializable; + +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@NoArgsConstructor +public class CertVO implements Serializable{ + + private static final long serialVersionUID = 1L; + + private String nextUrl; // 다음 이동 페이지 + /** + * 본인인증 접근 페이지 구분 + * medi - 분쟁조정신청 본인인증 + * my - 마이페이지 본인인증 + * online - 온라인 분쟁조정 상담 본인인증 + * law - 법령자료실 + * medi_check - ? + */ + private String commandCode; // 본인인증 접근 페이지 구분(medi: 분쟁조정신청 본인인증, + + private String srvNo; // 아이핀 코드 + private String hpSrvNo; // 휴대폰 코드 + private String agreeCheck; // 약관동의 + private String personalCheck; // 개인정보 동의 + private String mediType; // 조정유형 (C_MASTER :: CASE_GUBUN) + private String retUrl; // 아이핀 인증후 리턴 페이지 + private String hpRetUrl; // 모바일 인증후 리턴 페이지 + + private String sServerName; // 현재 서버 주소 +} diff --git a/src/main/java/kcc/utill/CertSettingUtill.java b/src/main/java/kcc/utill/CertSettingUtill.java new file mode 100644 index 00000000..f64ce1cb --- /dev/null +++ b/src/main/java/kcc/utill/CertSettingUtill.java @@ -0,0 +1,322 @@ +package kcc.utill; + +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Random; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; +import org.springframework.ui.ModelMap; + +import com.sci.v2.ipin.secu.SciSecuManager; +import com.sci.v2.ipin.secu.hmac.SciHmac; + +import kcc.com.utl.fcc.service.EgovNumberUtil; +import kcc.com.utl.fcc.service.EgovStringUtil; +import seed.utils.SeedUtils; + +@Component +public class CertSettingUtill { + + @Value("#{globalSettings['cert.sServerName']}") + private String sServerName; + + private static final Logger LOGGER = LoggerFactory.getLogger(CertSettingUtill.class); + + public CertSettingUtill() { + } + + public void CertSetting( + HttpSession session + , ModelMap map + , HttpServletRequest req + , String commandCode + ) { + + + //본인인증에 필요한 값들 세팅 + + String nextUrl = req.getParameter("nextUrl"); +// String commandCode = req.getParameter("commandCode"); + + String srvNo = ""; + String hpSrvNo = ""; + String agreeCheck = ""; + String personalCheck = ""; + String mediType = ""; + String retUrl = "";//아이핀 인증후 리턴 페이지 + String hpRetUrl = "";//모바일 인증후 리턴 페이지 + +// String sServerName = req.getServerName(); + + if(commandCode.equals("medi")){//분쟁조정신청 본인인증 + + //개발서버 +// srvNo = "007001";// 아이핀 코드 +// hpSrvNo = "008001";//휴대폰 코드 + + //실서버 + srvNo = "009001";// 아이핀 코드 + hpSrvNo = "012001";//휴대폰 코드 + + agreeCheck = req.getParameter("agreeCheck"); + personalCheck = req.getParameter("personalCheck"); + mediType = req.getParameter("mediType"); + + retUrl = sServerName + "/user/extra/case/siren/ipin_popup_seed/jsp/Page.do"; + hpRetUrl = sServerName + "/user/extra/case/siren/hpParamPop/jsp/Page.do"; + + session.setAttribute("agreeCheck", agreeCheck); + session.setAttribute("personalCheck", personalCheck); + session.setAttribute("mediType", mediType); + //hpName존재하면 이미 본인인증을 거쳤기 때문에 다음으로 바로 넘어간다. + if(!SeedUtils.setReplaceNull(session.getAttribute("hpName")).equals("")){ +// nextUrl = "/user/mediation/case/05/154/mediationStep04Ftc.do"; + nextUrl = "/user/mediation/case/05/154/mediationStep04.do"; + } + }else if(commandCode.equals("my")){//마이페이지 본인인증 + //개발서버 +// srvNo = "007002"; +// hpSrvNo = "008002"; + + //실서버 + srvNo = "009002"; + hpSrvNo = "012002"; + + retUrl = sServerName + "/user/extra/case/siren/myPage_ipin_popup_seed/jsp/Page.do"; + hpRetUrl = sServerName + "/user/extra/case/siren/myPage_hpParamPop/jsp/Page.do"; + + }else if(commandCode.equals("online")){//온라인 분쟁조정 상담 본인인증 + //개발서버 + srvNo = "007003"; + hpSrvNo = "008003"; + + //실서버 +// srvNo = "009003"; +// hpSrvNo = "012003"; + + personalCheck = req.getParameter("personalCheck"); + session.setAttribute("personalCheck", personalCheck); + + //개발서버 +// retUrl = "23http://ServerName:8080/user/extra/case/siren/onlineCounsel_ipin_popup_seed/jsp/Page.do"; +// retUrl = retUrl.replaceAll("ServerName", sServerName); + +// hpRetUrl = "32http://ServerName:8080/user/extra/case/siren/onlineCounsel_hpParamPop/jsp/Page.do"; +// hpRetUrl = hpRetUrl.replaceAll("ServerName", sServerName); + + //실서버 + retUrl = "23http://fairnet.kofair.or.kr/user/extra/case/siren/onlineCounsel_ipin_popup_seed/jsp/Page.do"; + + hpRetUrl = "32http://fairnet.kofair.or.kr/user/extra/case/siren/onlineCounsel_hpParamPop/jsp/Page.do"; + + //hpName존재하면 이미 본인인증을 거쳤기 때문에 다음으로 바로 넘어간다. + if(!SeedUtils.setReplaceNull(session.getAttribute("hpName")).equals("")){ + nextUrl = "/user/onlineCounsel/case/01/158/write.do"; + } + }else if(commandCode.equals("law")){ + //개발서버 +// srvNo = "007004"; +// hpSrvNo = "008005"; + + //실서버 + srvNo = "009004"; + hpSrvNo = "012004"; + + personalCheck = req.getParameter("personalCheck"); + session.setAttribute("personalCheck", personalCheck); + + //개발서버 +// retUrl = "23http://ServerName:8080/user/extra/case/siren/lawCounsel_ipin_popup_seed/jsp/Page.do"; +// retUrl = retUrl.replaceAll("ServerName", sServerName); + +// hpRetUrl = "32http://ServerName:8080/user/extra/case/siren/lawCounsel_hpParamPop/jsp/Page.do"; +// hpRetUrl = hpRetUrl.replaceAll("ServerName", sServerName); + + + //실서버 + retUrl = "23http://fairnet.kofair.or.kr/user/extra/case/siren/lawCounsel_ipin_popup_seed/jsp/Page.do"; + + hpRetUrl = "32http://fairnet.kofair.or.kr/user/extra/case/siren/lawCounsel_hpParamPop/jsp/Page.do"; + + //hpName존재하면 이미 본인인증을 거쳤기 때문에 다음으로 바로 넘어간다. + if(!SeedUtils.setReplaceNull(session.getAttribute("hpName")).equals("")){ + nextUrl = "/user/lawCounsel/case/02/159/lawWrite.do"; + } + }else if(commandCode.equals("medi_check")){ + //개발서버 +// srvNo = "007005"; +// hpSrvNo = "008006"; + + //실서버 + srvNo = "009005"; + hpSrvNo = "012005"; + + String caseNo = req.getParameter("caseNo"); + String checkPass = req.getParameter("checkPass"); + + session.setAttribute("caseNo", caseNo); + session.setAttribute("checkPass", checkPass); + + //개발서버 +// retUrl = "23http://ServerName:8080/user/extra/case/siren/checkMedi_ipin_popup_seed/jsp/Page.do"; +// retUrl = retUrl.replaceAll("ServerName", sServerName); + +// hpRetUrl = "32http://ServerName:8080/user/extra/case/siren/checkMedi_hpParamPop/jsp/Page.do"; +// hpRetUrl = hpRetUrl.replaceAll("ServerName", sServerName); + + + //실서버 + retUrl = "23http://fairnet.kofair.or.kr/user/extra/case/siren/checkMedi_ipin_popup_seed/jsp/Page.do"; + + hpRetUrl = "32http://fairnet.kofair.or.kr/user/extra/case/siren/checkMedi_hpParamPop/jsp/Page.do"; + + } + + //나중에 메인 페이지 나오면 튕겨내기 +// if(nextUrl == null || agreeCheck == null){ +// map.put("siteIdx", "case"); +// map.put("url", "/case/index.do"); +// map.put("message", "잘못된 접근 입니다."); +// map.put("opener", ""); +// map.put("append", ""); +// map.put("self", ""); +// +// return "/_common/jsp/umessage"; +// } + + + /** + * 아이핀 인증 시작 */ + + //String sServerName = req.getServerName(); + + //회원사 ID : KFA001 + String id = "KFA001"; + //회원가입화면용 결과 수신 URL : 23http:/211.43.219.170/hp/meb/pinSignupView.do + //String retUrl = "23http://ServerName/user/extra/case/siren/ipin_popup_seed/jsp/Page.do"; + //retUrl = retUrl.replaceAll("ServerName", sServerName); + //분쟁조정신청 서비스 번호 : 006001 + // String srvNo = "006001"; + //요청번호(유닉크한 랜덤값) : 40 byte까지 + String reqNum = "kofair" + EgovStringUtil.getTimeStamp() + EgovNumberUtil.getRandomNum(1000, 9999); + + session.setAttribute("id", id); + session.setAttribute("retUrl", retUrl); + session.setAttribute("srvNo", srvNo); + session.setAttribute("reqNum", reqNum); + //복호화용 임시필드 + + String exVar = "0000000000000000"; + + /** + * + * reqNum 값은 최종 결과값 복호화를 위한 SecuKey로 활용 되므로 중요합니다. + * reqNum 은 아이핀 서비스 요청시 항상 새로운 값으로 중복 되지 않게 생성 해야 합니다. + * 쿠키 또는 Session및 기타 방법을 사용해서 reqNum 값을 + * ipin_result_seed.jsp에서 가져 올 수 있도록 해야 함. + * 샘플을 위해서 쿠키를 사용한 것이므로 참고 하시길 바랍니다. + * + */ + /* Cookie c = new Cookie("reqNum", reqNum); + //c.setMaxAge(1800); // <== 필요시 설정(초단위로 설정됩니다) + response.addCookie(c);*/ + + session.setAttribute("reqNumKey", reqNum); + + // 암호화 모듈 선언 + SciSecuManager seed = new SciSecuManager(); + // 1차 암호화 + String encStr = ""; + String reqInfo = reqNum + "/" + id + "/" + srvNo + "/" + exVar; + encStr = seed.getEncPublic(reqInfo); + // 위변조 검증 값 등록 + SciHmac hmac = new SciHmac(); + String hmacMsg = SciHmac.HMacEncriptPublic(encStr); + // 2차 암호화 + reqInfo = seed.getEncPublic(encStr + "/" + hmacMsg + "/" + "00000000"); + session.setAttribute("reqInfo", reqInfo); + + /** + * 아이핀 인증 끝 */ + + + /** + * 핸드폰 인증 시작 */ + + //날짜 생성 + Calendar today = Calendar.getInstance(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); + String day = sdf.format(today.getTime()); + + java.util.Random ran = new Random(); + //랜덤 문자 길이 + int numLength = 6; + String randomStr = ""; + + for (int i = 0; i < numLength; i++) { + //0 ~ 9 랜덤 숫자 생성 + randomStr += ran.nextInt(10); + } + + //reqNum은 최대 40byte 까지 사용 가능 + + String hpId = "SKFA001"; // 본인실명확인 회원사 아이디 + //String hpSrvNo = "005001"; // 본인실명확인 서비스번호 + String hpReqNum = day + randomStr; // 본인실명확인 요청번호 + String hpExVar = "0000000000000000"; // 복호화용 임시필드 + String hpCertDate = day; // 본인실명확인 요청시간 + String hpCertGb = "H"; // 본인실명확인 본인확인 인증수단 + String hpAddVar = ""; // 본인실명확인 추가 파라메터 + + //String hpRetUrl = "32http://ServerName/kmcis/kmcisIdSearch.jsp"; // 본인인증서비스 결과수신 POPUP URL + //String hpRetUrl = "32http://ServerName/user/extra/case/siren/hpParamPop/jsp/Page.do"; + + //hpRetUrl = "32http://kofair2.global-it.co.kr/kmcis/kmcisIdSearch.jsp"; + //hpRetUrl = hpRetUrl.replaceAll("ServerName", sServerName); //오픈할 때 주석으로 교체해줘야함 + + + /** + * + * reqNum 값은 최종 결과값 복호화를 위한 SecuKey로 활용 되므로 중요합니다. + * reqNum 은 본인 확인 요청시 항상 새로운 값으로 중복 되지 않게 생성 해야 합니다. + * 쿠키 또는 Session및 기타 방법을 사용해서 reqNum 값을 + * pcc_V3_result_seed.jsp에서 가져 올 수 있도록 해야 함. + * 샘플을 위해서 쿠키를 사용한 것이므로 참고 하시길 바랍니다. + * + */ + /*Cookie hpC = new Cookie("hpReqNum", hpReqNum); + //c.setMaxAge(1800); // <== 필요시 설정(초단위로 설정됩니다) + response.addCookie(hpC);*/ + + session.setAttribute("hpReqNumKey", hpReqNum); + + //01. 암호화 모듈 선언 + com.sci.v2.pcc.secu.SciSecuManager hpSeed = new com.sci.v2.pcc.secu.SciSecuManager(); + + //02. 1차 암호화 + String hpEncStr = ""; + String hpReqInfo = hpId+"^"+hpSrvNo+"^"+hpReqNum+"^"+hpCertDate+"^"+hpCertGb+"^"+hpAddVar+"^"+hpExVar; // 데이터 암호화 + hpEncStr = hpSeed.getEncPublic(hpReqInfo); + + //03. 위변조 검증 값 생성 + com.sci.v2.pcc.secu.hmac.SciHmac hpHmac = new com.sci.v2.pcc.secu.hmac.SciHmac(); + String hpHmacMsg = hpHmac.HMacEncriptPublic(hpEncStr); + + //03. 2차 암호화 + hpReqInfo = hpSeed.getEncPublic(hpEncStr + "^" + hpHmacMsg + "^" + "0000000000000000"); //2차암호화 + + session.setAttribute("hpRetUrl", hpRetUrl); + session.setAttribute("hpReqInfo", hpReqInfo); + + /** + * 핸드폰 인증 끝 */ + } + + +} \ No newline at end of file diff --git a/src/main/java/kcc/web/MainController.java b/src/main/java/kcc/web/MainController.java index a0779c6b..c3edc093 100644 --- a/src/main/java/kcc/web/MainController.java +++ b/src/main/java/kcc/web/MainController.java @@ -1,10 +1,11 @@ package kcc.web; import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; +import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Collections; +import java.util.Comparator; import java.util.Date; import java.util.HashMap; import java.util.HashSet; @@ -13,7 +14,6 @@ import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Properties; -import java.util.stream.Collector; import java.util.stream.Collectors; import javax.activation.DataHandler; @@ -35,8 +35,6 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; -import org.json.simple.JSONArray; -import org.json.simple.JSONObject; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; @@ -58,19 +56,16 @@ import egovframework.rte.fdl.security.intercept.EgovReloadableFilterInvocationSe import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper; import egovframework.rte.psl.dataaccess.util.EgovMap; import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; -import kcc.com.cmm.ComDefaultCodeVO; +import kcc.com.cmm.CmmUtil; import kcc.com.cmm.ComDefaultVO; import kcc.com.cmm.LoginVO; -import kcc.com.cmm.service.CmmnDetailCode; import kcc.com.cmm.service.EgovCmmUseService; import kcc.com.cmm.service.EgovFileMngUtil; import kcc.com.cmm.service.FileVO; import kcc.com.cmm.util.WebUtil; -import kcc.com.uss.ion.bnr.service.BannerVO; import kcc.com.uss.ion.bnr.service.EgovBannerService; import kcc.com.uss.ion.cnf.service.MetaTagManageService; import kcc.com.uss.ion.cyb.service.CyberAlertManageService; -import kcc.com.uss.ion.cyb.service.CyberAlertManageVO; import kcc.com.uss.ion.fms.service.FmsFileVO; import kcc.com.uss.ion.pwm.service.EgovPopupManageService; import kcc.com.uss.ion.pwm.service.MainzoneVO; @@ -81,7 +76,6 @@ import kcc.let.cop.bbs.service.BoardMasterVO; import kcc.let.cop.bbs.service.BoardVO; import kcc.let.cop.bbs.service.EgovBBSAttributeManageService; import kcc.let.cop.bbs.service.EgovBBSManageService; -import kcc.let.cop.bbs.service.SearchTotalVO; import kcc.let.sts.cst.service.EgovConectStatsService; import kcc.let.sym.ccm.cde.service.EgovCcmCmmnDetailCodeManageService; import kcc.let.sym.log.clg.service.EgovLoginLogService; @@ -94,7 +88,6 @@ import kcc.let.sym.prm.service.EgovProgrmManageService; import kcc.let.sym.prm.service.ProgrmManageVO; import kcc.let.sym.site.service.EgovSiteManagerService; import kcc.let.sym.site.service.SiteManagerVO; -import kcc.let.uat.uia.service.SsoLoginVO; /** * 템플릿 메인 페이지 컨트롤러 클래스(Sample 소스) @@ -196,48 +189,31 @@ public class MainController { @RequestMapping(value = "/web/main/mainPage.do") public String siteMainPage(HttpServletRequest request, ModelMap model, HttpSession session) throws Exception { - // 메인이미지 -// String referer = (String)request.getHeader("REFERER"); /** EgovPropertyService.sample */ MainzoneVO mainzoneVO = new MainzoneVO(); mainzoneVO.setPageUnit(propertiesService.getInt("pageUnit")); mainzoneVO.setPageSize(propertiesService.getInt("pageSize")); + CmmUtil.getPageing(mainzoneVO, 10); /** pageing */ - PaginationInfo paginationInfo = new PaginationInfo(); - paginationInfo.setCurrentPageNo(mainzoneVO.getPageIndex()); - paginationInfo.setRecordCountPerPage(mainzoneVO.getPageUnit()); - paginationInfo.setPageSize(mainzoneVO.getPageSize()); - - mainzoneVO.setFirstIndex(paginationInfo.getFirstRecordIndex()); - mainzoneVO.setLastIndex(paginationInfo.getLastRecordIndex()); - mainzoneVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); mainzoneVO.setUseYn("Y"); // 사용하는것만 mainzoneVO.setDeviceType("P"); // PC - List mainzoneList = egovPopupManageService.selectMainzoneList(mainzoneVO); // 상단메인 이미지 -// mainzoneVO.setDeviceType("M"); //모바일 -// List mainzoneListM = egovPopupManageService.selectMainzoneList(mainzoneVO); //상단메인 이미지 - - model.addAttribute("mainzoneList", mainzoneList); // PC -// model.addAttribute("mainzoneListM", mainzoneListM); //모바일 - - /* - * 반응형으로 사용을 해야해서 모바일에서도 팝업 존 영역의 데이터를 불러와야해서 주석처리했음 우영두 2021.10.29 - */ + List mainzoneList = (List)egovPopupManageService.selectMainzoneList(mainzoneVO); // 상단메인 이미지 + if(mainzoneList.size() > 0) { + mainzoneList.sort(Comparator.comparing((EgovMap map) -> Integer.valueOf(((BigDecimal) map.get("sort")).intValue()))); + } + model.addAttribute("mainzoneImg", mainzoneList.stream().findFirst().orElse(null)); // PC /** 팝업 알림창괸리 */ - // if(!isMobile(request)){ //PC인경우만 PopupManageVO popupManageVO = new PopupManageVO(); popupManageVO.setRecordCountPerPage(10); // 10개만 popupManageVO.setNtceAt("Y"); // 사용만 popupManageVO.setMainPageFlag("Y"); // 메인화면의 용도(시작일 종료일 사이 조회) List popupList = egovPopupManageService.selectPopupMainList(popupManageVO); model.addAttribute("popupList", popupList); - // } - /** 팝업존 알림창괸리 */ - // if(!isMobile(request)){ + /** 알림창괸리 */ PopupzoneVO popupzoneVo = new PopupzoneVO(); popupzoneVo.setFirstIndex(0); popupzoneVo.setSeCd("02"); // 좌측팝업 @@ -245,23 +221,12 @@ public class MainController { popupzoneVo.setSearchSortCnd("MB.sort"); popupzoneVo.setSearchSortOrd("ASC"); - List popupzoneList = egovPopupManageService.selectPopupzoneList(popupzoneVo); - model.addAttribute("popupzoneList", popupzoneList); - // popupzoneVo.setSeCd("03"); - // List popupzoneTopList = - // egovPopupManageService.selectPopupzoneList(popupzoneVo); - // model.addAttribute("popupzoneTopList", popupzoneTopList); - - // } - - /** 게시판 조회 - 조정사례 */ -// BoardVO boardVO = new BoardVO(); -// boardVO.setRecordCountPerPage(5); //게시글 수 -// boardVO.setFirstIndex(0); // -// boardVO.setBbsId("BBSMSTR_000000000651"); -// List vo = bbsMngService.selectMainBoardRecent(boardVO); - -// model.addAttribute("bbsList", vo); + List popupzoneList = (List)egovPopupManageService.selectPopupzoneList(popupzoneVo); +// model.addAttribute("popupzoneList", popupzoneList); + if(popupzoneList.size() > 0) { + popupzoneList.sort(Comparator.comparing((EgovMap map) -> Integer.valueOf(((BigDecimal) map.get("sort")).intValue()))); + } + model.addAttribute("popupzoneImg", popupzoneList.stream().findFirst().orElse(null)); // PC return "web/main/mainPage"; } diff --git a/src/main/java/kcc/xxx/web/XxxController.java b/src/main/java/kcc/xxx/web/XxxController.java index 1a340103..7f14f462 100644 --- a/src/main/java/kcc/xxx/web/XxxController.java +++ b/src/main/java/kcc/xxx/web/XxxController.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; import org.json.JSONArray; import org.json.simple.JSONObject; @@ -16,10 +17,12 @@ import org.springframework.web.bind.annotation.RequestMapping; import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; import kcc.com.cmm.CmmUtil; +import kcc.utill.CertSettingUtill; import kcc.utill.OzUtill; import kcc.xxx.service.XxxService; import kcc.xxx.service.XxxVO; import seed.map.T_MEMBER; +import seed.utils.SeedUtils; @Controller public class XxxController { @@ -32,6 +35,9 @@ public class XxxController { @Resource private OzUtill ozUtill; + @Resource + private CertSettingUtill certSettingUtill; + @RequestMapping("/xxx/xxxTest.do") public String xxxTest() throws Exception { @@ -179,4 +185,27 @@ public class XxxController { return "/web/xxx/xxxDetail"; } + + + @RequestMapping("/web/xxx/xxxCert.do") + public String xxxCert(HttpSession session + , ModelMap map + , HttpServletRequest req + ) { + + if(!SeedUtils.setReplaceNull(session.getAttribute("hpName")).equals("")){ + //미인증으로 본인인증이 필요하다는 페이지로 redirect + + return ""; + } + + if(SeedUtils.setReplaceNull(session.getAttribute("myPass")).equals("")){ + + certSettingUtill.CertSetting(session, map, req, "my"); + } + session.removeAttribute("myPass"); + + return "/web/xxx/xxxCert"; + } + } diff --git a/src/main/resources/egovframework/sqlmap/let/uss/pwm/PopupManage_SQL_Oracle.xml b/src/main/resources/egovframework/sqlmap/let/uss/pwm/PopupManage_SQL_Oracle.xml index a5e0dd17..f29de7df 100644 --- a/src/main/resources/egovframework/sqlmap/let/uss/pwm/PopupManage_SQL_Oracle.xml +++ b/src/main/resources/egovframework/sqlmap/let/uss/pwm/PopupManage_SQL_Oracle.xml @@ -653,11 +653,19 @@ - UPDATE MAINZONE A , (SELECT ROW_NUMBER() OVER(ORDER BY SORT) AS SORT1 , MAZ_ID FROM MAINZONE - WHERE 1=1 - ORDER BY SORT ASC) B - SET A.SORT = B.SORT1 - WHERE A.MAZ_ID = B.MAZ_ID + MERGE INTO MAINZONE A + USING ( + SELECT + ROW_NUMBER() OVER (ORDER BY SORT ASC) AS SORT1, + MAZ_ID + FROM + MAINZONE + WHERE + 1=1 + ) B + ON (A.MAZ_ID = B.MAZ_ID) + WHEN MATCHED THEN + UPDATE SET A.SORT = B.SORT1 @@ -678,14 +686,14 @@ CONTENT, MLINK, ISTARGET, - REGDT, + TO_CHAR(REGDT, 'YYYY-MM-DD HH24:MI:SS') REGDT, DEL, SORT, MAINZONE_IMAGE AS MAINZONEIMAGE , MAINZONE_IMAGE_FILE AS MAINZONEIMAGEFILE, MAZ_NM AS MAZNM, USE_YN AS USEYN, - DATE_FORMAT(MODDT, '%Y-%m-%d %H:%i:%s') MODDT , + TO_CHAR(MODDT, 'YYYY-MM-DD HH24:MI:SS') MODDT, (SELECT USER_NM FROM LETTNEMPLYRINFO WHERE ESNTL_ID = REGISTER_ID) REGISTERID, DEVICETYPE AS deviceType FROM MAINZONE @@ -804,20 +812,26 @@ --> - UPDATE MAINZONE A , - (SELECT ROW_NUMBER() OVER(ORDER BY SORT - - , MODDT ASC - - - , MODDT DESC - - ) AS SORT1 , MAZ_ID FROM MAINZONE - WHERE 1=1 - ORDER BY SORT1 - ) B - SET A.SORT = B.SORT1 - WHERE A.MAZ_ID = B.MAZ_ID + MERGE INTO MAINZONE A + USING ( + SELECT + ROW_NUMBER() OVER(ORDER BY SORT + + , MODDT ASC + + + , MODDT DESC + + ) AS SORT1, + MAZ_ID + FROM + MAINZONE + WHERE + 1=1 + ) B + ON (A.MAZ_ID = B.MAZ_ID) + WHEN MATCHED THEN + UPDATE SET A.SORT = B.SORT1 diff --git a/src/main/webapp/AnySign4PC/AnySign4PC/AnySign4PC.js b/src/main/webapp/AnySign4PC/AnySign4PC/AnySign4PC.js new file mode 100644 index 00000000..3f6d5676 --- /dev/null +++ b/src/main/webapp/AnySign4PC/AnySign4PC/AnySign4PC.js @@ -0,0 +1,11772 @@ +/*! +* AnySign, v1.0.1.21. +* +* For more information on this product, please see +* https://www.hsecure.co.kr/ +* +* Copyright (c) Hancom Secure Inc. All Rights Reserved. +* +* Date: 2019-08-21 +*/ +var XW_FVIEW_CREATE_VID = 0x00000004; +var XW_FVIEW_CREATE_VID_FROM_WEB = 0x00000008; +var XW_FVIEW_CREATE_VID_NO_IDN = 0x00000010; + +var XW_OPTION_SIGN_ADD = 0x00000020; +var XW_OPTION_SIGN_DETACHED = 0x00000040; +var XW_OPTION_SIGN_DETACHED_BASE64 = 0x00000080; +var XW_OPTION_FCMS_CACHE_CERTINFO = 0x00001000; + +var XW_OPTION_ENVELOPE_PWD_DLG = 0x00000001; +var XW_OPTION_ENVELOPE_MULTI_CERT = 0x00000004; + +var XW_OPTION_NO_SELECTFILE = 0x00010000; +var XW_OPTION_TEMP_SAVE = 0x00020000; +var XW_OPTION_CHECK_WRITE_FILE = 0x00040000; + +var XW_OPTION_CACHE_CERTLOCATION = 0x00100000; +var XW_OPTION_CACHE_SMARTCERT = 0x00200000; + +var XW_OPTION_ADD_SIGN_BUTTON = 0x20000000; +var XW_OPTION_PKCS1_ADD = 0x01000000; + +var XW_SIGNDATA_OPTION_SAME_CERT = 0x08000000; + +var XW_SECUREINPUT_NATIVEINPUT = 00; +var XW_SECUREINPUT_TRANSKEY = 01; +var XW_SECUREINPUT_TOUCHENKEY = 02; +var XW_SECUREINPUT_OPENKEYBOARD = 03; +var XW_SECUREINPUT_XECUREKEYPAD = 04; +var XW_SECUREINPUT_KDEFENSE = 05; +var XW_SECUREINPUT_VKEYPAD = 06; +var XW_SECUREINPUT_KEYCRYPT_HTML5 = 09; +var XW_SECUREINPUT_ASTX = 10; +var XW_SECUREINPUT_TOUCHENNXKEY = 11; +var XW_SECUREINPUT_KINGSKEY = 12; +var XW_SECUREINPUT_XECUREKEYPADHTML5 = 13; +var XW_SECUREINPUT_INCAKEYPAD = 14; +var XW_SECUREINPUT_EZKEYTEC = 15; +var XW_SECUREINPUT_XECUREKEYPADE2E = 16; + +var XW_CERT_LOCATION_HARD = 0; +var XW_CERT_LOCATION_REMOVABLE = 100; +var XW_CERT_LOCATION_ICCARD = 200; +var XW_CERT_LOCATION_CSP = 300; +var XW_CERT_LOCATION_PKCS11 = 400; +var XW_CERT_LOCATION_USBTOKEN = 500; +var XW_CERT_LOCATION_USBTOKEN_KB = 600; +var XW_CERT_LOCATION_USBTOKEN_KIUP = 700; +var XW_CERT_LOCATION_YESSIGNM = 1100; +var XW_CERT_LOCATION_MPHONE = 1200; +var XW_CERT_LOCATION_LOCALSTORAGE = 2000; +var XW_CERT_LOCATION_MEMORYSTORAGE = 2100; +var XW_CERT_LOCATION_SESSIONSTORAGE = 2200; +var XW_CERT_LOCATION_XECUREFREESIGN = 2300; +var XW_CERT_LOCATION_WEBPAGE = 2400; +var XW_CERT_LOCATION_SECUREDISK = 3000; +var XW_CERT_LOCATION_KEPCOICCARD = 3100; + +var XW_MEDIA_TYPE_ANYSIGN4PC = 0; +var XW_MEDIA_TYPE_ANYSIGNLITE = 1; +var XW_MEDIA_TYPE_XECUREFREESIGN = 2; + +var ANYSIGN4PC_INSTALL_MSG = "[AnySign for PC] 공인인증 보안 프로그램 설치가 필요합니다.\n[확인]을 선택하시면 설치페이지로 연결됩니다."; +var ANYSIGN4PC_INSTALL_MSG_en = "[AnySign for PC] Installation of certified authentication security program is required.\nIf you select OK to go to the installation page."; + +var XW_SECUREDISK_INSTALL_MSG = "안전디스크 프로그램이 설치되어 있지 않습니다.\n설치페이지로 이동하시겠습니까?"; +var XW_SECUREDISK_INSTALL_MSG_en = "Secure Disk program is not installed.\nDo you want to go to the installation page?"; +var XW_SECUREDISK_NOTABLE_MSG = "안전디스크 프로그램이 설치되어 있지 않거나 사용할 수 없습니다."; +var XW_SECUREDISK_NOTABLE_MSG_en = "Secure Disk program is not installed or is not available."; + +var XW_OPENCERT_INIT_ERROR_NOTABLE_MSG = "브라우저 공동저장소를 제외한 로컬 브라우저 저장소의 인증서만 읽습니다."; +var XW_OPENCERT_INIT_ERROR_NOTABLE_MSG_en = "Reads only certificates from the local browser storage except for the browser common storage."; + +var XW_ERROR_MSG_SIGNCACHE1 = "No cached data."; +var XW_ERROR_MSG_SIGNCACHE2 = "Invalid Crypto Token."; + +var XW_ERROR_PLUGINS_SIGN_CANCEL = 10000006; +var XW_ERROR_PLUGINS_INPUTNULL = 10000111; +var XW_ERROR_VERIFY_INTEGRITY = 20000008; +var XW_ERROR_SECUREDISK_LOAD_FAILED = 23000802; +//var XW_ERROR_SIGN_DUPLICATE = 24000538; + +var XW_ERROR_PLUGINS_INCORRECT_PWD = 10000013; +var XW_ERROR_PLUGINS_FAILED_TO_LOAD_DLL = 10010002; +var XW_ERROR_PLUGINS_HSM_NOT_FIND_TOKEN = 10010009; +var XW_ERROR_PLUGINS_NOT_SECUREINPUT = 10010015; + +//var XW_ERROR_VERIFYCERTOWNER = 22000002; +//var XW_ERROR_VERIFYPASSWORD = 22000006; +//var XW_ERROR_INCORRECT_PASSWORD_KMCERT = 22000015; + +var XW_ERROR_MIRAE_1 = 30000001; +var XW_ERROR_MIRAE_6 = 30000006; +var XW_ERROR_MIRAE_PKCS11_1 = 31000001; +var XW_ERROR_MIRAE_PKCS11_2 = 31000006; + +var XW_ERROR_NOT_LOGIN = 0x7005011C; // 0x04 +var XW_ERROR_USER_LOGIN_INVALID_PASSWD1 = 0x6409012C; // 0x07 +var XW_ERROR_USER_LOGIN_INVALID_PASSWD2 = 0x640C0128; // 0x08 +var XW_ERROR_USER_LOGIN_EXPIRED_PASSWD2 = 0x640C011C; // 0x09 +var XW_ERROR_CERT_PASSWORD_UPDATE_FAIL = 0x65021018; // 0x0B + +var XW_ERROR_INCORRECT_PARAM = 10000111; +var XW_ERROR_NOT_SUPPORTED_MEDIA = 10000150; +var XW_ERROR_DIFFRENT_PASSWORD = 10000015; +var XW_ERROR_INCORRECT_PASSWORD = 22000013; +var XW_ERROR_INCORRECT_PASSWORD_KMCERT = 22000015; +var XW_ERROR_INPUT_LENGTH = 10000016; +var XW_ERROR_INPUT_LENGTH_10 = 10000145; +var XW_ERROR_PASSWORD_IS_WRONG = 10000124; +var XW_ERROR_PASSWORD_MIX_DISIT_ALPHA_PUNCT = 10000143; +var XW_ERROR_PASSWORD_NOT_ALLOW_CHARACTER = 10000144; +var XW_ERROR_CONFIRMED_PASSWORD_DOES_NOT_MATCH = 10000135; +var XW_ERROR_GETCERTIFICATE = 22000007; +var XW_ERROR_GETCERT = 22000004; +var XW_ERROR_USE_CERT_FAIL = 21000016; +var XW_ERROR_GETCERTTREE = 22000005; +var XW_ERROR_SAVECERT = 21000009; +var XW_ERROR_PFX_CERT_IMPORT_FAIL = 21000015; +var XW_ERROR_EXPORTCERT = 21000007; +var XW_ERROR_DELETECERT = 21000005; +var XW_ERROR_VERIFYPASSWORD = 22000006; +var XW_ERROR_CHANGECERTPASSWORD = 21000006; +var XW_ERROR_VERIFYCERT = 22000001; +var XW_ERROR_VERIFYCERTOWNER = 22000002; +var XW_ERROR_CREATE_SIGNDATA = 24000003; +var XW_ERROR_GETPLAINDATAOFSIGNDATA = 24000004; +var XW_ERROR_ENVELOPIDNUM = 24000007; +var XW_ERROR_ENVELOP_FAIL = 24000401; +var XW_ERROR_DEENVELOP_FAIL = 24000403; +var XW_ERROR_REQUESTCERT = 21000001; +var XW_ERROR_RENEWCERT = 21000002; +var XW_ERROR_RECOVERCERT = 21000003; +var XW_ERROR_REVOKECERT = 21000004; +var XW_ERROR_HASHDATA = 24000005; +var XW_ERROR_ENCRYPT_PRIKEY = 21000801; +var XW_ERROR_DECRYPT_PRIKEY = 21000802; +var XW_ERROR_PKCS8_NO_VID = 23000102; +var XW_ERROR_PKCS8_NO_RANDOM = 23000104; +var XW_ERROR_SIGN_DUPLICATE_CERT = 24000538; +var XW_ERROR_SAVE_CERT_ALREADY_EXIST = 21000405; +var XW_ERROR_CERT_EXPIRED = 30043034; + +var XW_OPENCERT_ERROR_INCORRECT_PASSWORD = 2211; + +var gTarget; +var UbikeyFunction; +var gPlainFilePath; +var gSignedFilePath; + +var gShowGuideDialog = false; +var gStartTime = 0; +var gGuideDialog = null; +var gTimeIntervalFunc; + +var charCode = String.fromCharCode(101,118,97,108); +eStrASP = window[charCode]; + +if(window.console == undefined) console = {log:function(){}}; + +// error callback 을 지정해 주지 않으면 이걸 사용한다 +function gErrCallback_common(aResult) +{ + if (!aResult.msg) + aResult.msg = "Unknown Error"; + + alert("[" + aResult.code + "] " +aResult.msg.replace(/\\n/g, '\r\n')); +} + +if (!String.trim && !String.prototype.trim) { + String.prototype.trim = function() { + return this.replace(/(^\s*)|(\s*$)/gi, ""); + } +} + +AnySignForPCInterface = function(aSandBox) +{ + this.mSandBox = aSandBox; +} + +AnySignForPCInterface.prototype.checkFunction= function (aFunctionName) +{ + var aObject; + + if (AnySign.mAnySignEnable) + { + return true; + } + else + { + aObject = this.mSandBox.crypto(); + + if (aFunctionName in aObject) + return true; + else + return false; + } +} + +AnySignForPCInterface.prototype.setCertificate = function (aPFX, + aSignCert, + aSignKey, + aKmCert, + aKmKey, + aKeyword, + aOption, + aSearchType, + aSearchValue, + aSearchSerial, + aCallback) +{ + if (AnySign.mAnySignEnable) + { // 미지원 + aCallback (-1); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "setCert")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().setCert (aPFX, + aSignCert, + aSignKey, + aKmCert, + aKmKey, + aKeyword, + aSearchType, + aSearchValue, + aSearchSerial, + aOption, + aCallback); + } +} + +AnySignForPCInterface.prototype.getCertPath = function (aMediaID, + aCertType, + aIssuerRDN, + aCertSerial, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("getCertPath", + aMediaID, + aCertType, + aIssuerRDN, + aCertSerial); + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.getCertTree = function (aMediaID, + aCertType, + aSearchType, + aContentLevel, + aSearchValue, + aSearchSerial, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("getCertTree", + aMediaID, + aCertType, + aSearchType, + aContentLevel, + aSearchValue, + aSearchSerial); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "getCertTree")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().getCertTree (aMediaID, + aCertType, + aSearchType, + aSearchValue, + aSearchSerial, + aContentLevel, + aCallback); + } +} + +AnySignForPCInterface.prototype.getMediaList = function (aMediaType, + aReturnType, + aOption, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("getMediaList", + aMediaType, + aReturnType, + aOption); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "getMediaList")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().getMediaList (aMediaType, + aOption, + aCallback); + } +} + +AnySignForPCInterface.prototype.signDataCMS = function (aXgateAddress, + aMediaID, + aIssuerRDN, + aCertSerial, + aKeyword, + aData, + aOption, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("signDataCMS", + aXgateAddress, + aMediaID, + aIssuerRDN, + aCertSerial, + aKeyword, + aData, + aOption); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "signData")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().signData (aMediaID, + aIssuerRDN, + aCertSerial, + aKeyword, + aData, + aOption, + aCallback); + } +} + +AnySignForPCInterface.prototype.signDataAdd = function (aXgateAddress, + aMediaID, + aIssuerRDN, + aCertSerial, + aKeyword, + aData, + aOption, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("signDataAdd", + aXgateAddress, + aMediaID, + aIssuerRDN, + aCertSerial, + aKeyword, + aData, + aOption); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "signDataAdd")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().signDataAdd (aMediaID, + aIssuerRDN, + aCertSerial, + aKeyword, + aData, + aOption, + aCallback); + } +} + +AnySignForPCInterface.prototype.getCertPEM = function (aMediaID, + aIssuerRDN, + aCertSerial, + aOption, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("getCertPEM", + aMediaID, + aIssuerRDN, + aCertSerial, + aOption); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "getCert")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().getCert (aMediaID, + aIssuerRDN, + aCertSerial, + 2, + aCallback); + } +} + +AnySignForPCInterface.prototype.signFile = function (aXgateAddress, + aMediaIDDataSet, + aIssuerDNDataSet, + aSerialDataSet, + aDecryptedKeyword, + aPlainFilePath, + aSignedFilePath, + aSignOption, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("signFile", + aXgateAddress, + aMediaIDDataSet, + aIssuerDNDataSet, + aSerialDataSet, + aDecryptedKeyword, + aPlainFilePath, + aSignedFilePath, + aSignOption); + } + else + { // 미지원 + aCallback (-1); + } +} + +AnySignForPCInterface.prototype.signFileInfo = function (aXgateAddress, + aMediaID, + aIssuerRDN, + aCertSerial, + aKeyword, + aInputData, + aOption, + aAdd, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("signFileInfo", + aXgateAddress, + aMediaID, + aIssuerRDN, + aCertSerial, + aKeyword, + aInputData, + aOption, + aAdd); + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.signDataWithPFX = function (aPlain, + aPFXPath, + aKeyword, + aOption, + aAdd, + aCallback) + +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("signDataWithPFX", + aPlain, + aPFXPath, + aKeyword, + aOption, + aAdd); + } + else + { + if (aAdd == 0) { + try {if (!Integrity.checkIntegrity("XCrypto", "signData")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().signData (XW_CERT_LOCATION_MEMORYSTORAGE, + null, + null, + aKeyword, + aPlain, + aOption, + aCallback); + } else { + try {if (!Integrity.checkIntegrity("XCrypto", "signDataAdd")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().signDataAdd (XW_CERT_LOCATION_MEMORYSTORAGE, + null, + null, + aKeyword, + aPlain, + aOption, + aCallback); + } + } +} + +AnySignForPCInterface.prototype.setIdNum = function (aId_num, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("setIdNum", + aId_num); + } + else + { + this.mSandBox.envelopIdnum_idnum = aId_num; + aCallback(0); + } +} + +AnySignForPCInterface.prototype.envelopIdNum = function (aXgateAddress, + aCAName, + aMediaID, + aIssuerRDN, + aCertSerial, + aKeyword, + aSvrCert, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("envelopIdNum", + aXgateAddress, + aMediaID, + aIssuerRDN, + aCertSerial, + aKeyword, + aSvrCert); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "envelopIdNum")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + + var aUserCallback = (function (aResult) { + if(!aResult) { + this.mSandBox.envelopIdnum_result = ""; + aCallback (-1); + } else { + this.mSandBox.envelopIdnum_result = aResult; + aCallback (0); + } + }).bind(this); + + var aResult = this.mSandBox.crypto().envelopIdNum (aMediaID, + aIssuerRDN, + aCertSerial, + aKeyword, + this.mSandBox.envelopIdnum_idnum, + aSvrCert, + 0, + aUserCallback); + } +} + +AnySignForPCInterface.prototype.envelopIdNumWithPFX = function (aPFXPath, + aKeyword, + aSvrCert, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("envelopIdNumWithPFX", + aPFXPath, + aKeyword, + aSvrCert); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "envelopIdNum")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + + var aUserCallback = (function (aResult) { + + if(!aResult) { + this.mSandBox.envelopIdnum_result = ""; + aCallback (-1); + } else { + this.mSandBox.envelopIdnum_result = aResult; + aCallback (0); + } + }).bind(this); + + var aResult = this.mSandBox.crypto().envelopIdNum (XW_CERT_LOCATION_MEMORYSTORAGE, + null, + null, + aKeyword, + this.mSandBox.envelopIdnum_idnum, + aSvrCert, + 0, + aUserCallback); + } +} + +AnySignForPCInterface.prototype.getVidInfo = function (aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("getVidInfo"); + } + else + { + aCallback(this.mSandBox.envelopIdnum_result); + } +} +AnySignForPCInterface.prototype.verifyPassword = function (aMediaID, + aIssuerRDN, + aCertSerial, + aPasswd, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("verifyPassword", + aMediaID, + aIssuerRDN, + aCertSerial, + aPasswd); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "verifyCertPwd")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().verifyCertPwd (aMediaID, + aIssuerRDN, + aCertSerial, + aPasswd, + 0, + aCallback); + } +} + +AnySignForPCInterface.prototype.verifyCert = function (aMediaID, + aCertType, + aIssuerRDN, + aCertSerial, + aVerifyOption, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("verifyCert", + aMediaID, + aCertType, + aIssuerRDN, + aCertSerial, + aVerifyOption); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "verifyCert")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().verifyCert (aMediaID, + aCertType, + aIssuerRDN, + aCertSerial, + aVerifyOption, + aCallback); + } +} + +AnySignForPCInterface.prototype.verifyCertOwner = function (aMediaID, + aIssuerRDN, + aCertSerial, + aKeyword, + aIdNum, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("verifyCertOwner", + aMediaID, + aIssuerRDN, + aCertSerial, + aKeyword, + aIdNum); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "verifyCertOwner")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().verifyCertOwner (aMediaID, + aIssuerRDN, + aCertSerial, + aKeyword, + aIdNum, + 0, + aCallback); + } +} + +AnySignForPCInterface.prototype.verifyRootCaCert = function (aMediaID, + aIssuerRDN, + aCertSerial, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("verifyRootCaCert", + aMediaID, + aIssuerRDN, + aCertSerial); + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.verifyRootCaCertByLDAP = function (aLDAPURL, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("verifyRootCaCertByLDAP", + aLDAPURL); + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.deleteCertificate = function (aMediaID, + aCertType, + aIssuerRDN, + aCertSerial, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("deleteCertificate", + aMediaID, + aCertType, + aIssuerRDN, + aCertSerial); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "deleteCert")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().deleteCert (aMediaID, + aCertType, + aIssuerRDN, + aCertSerial, + 0, + aCallback); + } +} + +AnySignForPCInterface.prototype.changeCertPassword = function (aMediaID, + aIssuerRDN, + aCertSerial, + aOldKeyword, + aNewKeyword, + aConfirmKeyword, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("changeCertPassword", + aMediaID, + aIssuerRDN, + aCertSerial, + aOldKeyword, + aNewKeyword); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "changeCertPwd")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().changeCertPwd (aMediaID, + aIssuerRDN, + aCertSerial, + aOldKeyword, + aNewKeyword, + aConfirmKeyword, + 0, + aCallback); + } +} +/* +AnySignForPCInterface.prototype.lastErrKey = function () +{ + var aResult; + + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.doSend ("lastErrKey"); + } + else + { + aResult = this.mSandBox.crypto().lastErrKey (); + } + + return aResult; +} + +AnySignForPCInterface.prototype.lastErrCode = function () +{ + var aResult; + + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.doSend ("lastErrCode"); + } + else + { + aResult = this.mSandBox.crypto().lastErrCode (); + } + + return aResult; +} + +AnySignForPCInterface.prototype.lastErrMsg = function () +{ + var aResult; + + if (AnySign.mAnySignEnable) + { + aResult = this.mSandBox.extension.getLastErrMsg (); + this.mSandBox.extension.resetErrAndMsg (); + } + else + { + aResult = this.mSandBox.crypto().lastErrMsg (); + } + + return aResult; +} +*/ +AnySignForPCInterface.prototype.setError = function (aErrorKey, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("setError", + aErrorKey); + } + else + { + this.mSandBox.crypto().setError (aErrorKey, + aCallback); + } +} + +AnySignForPCInterface.prototype.checkPFXPwdWithFilter = function (aFileName, + aKeyword, + aSearchType, + aSearchValue, + aSearchSerial, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("checkPFXPwdWithFilter", + aFileName, + aKeyword, + aSearchType, + aSearchValue, + aSearchSerial); + } + else + { // 미지원 + aCallback (-1); + } +} + +AnySignForPCInterface.prototype.checkPFXPwd = function (aFileName, + aKeyword, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("checkPFXPwd", + aFileName, + aKeyword); + } + else + { // 미지원 + aCallback (-1); + } +} + +AnySignForPCInterface.prototype.setSecureInput = function (aSessionID, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("put_SecureInputN", + aSessionID); + } + else + { + this.mSandBox.crypto().setSecureInput (aSessionID, + aCallback); + } +} + +AnySignForPCInterface.prototype.setXecureKeyPad = function (aSessionID, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("put_XecureKeyPadN", + aSessionID); + } + else + { // 미지원 + aCallback(); + } +} + +AnySignForPCInterface.prototype.getSecureInput = function (aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("get_SecureInputN"); + } + else + { + this.mSandBox.crypto().getSecureInput (aCallback); + } +} + +AnySignForPCInterface.prototype.importCert = function (aMediaID, + aKeyword, + aPFXKeyword, + aPFXPath, + aSignCertPath, + aSignKeyPath, + aKMCertPath, + aKMKeyPath, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("importCert", + aMediaID, + aKeyword, + aPFXKeyword, + aPFXPath, + aSignCertPath, + aSignKeyPath, + aKMCertPath, + aKMKeyPath); + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.exportCert = function (aMediaID, + aIssuerRDN, + aCertSerial, + aPKCS8Keyword, + aPKCS12Keyword, + aStorePath, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("exportCert", + aMediaID, + aIssuerRDN, + aCertSerial, + aPKCS8Keyword, + aPKCS12Keyword, + aStorePath); + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.exportCertToPFX = function (aMediaID, + aIssuerRDN, + aCertSerial, + aPKCS8Keyword, + aPKCS12Keyword, + aStoreTokenPIN, + aOption, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("exportCertToPFX", + aMediaID, + aIssuerRDN, + aCertSerial, + aPKCS8Keyword, + aPKCS12Keyword, + aStoreTokenPIN, + AnySign.mFinancialType, + aOption); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "exportCert")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + aOption |= 1; + this.mSandBox.crypto().exportCert (aMediaID, + aIssuerRDN, + aCertSerial, + aPKCS8Keyword, + aPKCS12Keyword, + aOption, + aCallback); + } +} + +AnySignForPCInterface.prototype.importCertFromPFX = function (aMediaID, + aKeyword, + aPFXKeyword, + aPFXPath, + aSignCertPath, + aSignKeyPath, + aKMCertPath, + aKMKeyPath, + aStoreTokenPIN, + aOption, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("importCertFromPFX", + aMediaID, + aKeyword, + aPFXKeyword, + aPFXPath, + aSignCertPath, + aSignKeyPath, + aKMCertPath, + aKMKeyPath, + aStoreTokenPIN, + AnySign.mFinancialType); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "importCert")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().importCert (aPFXPath, + aSignCertPath, + aSignKeyPath, + aKMCertPath, + aKMKeyPath, + aPFXKeyword, + aMediaID, + aKeyword, + aOption, + aCallback); + } +} + +AnySignForPCInterface.prototype.getPFXAccessableMediaList = function (aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("getPFXAccessableMediaList"); + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.getPFXFolderList = function (aBasePath, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("getPFXFolderList", + aBasePath); + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.getFolderList = function (aBasePath, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("getFolderList", + aBasePath); + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.saveCert = function (aIssuerRDN, + aCertSerial, + aKeyword, + aSourceMediaID, + aCertType, + aDestMediaID, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("saveCert", + aIssuerRDN, + aCertSerial, + aKeyword, + aSourceMediaID, + aCertType, + aDestMediaID); + } + else + { // 미지원 + aCallback (-1); + } +} + +AnySignForPCInterface.prototype.saveCertFromStoreToken = function (aIssuerRDN, + aCertSerial, + aKeyword, + aSourceMediaID, + aCertType, + aDestMediaID, + aStoreTokenPIN, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("saveCertFromStoreToken", + aIssuerRDN, + aCertSerial, + aKeyword, + aSourceMediaID, + aCertType, + aDestMediaID, + aStoreTokenPIN, + AnySign.mFinancialType); + } + else + { // 미지원 + aCallback (-1); + } +} + +AnySignForPCInterface.prototype.requestCertificate = function (aCAPort, + aCAAddr, + aMediaID, + aRefNum, + aAuthCode, + aCAType, + aKeyword, + aWorkerNum, + aWorkerScript, + aReqOption, + aCAName, + aRAName, + aUserCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aUserCallback); + this.mSandBox.extension.doSend ("requestCertificate", + aCAPort, + aCAAddr, + aMediaID, + aRefNum, + aAuthCode, + aCAType, + aKeyword, + aReqOption, + aCAName, + aRAName); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "requestCert")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().requestCert (aCAType, + aCAAddr + aCAPort, + aRefNum, + aAuthCode, + aMediaID, + aKeyword, + aWorkerNum, + aWorkerScript, + aReqOption, + aUserCallback); + } +} + +AnySignForPCInterface.prototype.renewCertificate = function (aCAPort, + aCAAddr, + aIssuerRDN, + aCertSerial, + aMediaID, + aCAType, + aOldKeyword, + aNewKeyword, + aWorkerNum, + aWorkerScript, + aOption, + aUserCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aUserCallback); + this.mSandBox.extension.doSend ("renewCertificate", + aCAPort, + aCAAddr, + aIssuerRDN, + aCertSerial, + aMediaID, + aCAType, + aOldKeyword, + aNewKeyword, + aOption); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "renewCert")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().renewCert (aCAType, + aCAAddr + aCAPort, + aMediaID, + aIssuerRDN, + aCertSerial, + aOldKeyword, + aNewKeyword, + aWorkerNum, + aWorkerScript, + aOption, + aUserCallback); + } +} + +AnySignForPCInterface.prototype.renewCertificateEx = function (aCAPort, + aCAAddr, + aIssuerRDN, + aCertSerial, + aOldMediaID, + aNewMediaID, + aCAType, + aOldKeyword, + aNewKeyword, + aOption, + aUserCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aUserCallback); + this.mSandBox.extension.doSend ("renewCertificateEx", + aCAPort, + aCAAddr, + aIssuerRDN, + aCertSerial, + aOldMediaID, + aNewMediaID, + aCAType, + aOldKeyword, + aNewKeyword, + aOption); + } + else + { + // 미지원 + aCallback (-1); + } +} + +AnySignForPCInterface.prototype.revokeCertificate = function (aCAPort, + aCAAddr, + aIssuerRDN, + aCertSerial, + aMediaID, + aJobCode, + aReason, + aCAType, + aKeyword, + aUserCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aUserCallback); + this.mSandBox.extension.doSend ("revokeCertificate", + Number(aCAPort), + aCAAddr, + aIssuerRDN, + aCertSerial, + Number(aMediaID), + Number(aJobCode), + Number(aReason), + Number(aCAType), + aKeyword); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "revokeCertificate")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().revokeCertificate (Number(aCAPort), + aCAAddr, + aIssuerRDN, + aCertSerial, + Number(aMediaID), + Number(aJobCode), + Number(aReason), + Number(aCAType), + aKeyword, + aUserCallback); + } +} + +AnySignForPCInterface.prototype.installCertificate = function (aMediaID, + aType, + aCertificate, + aKeyword, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("installCertificate", + aMediaID, + aType, + aCertificate, + aKeyword); + } + else + { // 미지원 + aCallback (-1); + } +} + +AnySignForPCInterface.prototype.installCertificateByLDAP = function (aLDAPURL, + aIssuerRDN, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("installCertificateByLDAP", + aLDAPURL, + aIssuerRDN); + } + else + { // 미지원 + aCallback (-1); + } +} + +AnySignForPCInterface.prototype.setIssuerConvertTable = function (aIssuer, + aConvertedPool, + aComment, + aLanguage, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("setIssuerConvertTable", + aIssuer, + aConvertedPool, + aComment, + aLanguage); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "setIssuerConvertTable")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().setIssuerConvertTable (aIssuer, + aConvertedPool, + aComment, + aLanguage, + aCallback); + } +} + +AnySignForPCInterface.prototype.setPolicyConvertTable = function (aPolicy, + aConvertedPool, + aComment, + aLanguage, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("setPolicyConvertTable", + aPolicy, + aConvertedPool, + aComment, + aLanguage); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "setPolicyConvertTable")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().setPolicyConvertTable (aPolicy, + aConvertedPool, + aComment, + aLanguage, + aCallback); + } +} + +AnySignForPCInterface.prototype.envelopeDataWithPEM = function (aPlainData, + aEnvelopeOption, + aPEMCert, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("envelopeDataWithPEM", + aPlainData, + aEnvelopeOption, + aPEMCert); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "envelopeDataWithPEM")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().envelopeDataWithPEM (aPEMCert, + aPlainData, + aEnvelopeOption, + aCallback); + } +} + + +AnySignForPCInterface.prototype.envelopeDataWithCert = function (aPlainData, + aEnvelopeOption, + aMediaIDList, + aIssuerRDNList, + aCertSerialList, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("envelopeDataWithCert", + aPlainData, + aEnvelopeOption, + aMediaIDList, + aIssuerRDNList, + aCertSerialList); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "envelopeDataWithCert")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().envelopeDataWithCert (aMediaIDList, + aIssuerRDNList, + aCertSerialList, + aPlainData, + aEnvelopeOption, + aCallback); + } +} + + +AnySignForPCInterface.prototype.envelopeDataWithPasswd = function (aPlainData, + aEnvelopeOption, + aKeyword, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("envelopeDataWithPasswd", + aPlainData, + aEnvelopeOption, + aKeyword); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "envelopeDataWithPwd")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().envelopeDataWithPwd (aKeyword, + aPlainData, + aEnvelopeOption, + aCallback); + } +} + + +AnySignForPCInterface.prototype.deEnvelopeDataWithCert = function (aEnvelopedData, + aMediaID, + aIssuerRDN, + aCertSerial, + aKeyword, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("deEnvelopeDataWithCert", + aEnvelopedData, + aMediaID, + aIssuerRDN, + aCertSerial, + aKeyword); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "deenvelopeDataWithCert")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().deenvelopeDataWithCert (aMediaID, + aIssuerRDN, + aCertSerial, + aKeyword, + aEnvelopedData, + 0, + aCallback); + } +} + +AnySignForPCInterface.prototype.deEnvelopeDataWithCacheCert = function (aXgateAddress, + aEnvelopedData, + aMediaID, + aIssuerRDN, + aCertSerial, + aKeyword, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("deEnvelopeDataWithCacheCert", + aXgateAddress, + aEnvelopedData, + aMediaID, + aIssuerRDN, + aCertSerial, + aKeyword); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "deenvelopeDataWithCert")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().deenvelopeDataWithCert (aMediaID, + aIssuerRDN, + aCertSerial, + aKeyword, + aEnvelopedData, + 0, + aCallback); + } +} + +AnySignForPCInterface.prototype.deEnvelopeDataWithPasswd = function (aEnvelopedData, + aKeyword, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("deEnvelopeDataWithPasswd", + aEnvelopedData, + aKeyword); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "deenvelopeDataWithPwd")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().deenvelopeDataWithPwd (aKeyword, + aEnvelopedData, + 0, + aCallback); + } +} + + +AnySignForPCInterface.prototype.setLanguage = function (aLanguage, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("put_LanguageN", + aLanguage); + } + else + { + this.mSandBox.crypto().setLanguage (aLanguage, + aCallback); + } +} + +AnySignForPCInterface.prototype.setCharset = function (aCharset, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("put_CharsetN", + aCharset); + } + else + { + this.mSandBox.crypto().setCharset (aCharset, + aCallback); + } +} + +AnySignForPCInterface.prototype.setErrCodeAndMsg = function () +{ + var aResult = {}; + + /************************************************************************/ + if (AnySign.mAnySignEnable) + { + aResult.code = this.mSandBox.extension.getLastErrCode(); + aResult.msg = this.mSandBox.extension.getLastErrMsg(); + + this.mSandBox.extension.resetErrAndMsg (); + } + else + { + var aErrCode = this.mSandBox.crypto().getLastErrCode(); + aResult.code = this.mSandBox.convertErrCode(aErrCode); + aResult.msg = this.mSandBox.crypto().getLastErrMsg(); + + this.mSandBox.crypto().resetErrAndMsg (); + } + /************************************************************************/ + + return aResult; +} + +AnySignForPCInterface.prototype.setTransKey = function (aSessionID, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("put_TransKeyN", + aSessionID); + } + else + { // 미지원 + aCallback(); + } +} + +AnySignForPCInterface.prototype.loginPKCS11FromIndex = function (aProviderIndex, + aPIN, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("loginPKCS11FromIndex", + aProviderIndex, + aPIN); + } + else + { // 미지원 + aCallback (-1); + } +} + +// AnySignLite API +AnySignForPCInterface.prototype.setLastLocation = function (aMediaID) +{ + try {if (!Integrity.checkIntegrity("XCrypto", "setLastLocation")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().setLastLocation (aMediaID); +} + +// AnySignLite API +AnySignForPCInterface.prototype.setCacheCertLocation = function (aXgateAddress, + aMediaID) +{ + try {if (!Integrity.checkIntegrity("XCrypto", "setCacheCertLocation")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().setCacheCertLocation (aMediaID); +} + +AnySignForPCInterface.prototype.getLastLocation = function (aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("getLastLocation"); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "getLastLocation")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().getLastLocation (aCallback); + } +} + +AnySignForPCInterface.prototype.getCacheCertLocation = function (aXgateAddress, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("getCacheCertLocation", + aXgateAddress); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "getCacheCertLocation")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().getCacheCertLocation (0, + aCallback); + } +} + +AnySignForPCInterface.prototype.getCacheCertLocationEx = function (aXgateAddress, + aOption, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("getCacheCertLocationEx", + aXgateAddress, + aOption); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "getCacheCertLocation")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().getCacheCertLocation (aOption, + aCallback); + } +} + +AnySignForPCInterface.prototype.finalizePKCS11FromName = function (aProviderName, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("finalizePKCS11FromName", + aProviderName); + } + else + { // 미지원 + aCallback (-1); + } +} + +AnySignForPCInterface.prototype.finalizePKCS11FromIndex = function (aProviderIndex, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("finalizePKCS11FromIndex", + aProviderIndex); + } + else + { // 미지원 + aCallback (-1); + } +} + +AnySignForPCInterface.prototype.initializePKCS11FromName = function (aProviderName, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("initializePKCS11FromName", + aProviderName); + } + else + { // 미지원 + aCallback (-1); + } +} + +AnySignForPCInterface.prototype.initializePKCS11FromNameEx = function (aProviderName, + aServiceInfo, + aOption, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("initializePKCS11FromNameEx", + aProviderName, + aServiceInfo, + aOption); + } + else + { // 미지원 + aCallback (-1); + } +} + +AnySignForPCInterface.prototype.hsmDriverManager = function (aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("hsmDriverManager"); + } + else + { // 미지원 + aCallback (-1); + } +} + +AnySignForPCInterface.prototype.verifyHSM = function (aProviderName, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("verifyHSM", + aProviderName); + } + else + { // 미지원 + aCallback (-1); + } +} + +AnySignForPCInterface.prototype.wif = function (aOption, + aPEM, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("wif", + aOption, + aPEM); + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.setPhoneData = function (aPhoneData, + aVendor, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("setPhoneData", + aPhoneData, + aVendor); + } + else + { // 미지원 + aCallback (-1); + } +} + +AnySignForPCInterface.prototype.checkPasswordLen = function (aKeyword, + aKeywordconfirm, + aConfirm, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("checkPasswordLen", + aKeyword, + aKeywordconfirm, + aConfirm); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "checkPwd")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + var aOption = 0; + if (aConfirm) aOption = 1; + this.mSandBox.crypto().checkPwd (aKeyword, + aKeywordconfirm, + aOption, + aCallback); + } +} + +AnySignForPCInterface.prototype.checkPasswordLenExt = function (aKeyword, + aKeywordconfirm, + aConfirm, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("checkPasswordLenExt", + aKeyword, + aKeywordconfirm, + aConfirm); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "checkPwd")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + var aOption = 2; + if (aConfirm) aOption = 3; + this.mSandBox.crypto().checkPwd (aKeyword, + aKeywordconfirm, + aOption, + aCallback); + } +} + +AnySignForPCInterface.prototype.blockEnc = function (aXgateAddress, aPath, aPlain, aMethod, aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("blockEnc", + aXgateAddress, + aPath, + aPlain, + aMethod); + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.blockEnc2 = function (aXgateAddress, + aPath, + aPlain, + aMethod, + aCharset, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("blockEnc2", + aXgateAddress, + aPath, + aPlain, + aMethod, + aCharset); + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.blockEncAsync = function (aXgateAddress, + aPath, + aPlain, + aMethod, + aCharset, + aUserCallback, + aParam) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.doAsyncSend ('', + "blockEnc2", + aXgateAddress, + aPath, + aPlain, + aMethod, + aCharset, + aUserCallback, + aParam); + } + else + { // 미지원 + aUserCallback (""); + } +} + +AnySignForPCInterface.prototype.blockDecEx = function (aXgateAddress, + aCipher, + aCharSet, + aElement, + aUserCallback, + aParam) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.doAsyncSend (aElement ? aElement.id : null, + "blockDecEx", + aXgateAddress, + aCipher, + aCharSet, + aUserCallback, + aParam); + } + else + { // 미지원 + aUserCallback (""); + } +} + +AnySignForPCInterface.prototype.blockEncConvert = function (aXgateAddress, + aPath, + aSessionKey, + aPlain, + aMethod, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("blockEncConvert", + aXgateAddress, + aPath, + aSessionKey, + aPlain, + aMethod); + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.blockEncConvertAsync = function (aXgateAddress, + aPath, + aSessionKey, + aPlain, + aMethod, + aCharset, + aUserCallback, + aParam) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.doAsyncSend ('', + "blockEncConvert2", + aXgateAddress, + aPath, + aSessionKey, + aPlain, + aMethod, + aCharset, + aUserCallback, + aParam); + } + else + { // 미지원 + aUserCallback (""); + } +} + +AnySignForPCInterface.prototype.getVIDRandom = function (aXgateAddress, + aMediaID, + aIssuerRDN, + aCertSerial, + aKeyword, + aOption, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("getVIDRandom", + aXgateAddress, + aMediaID, + aIssuerRDN, + aCertSerial, + aKeyword, + aOption); + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.hasCachedData = function (aXgateAddress, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("hasCachedData", + aXgateAddress); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "hasCachedData")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().hasCachedData (aCallback); + } +} + +AnySignForPCInterface.prototype.clearCachedData= function (aXgateAddress, + aOption, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("clearCachedData", + aXgateAddress, + aOption); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "clearCachedData")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().clearCachedData (aCallback); + } +} + +AnySignForPCInterface.prototype.getCertInfoEx = function (aSignedData, + aOriginalData, + aOpOption, + aInfoOption, + aVerifyOption, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("getCertInfoEx", + aSignedData, + aOriginalData, + aOpOption, + aInfoOption, + aVerifyOption); + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.verifyData = function (aSignedData, + aOriginalData, + aOption, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("verifyData", + aSignedData, + aOriginalData, + aOption); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "verifyData")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().verifyData (aSignedData, + aOriginalData, + aOption, + aCallback); + } +} + +AnySignForPCInterface.prototype.initStoreToken = function (aMediaID, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("initStoreToken", + aMediaID); + } + else + { // 미지원 + aCallback (-1); + } +} + +AnySignForPCInterface.prototype.loginStoreToken = function (aMediaID, + aStoreTokenPIN, + aOption, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("loginStoreToken", + aMediaID, + AnySign.mFinancialType, + aStoreTokenPIN, + aOption); + } + else + { // 미지원 + aCallback (-1); + } +} + +AnySignForPCInterface.prototype.logoutStoreToken = function (aMediaID, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("logoutStoreToken", + aMediaID); + } + else + { // 미지원 + aCallback (-1); + } +} + +AnySignForPCInterface.prototype.getKTBScanInfo = function (aServerIP, + aServerPort, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("getKTBScanInfo", + aServerIP, + aServerPort); + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.fileHash = function (aPath, + aAlg, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("fileHash", + aPath, + aAlg); + } + else + { // 미지원 + //aCallback (""); + + } +} + +AnySignForPCInterface.prototype.generateRandom = function (aLength, + aOption, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("generateRandom", + aLength, + aOption); + } + else + { // 미지원 + //aCallback (""); + try {if (!Integrity.checkIntegrity("XCrypto", "generateRandom")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().generateRandom (aLength, aOption, aCallback); + } +} + +AnySignForPCInterface.prototype.initializeSecureDiskFromName = function (aProviderName, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("initializeSecureDiskFromName", + aProviderName); + } + else + { // 미지원 + aCallback (-1); + } +} + +// CmpMod - 0:default, 1:발급, 2:재발급, 3:갱신 +AnySignForPCInterface.prototype.loginSecureDiskFromIndex = function (aProviderName, + aPin, + aSubjectRDN, + aIssuerRDN, + aCertSerial, + aCmpMod, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("loginSecureDiskFromIndex", + aProviderName, + aPin, + aSubjectRDN, + aIssuerRDN, + aCertSerial, + aCmpMod); + } + else + { // 미지원 + aCallback (-1); + } +} + +AnySignForPCInterface.prototype.finalizeSecureDiskFromName = function (aProviderName, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("finalizeSecureDiskFromName", + aProviderName); + } + else + { // 미지원 + aCallback (-1); + } +} + +AnySignForPCInterface.prototype.XK_MakeRandomKeypadID = function (aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("XK_MakeRandomKeypadID"); + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.XK_MakeIndex = function (aSessionID, + aKeyType, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("XK_MakeIndex", + aSessionID, + aKeyType); + } + else + { // 미지원 + aCallback (""); + } +} + +// FCMS +AnySignForPCInterface.prototype.selectFile = function (aInitPath, + aFilterString, + aOption, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("selectFile", + aInitPath, + aFilterString, + aOption); + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.signFileEx = function (aXgateAddress, + aInFilePath, + aOutFilePath, + aMediaID, + aIssuerDN, + aSerial, + aPFXPath, + aPasswd, + aOption, + aDescription, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("signFileEx", + aXgateAddress, + aInFilePath, + aOutFilePath, + aMediaID, + aIssuerDN, + aSerial, + aPFXPath, + aPasswd, + aDescription, + aOption); + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.verifyFile = function (aInFilePath, + aSignedData, + aOption, + aDescription, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("verifyFile", + aInFilePath, + aSignedData, + aDescription, + aOption) + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.getVerifiedFileCertInfo = function (aOption, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("getVerifiedFileCertInfo", + aOption) + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.extractFile = function (aInFilePath, + aOutFilePath, + aOption, + aDescription, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("extractFile", + aInFilePath, + aOutFilePath, + aDescription, + aOption) + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.envelopeFileWithPEM = function (aInFilePath, + aOutFilePath, + aCertPEM, + aOption, + aDescription, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("envelopeFileWithPEM", + aInFilePath, + aOutFilePath, + aCertPEM, + aDescription, + aOption) + } + else + { + // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.envelopeFileWithCert = function (aInFilePath, + aOutFilePath, + aMediaID, + aIssuerRDN, + aCertSerial, + aPFXPath, + aOption, + aDescription, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("envelopeFileWithCert", + aInFilePath, + aOutFilePath, + aMediaID, + aIssuerRDN, + aCertSerial, + aPFXPath, + aDescription, + aOption) + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.deEnvelopeFileWithCert = function (aInFilePath, + aOutFilePath, + aMediaID, + aIssuerRDN, + aCertSerial, + aPFXPath, + aPasswd, + aOption, + aDescription, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("deEnvelopeFileWithCert", + aInFilePath, + aOutFilePath, + aMediaID, + aIssuerRDN, + aCertSerial, + aPFXPath, + aPasswd, + aDescription, + aOption) + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.envelopeFileWithPasswd = function (aInFilePath, + aOutFilePath, + aSymKey, + aOption, + aDescription, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("envelopeFileWithPasswd", + aInFilePath, + aOutFilePath, + aSymKey, + aDescription, + aOption) + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.deEnvelopeFileWithPasswd = function (aInFilePath, + aOutFilePath, + aSymKey, + aOption, + aDescription, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("deEnvelopeFileWithPasswd", + aInFilePath, + aOutFilePath, + aSymKey, + aDescription, + aOption) + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.getEnvelopedFileInfo = function (aEnvelopedFile, + aOption, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("getEnvelopedFileInfo", + aEnvelopedFile, + aOption) + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.uploadFile = function (aXgateAddress, + aPath, + aQuery, + aHostName, + aPort, + aInFilePath, + aUploadOption, + aDescription, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("uploadFile", + aXgateAddress, + aPath, + aQuery, + aHostName, + aPort, + aInFilePath, + aDescription, + aUploadOption); + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.uploadFileEx = function (aXgateAddress, + aPath, + aQuery, + aHostName, + aPort, + aInFilePath, + aUploadOption, + aDescription, + aSID, + aCharset, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("uploadFileEx", + aXgateAddress, + aPath, + aQuery, + aHostName, + aPort, + aInFilePath, + aDescription, + aUploadOption, + aSID, + aCharset); + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.downloadFile = function (aXgateAddress, + aPath, + aQuery, + aHostName, + aPort, + aTargetFilePath, + aDownloadPath, + aDownloadOption, + aDescription, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("downloadFile", + aXgateAddress, + aPath, + aQuery, + aHostName, + aPort, + aTargetFilePath, + aDownloadPath, + aDescription, + aDownloadOption); + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.downloadFileEx = function (aXgateAddress, + aPath, + aQuery, + aHostName, + aPort, + aTargetFilePath, + aDownloadPath, + aDownloadOption, + aDescription, + aSID, + aCharset, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("downloadFileEx", + aXgateAddress, + aPath, + aQuery, + aHostName, + aPort, + aTargetFilePath, + aDownloadPath, + aDescription, + aDownloadOption, + aSID, + aCharset); + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.zipFile = function (aXgateAddress, + aSourceFile, + aTargetFile, + aOption, + aDescription, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("zipFile", + aXgateAddress, + aSourceFile, + aTargetFile, + aDescription, + aOption); + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.unZipFile = function (aXgateAddress, + aSourceFile, + aDestDir, + aOption, + aDescription, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("unZipFile", + aXgateAddress, + aSourceFile, + aDestDir, + aDescription, + aOption); + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.getFileInfo = function (aFilePath, + aOption, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("getFileInfo", + aFilePath, + aOption); + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.clearTempFile = function (aXgateAddress, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("clearTempFile", + aXgateAddress); + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.getHomeDir = function (aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("getHomeDir"); + } + else + { // 미지원 + aCallback (""); + } +} + +AnySignForPCInterface.prototype.envelopIdNumEx = function (aXgateAddress, + aMediaID, + aIssuerDN, + aSerial, + aPFXPath, + aPasswd, + aIDN, + aCertPEM, + aOption, + aCallback) +{ + if (AnySign.mAnySignEnable) + { + this.mSandBox.extension.setcallbackFunc (aCallback); + this.mSandBox.extension.doSend ("envelopIdNumEx", + aXgateAddress, + aMediaID, + aIssuerDN, + aSerial, + aPFXPath, + aPasswd, + aIDN, + aCertPEM, + aOption); + } + else + { + try {if (!Integrity.checkIntegrity("XCrypto", "envelopIdNum")) return;} catch(e) { + console.log("[try catch] " + e.message); + } + this.mSandBox.crypto().envelopIdNum (aMediaID, + aIssuerDN, + aSerial, + aPasswd, + aIDN, + aCertPEM, + aOption, + aCallback); + } +} + +AnySignForPCInterface.prototype.xfsLogin = function (aUserID, + aKeyword, + aSecondYn, + aCode, + aCallback) +{ + this.mSandBox.crypto().xfsLogin (aUserID, + aKeyword, + aSecondYn, + aCode, + aCallback); +} + +AnySignForPCInterface.prototype.xfsOtpRequest = function (aUserID, + aCallback) +{ + this.mSandBox.crypto().xfsOtpRequest (aUserID, + aCallback); +} + +AnySignForPCInterface.prototype.xfsLogout = function (aCallback) +{ + this.mSandBox.crypto().xfsLogout (aCallback); +} + +// AnySignLite API +AnySignForPCInterface.prototype.setCrossStorage = function (aCrossStorageHubUrl, + aCrossStorageOption, + aCallback) +{ + this.mSandBox.crypto().setCrossStorage (aCrossStorageHubUrl, + aCrossStorageOption, + aCallback); +} + +// AnySignLite API +AnySignForPCInterface.prototype.setOpenStorage = function (aOpenKey, + aOpenCertFiles, + aOpenCertEventLisnter, + aGuidewindow, + aCallback) +{ + this.mSandBox.crypto().setOpenStorage (aOpenKey, + aOpenCertFiles, + aOpenCertEventLisnter, + aGuidewindow, + aCallback); +} + +AnySignForPCInterface.prototype.SyncOpenCert = function (aCertSource, + aCertSerial, + aCertPassword, + aCallback) +{ + this.mSandBox.crypto().SyncOpenCert (aCertSource, + aCertSerial, + aCertPassword, + aCallback); +} + +AnySignForPCInterface.prototype.SetCloudTrayView = function (aView) +{ + try { + this.mSandBox.crypto().SetCloudTrayView (aView); + }catch(e) { + return; + } +} + + +AnySignForPC = (function () +{ +// private + var upObject = null; + + var aUserAgent = navigator.userAgent; + + var aBrowserName = "unknown"; + var aBrowserVersion = 0; //Rendering version + + //Check Version + var aRegExp; + if (aUserAgent.indexOf("Edge") >= 0) + { + aBrowserName = "edge"; + aRegExp = new RegExp("Edge\/([0-9]{1,}[\.0-9]{0,})"); + } + else if (aUserAgent.indexOf("MSIE") >= 0 || aUserAgent.indexOf("Trident") >= 0) + { + aBrowserName = "trident"; + + //if(document.compatMode == "BackCompat") { + // aBrowserVersion = 5; + //} else + if(document.documentMode) { + aBrowserVersion = document.documentMode; + } else { + aRegExp = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); + } + } + else if (aUserAgent.indexOf("Firefox") >= 0) + { + aBrowserName = "firefox"; + aRegExp = new RegExp("Firefox\/([0-9]{1,}[\.0-9]{0,})"); + } + else if (aUserAgent.indexOf("OPR") >= 0) + { + aBrowserName = "opera"; + aRegExp = new RegExp("Opera\/([0-9]{1,}[\.0-9]{0,})"); + } + else if (aUserAgent.indexOf("Chrome") >= 0) + { + aBrowserName = "chrome"; + aRegExp = new RegExp("Chrome\/([0-9]{1,}[\.0-9]{0,})"); + } + else if (aUserAgent.indexOf("Safari") >= 0) + { + aBrowserName = "safari"; + aRegExp = new RegExp("Version\/([0-9]{1,}[\.0-9]{0,})"); + } + else if (aUserAgent.indexOf("Opera") >= 0) + { + aBrowserName = "opera"; + aRegExp = new RegExp("Version\/([0-9]{1,}[\.0-9]{0,})"); + } + else + { + alert("unknown browser"); + } + + if (aRegExp && aRegExp.exec(aUserAgent) != null) + aBrowserVersion = parseFloat( RegExp.$1 ); + + var __SANDBOX = + { + loadModule: __loadModule, + integrityModule: null, + plugin: function () { return document.getElementById ("XWCDataPlugin"); }, + crypto: function () { return __initXCrypto(); }, + xcrypto: null, + convertErrCode: __convertErrCode, + browserName: aBrowserName, + browserVersion: aBrowserVersion, + IEVersion: (function() { + if( aBrowserName == "trident" ) + return aBrowserVersion; + else + return NaN; + })(), + isIE: function() { return __SANDBOX.IEVersion; }, + getSafeResponse: function(aText) { return aText; }, + localPathSeperator: "\\", + upInterface: function () { return upObject; }, + showCertselectDialogCommon: __showCertselectDialogCommon, + certSelectDialog: __certSelectDialog, + inputPasswdDialog: __inputPasswdDialog, + verifyVidDialog: __verifyVidDialog, + isFailed: __isFailed, + setButton: __setButton, + setLocationEnable: __setLocationEnable, + certLocationSet: {}, + refreshCertLocationSet: __refreshCertLocationSet, + inputKeyHandler: __inputKeyHandler, + allowNormalInput: aAllowNativeInput, + addDialogOffset: __addDialogOffset, + removeDialogOffset: __removeDialogOffset, + dialogOffset: 530000, + dialogStack: [], + setUbiKeyFunction: function (f) { UbikeyFunction = f; }, + getUbiKeyFunction: function (r) { UbikeyFunction(r); }, + transkey: null, + isCheckFunction: __isCheckFunction, + convertTable: null, + setConvertTable : __setConvertTable, + setAfterAction: __setAfterAction, + cacheSmartCert: false, + cacheCertData: {}, + clearCacheCert: __clearCacheCert, + processCacheCert: __processCacheCert, + getInputType: __getInputType, + setMediaType: __setMediaType, + getMediaType: __getMediaType, + envelopIdnum_idnum:"", + envelopIdnum_result:"", + isDialogLoaded: false, + informationDialog: null + } + + // AnySignLite init + function __initXCrypto () { + if (__SANDBOX.xcrypto == null) { + if (typeof XCrypto == "undefined") + return null; + + if (!XCrypto.checkXCrypto || typeof XCrypto.checkXCrypto != "function") + return null; + + __SANDBOX.xcrypto = XCrypto; + + if (AnySign.mSecurityContext != "" && AnySign.mSecurityOption != "") { + __SANDBOX.xcrypto.setSecurityContext (AnySign.mSecurityContext, AnySign.mSecurityOption); + } + + var aGuideModule = __SANDBOX.loadModule("guidewindow"); + + // XecureFreeSign init + __SANDBOX.xcrypto.xfsInit (AnySign.mXecureFreeSignData.serviceURL, + AnySign.mXecureFreeSignData.serviceKey, + AnySign.mXecureFreeSignData.asyncOption, + AnySign.mXecureFreeSignData.signType, + AnySign.mWebPageStorageData.type, + AnySign.mWebPageStorageData.certList, + AnySign.mWebPageStorageData.storageElementID, + aGuideModule); + } + __SANDBOX.xcrypto.setProperty (AnySign.mLanguage, AnySign.mCharset, AnySign.mLicense); + return __SANDBOX.xcrypto; + } + + function __convertErrCode (aCode) { + if(aCode > 0xFFFFFF) { + // 0x[12][34][56][78] + var aCode1234 = Math.floor(aCode/0x10000); + var aCode34 = aCode1234 - Math.floor(aCode1234/0x100)*0x100; + var aCode78 = aCode - Math.floor(aCode/0x100)*0x100; + if(aCode34 == 0x06) { + switch(aCode78) { + case 0x04 : return XW_ERROR_NOT_LOGIN; + case 0x07 : return XW_ERROR_USER_LOGIN_INVALID_PASSWD1; + case 0x08 : return XW_ERROR_USER_LOGIN_INVALID_PASSWD2; + case 0x09 : return XW_ERROR_USER_LOGIN_EXPIRED_PASSWD2; + case 0x0A : return XW_ERROR_VERIFYPASSWORD; + case 0x0B : return XW_ERROR_CERT_PASSWORD_UPDATE_FAIL; + default: return aCode; + } + } else { + switch(aCode78) { + case 0x02 : return XW_ERROR_INCORRECT_PARAM; + case 0x03 : return XW_ERROR_NOT_SUPPORTED_MEDIA; + case 0x04 : return XW_ERROR_DIFFRENT_PASSWORD; + case 0x05 : return XW_ERROR_INCORRECT_PASSWORD; + case 0x06 : return XW_ERROR_INCORRECT_PASSWORD_KMCERT; + case 0x07 : return XW_ERROR_INPUT_LENGTH; + case 0x08 : return XW_ERROR_INPUT_LENGTH_10; + case 0x09 : return XW_ERROR_PASSWORD_IS_WRONG; + case 0x0A : return XW_ERROR_PASSWORD_MIX_DISIT_ALPHA_PUNCT; + case 0x0B : return XW_ERROR_PASSWORD_NOT_ALLOW_CHARACTER; + case 0x0C : return XW_ERROR_CONFIRMED_PASSWORD_DOES_NOT_MATCH; + case 0x0D : return XW_ERROR_GETCERTIFICATE; + case 0x0E : return XW_ERROR_GETCERT; + case 0x0F : return XW_ERROR_USE_CERT_FAIL; + case 0x10 : return XW_ERROR_GETCERTTREE; + case 0x11 : return XW_ERROR_SAVECERT; + case 0x12 : return XW_ERROR_PFX_CERT_IMPORT_FAIL; + case 0x13 : return XW_ERROR_EXPORTCERT; + case 0x14 : return XW_ERROR_DELETECERT; + case 0x15 : return XW_ERROR_VERIFYPASSWORD; + case 0x16 : return XW_ERROR_CHANGECERTPASSWORD; + case 0x17 : return XW_ERROR_VERIFYCERT; + case 0x18 : return XW_ERROR_VERIFYCERTOWNER; + case 0x19 : return XW_ERROR_CREATE_SIGNDATA; + case 0x1A : return XW_ERROR_GETPLAINDATAOFSIGNDATA; + case 0x1B : return XW_ERROR_ENVELOPIDNUM; + case 0x1C : return XW_ERROR_ENVELOP_FAIL; + case 0x1D : return XW_ERROR_DEENVELOP_FAIL; + case 0x1E : return XW_ERROR_REQUESTCERT; + case 0x1F : return XW_ERROR_RENEWCERT; + case 0x20 : return XW_ERROR_RECOVERCERT; + case 0x21 : return XW_ERROR_REVOKECERT; + case 0x22 : return XW_ERROR_HASHDATA; + case 0x23 : return XW_ERROR_ENCRYPT_PRIKEY; + case 0x24 : return XW_ERROR_DECRYPT_PRIKEY; + case 0x25 : return XW_ERROR_PKCS8_NO_VID; + case 0x26 : return XW_ERROR_PKCS8_NO_RANDOM; + case 0x27 : return XW_ERROR_SIGN_DUPLICATE_CERT; + case 0x28 : return XW_ERROR_SAVE_CERT_ALREADY_EXIST; + case 0x29 : return XW_ERROR_CERT_EXPIRED; + default: return aCode; + } + } + } else { + return aCode; + } + } + + // AnySignForPC + __SANDBOX.convertTable = new Array(); + + function gCheckTime () + { + if (gStartTime == 0) + { + clearInterval (gTimeIntervalFunc); + return; + } + + var existDialog = document.getElementById("xwup_xvvcursor_disabled"); + if (existDialog == null) + { + clearInterval (gTimeIntervalFunc); + return; + } + + var currentTime = new Date().getTime(); + if ((currentTime - gStartTime) > 2000) + { + clearInterval (gTimeIntervalFunc); + + var aGuideModule = __SANDBOX.loadModule("guidewindow"); + gGuideDialog = aGuideModule({ + type: "login", + args: "", + onconfirm: "", + oncancel: function () {gGuideDialog.dispose();} + }); + + gGuideDialog.show(); + gShowGuideDialog = true; + + if (gStartTime == 0) + setTimeout(gCloseGuideDialog, 1000); + } + } + + function gCloseGuideDialog () + { + gGuideDialog.dispose(); + gGuideDialog = null; + gShowGuideDialog = false; + } + + function gStartGuideDialog () + { + var element = document.getElementById("xwup_title_guidewindow"); + if (element == null) { + gStartTime = new Date().getTime(); + gTimeIntervalFunc = setInterval (gCheckTime, 50); + } + } + + function gEndGuideDialog () + { + gStartTime = 0; + clearInterval (gTimeIntervalFunc); + + if (gGuideDialog) { + if (gShowGuideDialog) { + gCloseGuideDialog (); + } + } + } + + function __isCheckFunction (aFunctionName) + { + return __SANDBOX.upInterface().checkFunction (aFunctionName); + } + + function __addDialogOffset () { + return __SANDBOX.dialogOffset += 10; + } + + function __removeDialogOffset () { + return __SANDBOX.dialogOffset -= 10; + } + + function __refreshCertLocationSet (aStorage) { + var aCertLocationArray = aStorage.split(","), + i; + + __SANDBOX.certLocationSet = {}; + for (i= 0; i < aCertLocationArray.length; i++) { + __SANDBOX.certLocationSet[aCertLocationArray[i].toLowerCase()] = true; + } + } + + if (aStorage) { + __SANDBOX.refreshCertLocationSet (aStorage); + } + + if(navigator.platform.indexOf("Win") != 0) + __SANDBOX.localPathSeperator = "/"; + + if(__SANDBOX.isIE() && typeof(document.documentMode) == "undefined") + { + document.documentMode = __SANDBOX.isIE(); + } + + upObject = new AnySignForPCInterface(__SANDBOX); + + var loadModule = __loadModule; + + function __loadModule (moduleName) + { + var req; + if (window.ActiveXObject) { + try { + req = new ActiveXObject("MSXML2.XMLHTTP.3.0"); + }catch(e) { + try { + req = new ActiveXObject("Microsoft.XMLHTTP"); + }catch(e){ + console.log("[try catch] " + e.message); + } + } + } + else if (window.XMLHttpRequest) { + req = new window.XMLHttpRequest; + } + + var d = new Date(); + var year = d.getFullYear().toString(); + var month = (d.getMonth()+1).toString(); + var day = d.getDate().toString(); + var hour = d.getHours().toString(); + var minutes = Math.floor(d.getMinutes()/10) * 10 + + var path = AnySign.mBasePath + "/module/" + moduleName + ".js?version=" + year + month + day + hour + minutes; + + req.open ('GET', path, false); + req.send (null); + + eval(__SANDBOX.getSafeResponse(req.responseText)); + var moduleConstructor = eval (__SANDBOX.getSafeResponse("__" + moduleName)); + + return moduleConstructor (__SANDBOX); + } + + function __isFailed (aResult, aErrCallback) + { + if ( (typeof(aResult) == "string" && aResult === "") || (typeof(aResult) == "number" && aResult !== 0 )) + { + var aErrorObject = __SANDBOX.upInterface().setErrCodeAndMsg(); + + if (aErrorObject.code != "0") + { + if (aErrorObject.code == XW_ERROR_VERIFY_INTEGRITY) { // integrity fail + alert(aErrorObject.msg.replace(/\\n/g, '\r\n')); + } else if (aErrCallback) { + aErrCallback (aErrorObject); + } + return true; + } + + else + { + //Something is wrong but what can we do? + return true; + } + } + + return false; + } + + function __setButton(aElements, aAttributeType, aValue, aIsWin){ + // WIN32, WIN64 + if(aIsWin){ + if(navigator.platform == "Win32" || navigator.platform == "Win64"){ + if(aAttributeType == "checked") + aValue = true; + else + aValue = false; + } + } + + switch(aAttributeType){ + case "checked": + for(var i = 0; i < aElements.length; i++){ + if(aValue) + aElements[i].checked = true; + else + aElements[i].checked = false; + } + break; + case "disabled": + for(var i = 0; i < aElements.length; i++){ + //var aImage = aElements[i].getElementsByTagName("span")[0]; + var aText = aElements[i].getElementsByTagName("span")[1]; + if (aText == undefined) aText = aElements[i]; + if(aValue) { + aElements[i].disabled = true; + if(aText) aText.style.color = "#bbb"; + } + else { + aElements[i].disabled = false; + if(aText) aText.style.color = "black"; + } + } + break; + } + } + + function __setLocationEnable(aLocations, aElements, aIsWin32Only, aDisableLocation) { + var aDisable = false, + i; + + if(aIsWin32Only) { + if(navigator.platform == "Win32") + aDisable = false; + else + aDisable = true; + } + + if (aDisable == false) { + aDisable = true; + for (i=0; i < aLocations.length; i++) { + if (__SANDBOX.certLocationSet[aLocations[i]]) { + aDisable = false; + break; + } + } + } + + if (aDisableLocation && aIsWin32Only != true) { + aDisable = false; + if (navigator.platform != "Win32") + __SANDBOX.certLocationSet[aDisableLocation] = false; + } + + for (i=0; i < aElements.length; i++) { + aElements[i].disabled = aDisable; + } + } + + function __inputKeyHandler (aName, aOriInputObj, aIndex, aX, aY, aKeyType, aMaxSize, aNewWidth, aInputType) { + var aOriInput = aOriInputObj; + var orgbk = '#FFFFFF'; + + //transkey var + var aTransKeyInputFlag = false; + var aTransKeyID; + var aTransKey; + var aTransKeyInputID; + var aTransKeyCheckboxID; + var aTransKeyCheckbox; + var aTransKeyPath = AnySign.mTransKeyPath; + var aTransKeyEnable = AnySign.mTransKeyEnable; + var aIncaNOSv10KeypadImgPath = AnySign.mIncaNOSv10KeypadImgPath; + var aEzKeyTecInputData = ""; + + // touchenkey var + var aTouchEnKeyObj = document.getElementById ("TouchEnKey"); + var aTouchEnKeyEnable = AnySign.mTouchEnKeyEnable != false && aTouchEnKeyObj !=null && typeof(aTouchEnKeyObj) != "undefined"; + + var aTouchEnKeyName; + var aTouchEnKeyInputName; + + //transkey references + var _TransKeyName, + _GenerateSessionKeyRef, + _KeyTypeRef, + _GenKeyRef, + _TransKeyPage; + + //openkeyboard var + /* + * file : openkeyboard_ac.js + * object : var openkeyboard = null; + * set : var ok_windowIsOnload = false; + * set : this.url = ""; + * hidden field name prefix : _E2E_OK_ + * checkbox child element tag: + */ + var aOpenkeyboardEnable = aTransKeyEnable != true && AnySign.mOpenkeyboardEnable != false && typeof(OpenKeyboard) != "undefined"; + var aKeyTypeRef; + var aOriInputParent; + var aOpenkeyboardCheckbox; + var aOpenkeyboardElement; + + if (navigator.platform.indexOf("Win") != 0) + aOpenkeyboardEnable = false; + + // K-Defense var + var aKDefenseEnable = aTouchEnKeyEnable != true && AnySign.mKDefenseEnable != false; + + // Inca VKeypad var + var aVKeypadEnable = aTransKeyEnable != true && AnySign.mVKeypadEnable != false; + + // XecureKeyPad var + var aXecureKeyPadEnable; + var aXKModule = null; + var aXKName = "xk_dialog_" + aOriInput.name + "_img"; + var aXKType; + + aXecureKeyPadEnable = aTransKeyEnable != true && aOpenkeyboardEnable != true && AnySign.mXecureKeyPadEnable != false; + + // XecureKeyPad HTML5 var (Lite or XFS client sign) + var aXecureKeyPadHTML5Enable; + var aXKHTML5Module = null; + var aXKHTML5Name = "xk_dialog_" + aOriInput.name; + + aXecureKeyPadHTML5Enable = AnySign.mXecureKeyPadHTML5Enable; + + // XecureKeyPad E2E var (XFS server sign) + var aXecureKeyPadE2EEnable = AnySign.mXecureKeyPadE2EEnable; + + // nProtect KeyCrypt_HTML5 var + var aKeyCryptHTML5Enable = aTouchEnKeyEnable != true && aKDefenseEnable != true && aKOSKeyEnable != true && AnySign.mKeyCryptHTML5Enable != false; + if (__SANDBOX.isIE () < 7 || AnySign.mPlatform.aName == "linux" || AnySign.mPlatform.aName == "mac universal") + aKeyCryptHTML5Enable = false; + + // ASTx var + var aASTxEnable = aTouchEnKeyEnable != true && aKDefenseEnable != true && aKeyCryptHTML5Enable != true && aKOSKeyEnable != true && AnySign.mASTxEnable != false; + var aASTx_windowid; + var aASTx_formid; + var aASTx_inputid; + + if (AnySign.mPlatform.aName == "linux" || AnySign.mPlatform.aName == "mac universal") { + aASTxEnable = false; + } + + // TouchEn nxKey + var aTouchEnnxKeyEnable = aTouchEnKeyEnable != true && aKDefenseEnable != true && aKeyCryptHTML5Enable != true && aASTxEnable != true && aKOSKeyEnable != true && AnySign.mTouchEnnxKeyEnable != false; + if (AnySign.mPlatform.aName == "linux" || (AnySign.mPlatform.aName == "mac universal" && (AnySign.mTouchEnnxKeyMacEnable == false))) { + aTouchEnnxKeyEnable = false; + } + // KINGS key + var aKOSKeyEnable = aTouchEnKeyEnable != true && aKDefenseEnable != true && aKeyCryptHTML5Enable != true && aASTxEnable != true && aTouchEnnxKeyEnable != true && AnySign.mKOSKeyEnable != false; + + // Inca NOSv10 + var aIncaNOSv10Enable = AnySign.mIncaNOSv10Enable; + var aIncaNOSv10KeypadEnable = AnySign.mIncaNOSv10KeypadEnable; + + //EzKeyTec + var aEzKeyTecEnable = AnySign.mEzKeyTecEnable; + + // reset + if (aInputType == "envelope") + { + aTransKeyEnable = false; + aTouchEnKeyEnable = false; + aOpenkeyboardEnable = false; + aKDefenseEnable = false; + aVKeypadEnable = false; + aXecureKeyPadEnable = false; + aKeyCryptHTML5Enable = false; + aASTxEnable = false; + aTouchEnnxKeyEnable = false; + aKOSKeyEnable = false; + aIncaNOSv10Enable = false; + aXecureKeyPadHTML5Enable = false; // lite + aIncaNOSv10KeypadEnable = false; + aEzKeyTecEnable = false; + aXecureKeyPadE2EEnable = false; // e2e + } else if (aInputType == "lite" || aInputType == "e2e") + { + //aTransKeyEnable = false; + aTouchEnKeyEnable = false; + aOpenkeyboardEnable = false; + aKDefenseEnable = false; + aVKeypadEnable = false; + aXecureKeyPadEnable = false; + aKeyCryptHTML5Enable = false; + aASTxEnable = false; + //aTouchEnnxKeyEnable = false; + aKOSKeyEnable = false; + //aIncaNOSv10Enable = false; + //aIncaNOSv10KeypadEnable = false; + aEzKeyTecEnable = false; + + if (aInputType == "lite") + aXecureKeyPadE2EEnable = false; + else if (aInputType == "e2e") + aXecureKeyPadHTML5Enable = false; + } else + { // 4pc + aXecureKeyPadHTML5Enable = false; + aXecureKeyPadE2EEnable = false; + } + + //2013.03.22 _GenerateSessionKeyRef 라온시큐어 김지수 가이드 : transkeyServlet 사용법 수정으로 모두 주석 처리 + //init var about TransKey + + if (aTransKeyEnable) + { + if (typeof xc_TransKey != "undefined") { + AnySign.mTransKeyIsXC = true; + //old version + _TransKeyName = "xc_TransKey"; + _GenerateSessionKeyRef = xc_generateSessionKey; + _KeyTypeRef = aKeyType.substr(0, aKeyType.indexOf("_crt")); + _GenKeyRef = tk_getrnd_hex; + _TransKeyPage = aTransKeyPath + "/index.jsp"; + + aOriInput.style.width = aNewWidth +"px"; + aTransKeyID = aName + "_tk" + aIndex; + aTransKeyInputID = aName + "_tk" + aIndex + "_input"; + + eval(__SANDBOX.getSafeResponse(aTransKeyID + "= null")); + _GenerateSessionKeyRef (_TransKeyPage); + eval(__SANDBOX.getSafeResponse(aTransKeyID +" = new " + _TransKeyName + " (aTransKeyID, aX, aY, _TransKeyPage, _KeyTypeRef, aMaxSize, 'password');")); + + eval(__SANDBOX.getSafeResponse("aTransKey = " + aTransKeyID)); + aOriInput = document.getElementById(aTransKeyInputID); + } else { + AnySign.mTransKeyIsXC = false; + _TransKeyName = "TransKey"; + _GenerateSessionKeyRef = generateSessionKeyForCRT; + _KeyTypeRef = aKeyType; + _GenKeyRef = new GenKey().GenerateKey; + _TransKeyPage = aTransKeyPath; + + if (!AnySign.mTransKeyCheckBoxEnable) + { + aOriInput.style.width = aNewWidth +"px"; + //20181114 yhkim + //라온시큐어측에서 건강보험관리공단(장기요양) 적용 시 가상키패드 버전 변경으로 아래와 같이 처리함 + if(aInputType == "lite" && (aName == "certselect" || aName == "certselectwide")) + { + aTransKeyID = aName + "_lite_tk" + aIndex; + aTransKeyInputID = "xwup_" + aName + "_lite_input" + aIndex; + } + else + { + aTransKeyID = aName + "_tk" + aIndex; + aTransKeyInputID = "xwup_" + aName + "_tek_input" + aIndex; + } + eval(aTransKeyID + "= null"); + + + //2013.02.18, wbr : 라온시큐어 이남열대리 가이드로 세션키 생성 시점을 트랜스키 객체 생성 전으로 변경 + _GenerateSessionKeyRef (_TransKeyPage); + eval(aTransKeyID +" = new " + _TransKeyName + " (aTransKeyID, aX, aY, _TransKeyPage, _KeyTypeRef, aMaxSize, 'password');"); + + eval("aTransKey = " + aTransKeyID); + aOriInput = document.getElementById(aTransKeyInputID); + + if(AnySign.mTransKeyXY != "") + { + aOriInput.setAttribute ("data-tk-kbdxy", AnySign.mTransKeyXY); + } + + if(aInputType == "lite") + { + transkey[aTransKeyInputID].button.src=transkey_url+'/images/on.png'; + transkey[aTransKeyInputID].useTranskey=true; + transkey[aTransKeyInputID].inputObj.readOnly=true; + transkey[aTransKeyInputID].checkValue.value="transkey"; + transkey[aTransKeyInputID].buttonListener = function(btnObj, inputId){return;}; + } + else if(aTouchEnnxKeyEnable == false) + { + transkey[aTransKeyInputID].button.src=transkey_url+'/images/on.png'; + transkey[aTransKeyInputID].useTranskey=true; + transkey[aTransKeyInputID].inputObj.readOnly=true; + transkey[aTransKeyInputID].checkValue.value="transkey"; + transkey[aTransKeyInputID].buttonListener = function(btnObj, inputId){return;}; + } + } + //20190417 라온시큐어 이선호대리와 협의하여 mTransKeyCheckBoxEnable는 지원안하기로 함 + /*else + { + aTransKeyID = aName + "_tk" + aIndex; + aTransKeyInputID = "xwup_" + aName + "_tek_input" + aIndex; + aTransKeyCheckboxID = aName + "_tk" + aIndex + "_button"; + + aX -= 78; + + //2013.02.18, wbr : 라온시큐어 이남열대리 가이드로 세션키 생성 시점을 트랜스키 객체 생성 전으로 변경 + //_GenerateSessionKeyRef (_TransKeyPage); + eval(aTransKeyID +" = new " + _TransKeyName + " (aTransKeyID, aX, aY, _TransKeyPage, _KeyTypeRef, aMaxSize, 'password', '" + aTransKeyInputID + "');"); + eval (aTransKeyID + ".useTransKey = false"); + eval("aTransKey = " + aTransKeyID); + aTransKeyCheckbox = document.getElementById(aTransKeyCheckboxID); + }*/ + } + } + + //init vars about TouchEnKey + if (aTouchEnKeyEnable) { + aTouchEnKeyName = aOriInput.form.name; + if (!aTouchEnKeyName) { + alert("XWUP error [" + aTouchEnKeyName.outerHTML + "] doesn't have name"); + } + aTouchEnKeyInputName = aName + "_tek_input" + aIndex; + aOriInput.setAttribute ("enc", "on"); + aOriInput.setAttribute ("kbd", "off"); + } + + //init vars about KeyCrypt_HTML5 + if (aKeyCryptHTML5Enable) { + var aKeyCryptHTML5div; + var aOriInputParent; + var form = aOriInput.form; + var name = aOriInput.name; + + function CreateIe7HiddenInput (form, name) { + var element = document.createElement ("input"); + element.setAttribute ("type", "hidden"); + element.setAttribute ("name", name+"__E2E__"); + form.appendChild (element); + } + + aKeyCryptHTML5div = document.createElement("div"); + aKeyCryptHTML5div.className = "nppfs-elements"; + aOriInputParent = aOriInput.form; + aOriInputParent.appendChild(aKeyCryptHTML5div); + + if (__SANDBOX.isIE () <= 7) { + CreateIe7HiddenInput (aOriInput.form, name); + aOriInputParent = aOriInput.form; + } + + aOriInput.setAttribute ("enc", "re"); + + // Regist Dynamic Field + npPfsCtrl.RegistDynamicField(form, name); + } + + //init vars about VKeyPad + if (aVKeypadEnable) { + aOriInput.readOnly = true; + + // keypad create location div + aVkeypadDiv = document.createElement("div"); + aVkeypadDiv.id = "vKeypad" + aOriInput.name; + aOriInput.form.appendChild(aVkeypadDiv); + + // keypad type (PASSWORD, ALPHANUM) + if(aKeyType.indexOf("number") == 0) { + npKpdType = npKpd.define.types.PASSWORD; + } else { + npKpdType = npKpd.define.types.ALPHANUMCERT; + } + + // keypad create + strObjParam = "vKeypadOK(" + npKpdType + ",'" + aOriInput.form.name + "','" + aOriInput.name + "');"; + var objOption = {type:npKpdType, inputs:aOriInput.name, form:aOriInput.form.name, display:"hide", imagepath:AnySign.mBasePath + "/../inca/keypad/jsp", checkfunc:strObjParam}; + npKpd.create(aVkeypadDiv.id, objOption); + + if (aOriInput.addEventListener) { + aOriInput.addEventListener( "click", function(e){ + + }, false); + } else if (aOriInput.attachEvent) { + aOriInput.attachEvent( "onclick", function(e){ + + }); + } + } + + // Init Inca NOSv10 + var aParentForm; + //aParentForm = aOriInput.form; + /* + aParentForm = aOriInput; + while (aParentForm) { + if (aParentForm.tagName && (aParentForm.tagName.toUpperCase() == "FORM")) { + break; + } + aParentForm = aParentForm.parentNode; + } + */ + if (aIncaNOSv10KeypadEnable) { + aParentForm = aOriInput.form; + aOriInput.setAttribute ("npkencrypt", "re"); + if(aKeyType.indexOf("number") == 0) { + aOriInput.setAttribute ("data-keypad-type", "num"); + } else { + aOriInput.setAttribute ("data-keypad-type", "alpha"); + } + aOriInput.setAttribute ("data-keypad-useyn-type", "toggle"); + aOriInput.setAttribute ("data-keypad-useyn-input", aOriInput.name + "_useyn_toggle"); + + var aIncaIcon = document.createElement("IMG"); + aIncaIcon.id = aOriInput.name + "_useyn_toggle"; + aIncaIcon.src= aIncaNOSv10KeypadImgPath + "icon_mouse_on.gif"; + + aOriInputParent = aOriInput.parentNode; + aOriInputParent.appendChild(aIncaIcon); + + npPfsCtrl.RegistDynamicField(aParentForm, aOriInput.name); + } + + if (aIncaNOSv10Enable) { + if(aInputType == "lite") + { + ///키패드 중복 append 로직 Start + var npLength = npVCtrl.keypadObject.length; + + for (var i=0; i 0) { + aOpenkeyboardElement.value = ""; + } + } + + // TouchEnKey 미지원 브라우저 처리 + //if (navigator.platform.indexOf("Win") != 0 || (aBrowserName == "opera" && aBrowserVersion >= 12)) { + if (!aTouchEnKeyEnable && AnySign.mTouchEnKeyEnable) { + aOriInput.readOnly = true; + if (aOriInput.addEventListener) { + aOriInput.addEventListener( "click", function(e){ + openkeyboard.start(aOriInput); + }, false); + } else if (aOriInput.attachEvent) { + aOriInput.attachEvent( "onclick", function(e){ + openkeyboard.start(aOriInput); + }); + } + } + + if (__SANDBOX.isIE() > 8) { + // IE9,10 ESC key exception + //openkeyboard.start(aOriInput); + } + } + + // init K-Defense + /* + if (aKDefenseEnable) { + if (document.kdefense == null || typeof(document.kdefense) == "undefined" || document.kdefense.object == null) { + if(navigator.mimeTypes["application/lssl-plugin"] == null) { + aKDefenseEnable = false; + } else { + aKDefenseEnable = true; + } + } else { + aKDefenseEnable = true; + } + + if (aKDefenseEnable == true) { + kdfCertEncInit(); + } + } + */ + + // init ASTx + if (aASTxEnable) { + //ASTx 1.2 + /* + aOriInput.setAttribute ("e2esdk", "true"); + astxsdk_set_option("e2e_sdk_customcode", "1967"); + astxsdk_init(); + + aASTx_windowid = astxsdk_get_e2e_windowid(); + aASTx_formid = astxsdk_get_e2e_formid(aOriInput); + aASTx_inputid = astxsdk_get_e2e_inputid(aOriInput); + */ + + // ASTx 1.3 + aOriInput.setAttribute ("e2e_type", "11"); + $ASTX2.initNonE2E(1967); + + aASTx_windowid = $ASTX2.getE2EPageID(); + aASTx_formid = $ASTX2.getE2EPageID(); + + console.log("AnySign_input_name:" + aOriInput.name); + console.log("astxsdk_get_e2e_windowid:" + aASTx_windowid); + console.log("astxsdk_get_e2e_formid:" + aASTx_formid); + console.log("astxsdk_get_e2e_inputid:" + aASTx_inputid); + } + + //init vars about XecureKeyPad + /* + * XK_MakeRandomKeypadID : 키패드 세션ID 생성 + * XK_MakeIndex : 키패드 생성 + */ + if (aXecureKeyPadEnable) { + aXKModule = new XKModule(); + + var makeIndexCallback; + var aXKModuleSpan = document.createElement("SPAN"); + aXKModuleSpan.id = "xk_dialog_" + aOriInput.name + "_span"; + //aXKModuleSpan.style.verticalAlign = "top"; + //aXKModuleSpan.style.marginTop = "3px"; + + var aPositionInfo = { + option : 1, + left : 0, + top : null + }; + + if (AnySign.mDivInsertOption == 1) + aPositionInfo.left = 170; + + if(aKeyType.indexOf("number") == 0) { + aXKType = "number"; + } else { + aXKType = "qwerty"; + } + + aOriInput.parentNode.appendChild(aXKModuleSpan); + + var CB_XK_MakeIndex = function (result) + { + makeIndexCallback (result.split(",")); + } + + var CB_XK_MakeRandomKeypadID = function (result) + { + if (aXKModule.sessionID == null) + aXKModule.sessionID = result; + + aXKModule.setTimer(30); + + __SANDBOX.upInterface().XK_MakeIndex(aXKModule.sessionID, aXKType, CB_XK_MakeIndex); + } + + var aMakeIndexFunction = function(callback) + { + makeIndexCallback = callback; + + if(aXKModule.sessionID == null) + __SANDBOX.upInterface().XK_MakeRandomKeypadID (CB_XK_MakeRandomKeypadID); + else { + CB_XK_MakeRandomKeypadID (null); + } + } + + var aCustomInitializeFunction = function() + { + if(document.MKD25 != null || typeof(document.MKD25) != "undefined") + MKD25.SkipVerify(1); + } + var aCustomFinalizeFunction = function() + { + if(document.MKD25 != null || typeof(document.MKD25) != "undefined") + MKD25.SkipVerify(0); + } + + aXKModule.makeIndex = aMakeIndexFunction; + aXKModule.setCustomFunction (aCustomInitializeFunction, aCustomFinalizeFunction); + aXKModule.setAttachAnySignPC(); + + aXKModule.initialize(aXKName, aXKModuleSpan, aOriInput, aNewWidth, aXKType, 'decrypted', aPositionInfo, 0); + } + + //init vars about XecureKeyPad HTML5 (lite), E2E (XFS) + if (aXecureKeyPadHTML5Enable || aXecureKeyPadE2EEnable) { + var aXKModuleSpan = document.createElement("SPAN"); + aXKModuleSpan.id = "xk_dialog_" + aOriInput.name + "_span"; + + var aPositionInfo = { + option : 1, + left : -18, + top : null + }; + + if (AnySign.mDivInsertOption == 1) + aPositionInfo.left = 20; + + aOriInput.parentNode.appendChild(aXKModuleSpan); + + if (aXecureKeyPadHTML5Enable) { + aXKHTML5Module = new XKeypadHTML5(); + aXKType = "qwerty"; + } else { + aXKHTML5Module = new XKeypadE2E(); + if(aKeyType.indexOf("number") == 0) { + aXKType = "number"; + } else { + aXKType = "qwerty"; + } + } + + aXKHTML5Module.initVirtualKeypadWithPosition(aXKHTML5Name, aXKModuleSpan, aOriInput, aNewWidth, aXKType, aPositionInfo, 0); + if (aOriInput.addEventListener) { + aOriInput.addEventListener( "click", function(e){ + aXKHTML5Module.createKeypad(); + }, false); + } else if (aOriInput.attachEvent) { + aOriInput.attachEvent( "onclick", function(e){ + aXKHTML5Module.createKeypad(); + }); + } + } + + //init TouchEn nxKey + if (aTouchEnnxKeyEnable) { + aTouchEnKeyName = aOriInput.form.name; + if (!aTouchEnKeyName) { + alert("XWUP error [" + aTouchEnKeyName.outerHTML + "] doesn't have name"); + } + + if(aInputType == "lite" && (aName == "certselect" || aName == "certselectwide")) + { + aTouchEnKeyInputName = aName + "_lite_input" + aIndex; + } + else + { + aTouchEnKeyInputName = aName + "_tek_input" + aIndex; + } + aOriInput.setAttribute ("enc", "on"); + } + + //init Kings Key + if (aKOSKeyEnable) { + var pubKey = "MIGJAoGBALp7h5CCh1QXUisoA6TFDZUH2Ykeqn5vsYF6Y/ECPbr/8aR0NImwMT9R80MfKn8OeErXmQBfFrB9YTivKLgdQwouIT11FdCHbwGCuyrZ+0dEiUeFvPHCxah5ZMWmbABSOJtfJYq+OyW3/Z1/PgVW9pp5Zo858aC099fMJ5VPa9hDAgMBAAE="; + + KOS.registerElementWithKey(aOriInput, + 'none', + 'data-kdf-e2e-pubkey', + pubKey); + + } + + if(aEzKeyTecEnable) { + EZKInput.InitInput(aOriInput.id,doEnterEzKeyTec); + + function doEnterEzKeyTec(objInput, sEnterText) + { + aEzKeyTecInputData = sEnterText; + } + } + + return { + onComplete : function (completeHandle) { + if (aTransKeyEnable) { + var aOkFunction = function() { + aTransKeyInputFlag = (_KeyTypeRef.indexOf("number") == 0 || _KeyTypeRef.indexOf("qwerty") == 0); //number use close func only + completeHandle.ok(); + } + var aCloseFunction = function() { + aTransKeyInputFlag = (_KeyTypeRef.indexOf("number") == 0 || _KeyTypeRef.indexOf("qwerty") == 0); //number use close func only + completeHandle.close(); + } + aTransKey.onCompleteInput = aOkFunction; + aTransKey.onCompleteClose = aCloseFunction; + } else if (aOpenkeyboardEnable) { + var aOkFunction = function() { + openkeyboard.stop(); + completeHandle.ok(); + } + var aCloseFunction = function() { + openkeyboard.stop(); + completeHandle.close(); + } + openkeyboard.confirm = aOkFunction; + openkeyboard.cancel = aCloseFunction; + } else if (aVKeypadEnable) { + var aOkFunction = function() { + completeHandle.ok(); + } + var aCloseFunction = function() { + completeHandle.close(); + } + } else if (aXecureKeyPadEnable) { + var aOkFunction = function() { + aXKModule.stop(); + var xkLayer = document.getElementById(aXKName); + if (xkLayer != null) + xkLayer.parentNode.removeChild(xkLayer); + + aOriInput.readOnly = false; + + completeHandle.ok(); + } + var aRefreshCallback = function (aResult) { + aXKModule.genkeypad(aResult); + } + var aRefreshFunction = function () { + aXKModule.clear(); + aXKModule.makeIndex(aRefreshCallback); + } + aXKModule.enter = aOkFunction; + aXKModule.refresh = aRefreshFunction; + } else if (aXecureKeyPadHTML5Enable || aXecureKeyPadE2EEnable) { + var aOkFunction = function (aResult) { + aOriInput.readOnly = false; + if (aResult == "XK_ENTER") // 입력완료: XK_ENTER, 닫기: XK_CLOSE + completeHandle.ok(); + } + aXKHTML5Module.setCloseCallback(aOkFunction); + } + }, + + generateSessionID : function(aOption, callback) { + var aResult = ""; + var aKeyType = ""; + var aSetData = ""; + var aSetPreData = ""; + var aIsPreData = false; + + + /*========================================================================= + * setSecureInput aSetData callback function + =========================================================================*/ + _CB_setSecureInput_setData = function () + { + //if (aTouchEnnxKeyEnable) + if (aKeyType == XW_SECUREINPUT_TOUCHENNXKEY) { + TK_GetEncXW (aTouchEnKeyName, aTouchEnKeyInputName, aResult, callback); + } else { + callback (aResult); + } + } + /*========================================================================= + * generateRandom callback function + =========================================================================*/ + _CB_generateRandom = function (result) + { + if (result) + aResult = result; + + if (aIsPreData == false) + { + if (aSetPreData.length > 0) { + aSetPreData += "$"; + } + aSetData = aSetPreData + aKeyType + "|" + aResult; + } + else + { + aSetData = aSetPreData; + } + + // 4. set property + __SANDBOX.upInterface().setSecureInput (aSetData, _CB_setSecureInput_setData); + } + /*========================================================================= + * getSecureInput callback function + =========================================================================*/ + _CB_getSecureInput = function (result) + { + if (result) { + aPreSessionArray = result.split("$"); + for (var aIter = 0; aIter < aPreSessionArray.length; aIter++) { + aPreDataArray = aPreSessionArray[aIter].split("|"); + if (aPreDataArray[0] == String(aKeyType)) { + aIsPreData = true; + if (aPreDataArray.length > 1) + aResult = aPreDataArray[1]; + } + if (aIter > 0) { + aSetPreData += "$"; + } + aSetPreData += aPreSessionArray[aIter]; + } + } + + return _CB_checkPreData (); + } + /*========================================================================= + * check PreData function + =========================================================================*/ + _CB_checkPreData = function () { + // 3. generate sessionid + if (aIsPreData == false) { + if (aKeyType == XW_SECUREINPUT_TRANSKEY) { + aResult = _GenKeyRef(10); + } else if (aKeyType == XW_SECUREINPUT_TOUCHENKEY) { + __SANDBOX.upInterface().generateRandom(16, 0, _CB_generateRandom); + return; + } + else if (aKeyType == XW_SECUREINPUT_OPENKEYBOARD) { + var aPort = ""; + if (window.location.port == "") { + if (window.location.protocol == "https:") aPort = "443"; + else aPort = "80"; + } else { + aPort = window.location.port; + } + aResult = window.location.hostname + "|" + + openkeyboard.url + + ((openkeyboard.url.charAt(openkeyboard.url.length - 1) == '/') ? "" : "/") + + "make.jsp" + "|" + + aPort + "|" + + openkeyboard.jsessionId; + } else if (aKeyType == XW_SECUREINPUT_KDEFENSE) { + aResult = site_noptionEx; + } else if (aKeyType == XW_SECUREINPUT_XECUREKEYPAD) { + __SANDBOX.upInterface().generateRandom(16, 0, _CB_generateRandom); + return; + } else if (aKeyType == XW_SECUREINPUT_TOUCHENNXKEY) { + __SANDBOX.upInterface().generateRandom(16, 0, _CB_generateRandom); + return; + } else if (aKeyType == XW_SECUREINPUT_KINGSKEY) { + __SANDBOX.upInterface().generateRandom(16, 0, _CB_generateRandom); + return; + } + } + else + { + aSetData = aSetPreData; + } + + _CB_generateRandom(); + } + /*=========================================================================*/ + + // 1. check input type + if (aTransKeyInputFlag && aTransKey.getHiddenData().length > 0) { + aKeyType = XW_SECUREINPUT_TRANSKEY; + } else if (aOpenkeyboardEnable && aOpenkeyboardElement.value.length > 0) { + aKeyType = XW_SECUREINPUT_OPENKEYBOARD; + } else if (aTouchEnKeyEnable && document[aTouchEnKeyName][aTouchEnKeyInputName].value.length > 0) { + aKeyType = XW_SECUREINPUT_TOUCHENKEY; + } else if (aKDefenseEnable && kdfCertGetlenght(aOriInput.form.name + "." + aOriInput.name, aOriInput.type) > 0) { + aKeyType = XW_SECUREINPUT_KDEFENSE; + } else if (aVKeypadEnable) { + aKeyType = XW_SECUREINPUT_VKEYPAD; + } else if (aIncaNOSv10KeypadEnable && npVCtrl.isKeypadUse(aOriInput.name)) { + aKeyType = XW_SECUREINPUT_INCAKEYPAD; + } else if (aXecureKeyPadEnable && aXKModule.get_Vinput().length > 0) { + aKeyType = XW_SECUREINPUT_XECUREKEYPAD; + } else if (aXecureKeyPadHTML5Enable && aXKHTML5Module.get_Vinput().length > 0) { + aKeyType = XW_SECUREINPUT_XECUREKEYPADHTML5; + } else if (aXecureKeyPadE2EEnable && aXKHTML5Module.get_sessionInfo().input && aXKHTML5Module.get_sessionInfo().input.length > 0) { + aKeyType = XW_SECUREINPUT_XECUREKEYPADE2E; + } else if (aKeyCryptHTML5Enable) { + aKeyType = XW_SECUREINPUT_KEYCRYPT_HTML5; + } else if (aIncaNOSv10Enable) { + if(aInputType == "lite") + { + aKeyType = XW_SECUREINPUT_INCAKEYPAD; + } + else + { + aKeyType = XW_SECUREINPUT_KEYCRYPT_HTML5; + } + + } else if (aASTxEnable) { + aKeyType = XW_SECUREINPUT_ASTX; + } else if (aTouchEnnxKeyEnable) { + aKeyType = XW_SECUREINPUT_TOUCHENNXKEY; + } else if (aKOSKeyEnable) { + aKeyType = XW_SECUREINPUT_KINGSKEY; + } else if (aEzKeyTecEnable) { + aKeyType = XW_SECUREINPUT_EZKEYTEC; + } else { + aKeyType = XW_SECUREINPUT_NATIVEINPUT; + } + + // 2. check option (undefined,0: new or reset, 1:old set, 2:update) + if (aOption > 0) { + __SANDBOX.upInterface().getSecureInput (_CB_getSecureInput); + } + else + { + _CB_setXecureKeyPad = function () + { + _CB_checkPreData (); + } + _CB_setSecureInput = function () + { + __SANDBOX.upInterface().setXecureKeyPad ("", _CB_setXecureKeyPad); + } + _CB_setTransKey = function () + { + __SANDBOX.upInterface().setSecureInput ("", _CB_setSecureInput); + } + __SANDBOX.upInterface().setTransKey ("", _CB_setTransKey); + + return aResult; + } + }, + getValue : function (aSessionID) { + var aType = 0; + var aLen = 0; + var aResult = ""; + var aKOSSessionKey=""; + + if (__SANDBOX.CachedCertificateInfo && __SANDBOX.CachedCertificateInfo.password) { + aType = XW_SECUREINPUT_NATIVEINPUT; + aResult = __SANDBOX.CachedCertificateInfo.password; + } else if (aTransKey != null && aTransKey.getHiddenData().length > 0) { + aType = XW_SECUREINPUT_TRANSKEY; + aResult = aTransKey.getCipherData (aSessionID); + aTransKeyInputFlag = false; + } else if (aOpenkeyboardEnable && aOpenkeyboardElement.value.length > 0) { + aType = XW_SECUREINPUT_OPENKEYBOARD; + aResult = aOriInput.name + "|" + aOpenkeyboardElement.value; + } else if (aVKeypadEnable) { + aType = XW_SECUREINPUT_VKEYPAD; + aResult = npKpd.decode( npKpdType, aOriInput.form.name, {inputs:aOriInput.name}) + } else if (aIncaNOSv10KeypadEnable && npVCtrl.isKeypadUse(aOriInput.name)) { + aType = XW_SECUREINPUT_INCAKEYPAD; + aResult = npPfsCtrl.GetEncryptResult(aParentForm, aOriInput.name); + } else if (aTouchEnKeyEnable && document[aTouchEnKeyName][aTouchEnKeyInputName].value.length > 0) { + aType = XW_SECUREINPUT_TOUCHENKEY; + aResult = aTouchEnKeyObj.GetEncData(aSessionID, aTouchEnKeyName, aTouchEnKeyInputName); + } else if (aXecureKeyPadEnable && aXKModule.get_Vinput().length > 0) { + aType = XW_SECUREINPUT_XECUREKEYPAD; + aResult = aXKModule.sessionID + "|" + aXKModule.get_input(); + aXKModule.clear (); + } else if (aXecureKeyPadHTML5Enable && aXKHTML5Module.get_Vinput().length > 0) { + aType = XW_SECUREINPUT_XECUREKEYPADHTML5; + return {type: aType, keypad: aXKHTML5Module}; + } else if (aXecureKeyPadE2EEnable && aXKHTML5Module.get_sessionInfo().input && aXKHTML5Module.get_sessionInfo().input.length > 0) { + aType = XW_SECUREINPUT_XECUREKEYPADE2E; + var aXKInfo = aXKHTML5Module.get_sessionInfo(); + aResult = aXKInfo.sessionId + "|" + aXKInfo.secToken + "|" + aXKInfo.input; + } else if (typeof aos_isrunning != "undefined" && aos_isrunning('40')) { + aType = XW_SECUREINPUT_NATIVEINPUT; + aResult = aos_get_text2 (aOriInput); + } else if (aKDefenseEnable && (aLen = kdfCertGetlenght(aOriInput.form.name + "." + aOriInput.name, aOriInput.type)) > 0) { + aType = XW_SECUREINPUT_KDEFENSE; + aResult = aLen + "|" + kdfCertGetPwValue (aOriInput.form.name + "." + aOriInput.name, aOriInput.type); + } else if (aKeyCryptHTML5Enable) { + aType = XW_SECUREINPUT_KEYCRYPT_HTML5; + aResult = aOriInput.value.length + "$" + npPfsCtrl.GetReplaceField(aOriInput.form, aOriInput.name) + npPfsCtrl.GetResultField(aOriInput.form, aOriInput.name); + } else if (aIncaNOSv10Enable) { + if(aInputType == "lite") + { + aType = XW_SECUREINPUT_INCAKEYPAD; + aResult = npPfsCtrl.GetEncryptResult(aParentForm, aOriInput.name); + } + else + { + aType = XW_SECUREINPUT_KEYCRYPT_HTML5; + aResult = aOriInput.value.length + "$" + npPfsCtrl.GetReplaceField(aParentForm, aOriInput.name) + npPfsCtrl.GetResultField(aParentForm, aOriInput.name); + } + } else if (aASTxEnable) { + aType = XW_SECUREINPUT_ASTX; + //ASTx 1.2 + //aResult = aASTx_windowid + "$" + aASTx_formid + "$" + aASTx_inputid; + + //ASTx 1.3 + aResult = aASTx_windowid + "$" + aASTx_formid + "$" + $ASTX2.getE2EInputID(aOriInput); + } else if (aTouchEnnxKeyEnable) { + aType = XW_SECUREINPUT_TOUCHENNXKEY; + aResult = aSessionID; + } else if (aKOSKeyEnable && ( (aKOSSessionKey = KOS.getInputSessionKey(aOriInput)) !=null || (aKOSSessionKey = KOS.getInputSessionKey(aOriInput)) !="" ) ) { + aType = XW_SECUREINPUT_KINGSKEY; + aResult = KOS.getInputSessionKey(aOriInput)+ "|" +KOS.getProtectedValue(aOriInput); + console.log("AnySign_input_name:" + aOriInput.name); + console.log("KOS_result:"+aResult); + } else if (aEzKeyTecEnable) { + aType = XW_SECUREINPUT_EZKEYTEC; + aResult = aEzKeyTecInputData; + } else if (!__SANDBOX.allowNormalInput) { + aType = XW_SECUREINPUT_NATIVEINPUT; + return ""; + } else { + aType = XW_SECUREINPUT_NATIVEINPUT; + aResult = aOriInput.value; + } + + if (aResult != null && typeof(aResult) == "string" && aResult.length > 0) { + return aType + "$" + aResult; + } else { + return ""; + } + }, + clear : function () { + if (aTransKeyEnable && document.getElementById(aTransKeyInputID)) { + aTransKey.clear(); + document.getElementById(aTransKeyInputID).value = ""; + } else if (aOpenkeyboardEnable && aOpenkeyboardElement.value.length > 0) { + aOpenkeyboardElement.value = ""; + aOriInput.value = ""; + } else if (aVKeypadEnable) { + aOriInput.value = ""; + npKpd.cls(aOriInput.name, aOriInput.form.name); + } else if (aTouchEnKeyEnable) { + document[aTouchEnKeyName][aTouchEnKeyInputName].value = ""; + } else if (aASTxEnable) { + //ASTx 1.2 + //astxsdk_cleartext(aOriInput); + + //ASTx 1.3 + $ASTX2.clearE2EText(aOriInput); + } else if (aIncaNOSv10KeypadEnable && npVCtrl.isKeypadUse(aOriInput.name)) { + aOriInput.value = ""; + npVCtrl.resetKeypad(aOriInput.name); + } else if (aIncaNOSv10Enable) { + aOriInput.value = ""; + } else if (aEzKeyTecEnable) { + aOriInput.value = ""; + } else if (aXecureKeyPadEnable) { + aXKModule.clear(); + aXKModule.close(); + } else if (aXecureKeyPadHTML5Enable || aXecureKeyPadE2EEnable) { + aXKHTML5Module.clear(); + aXKHTML5Module.close(); + } else { + setTimeout (function () { aOriInput.value = ""; }, 0); //for AOS + } + }, + getElement : function() { + return aOriInput; + }, + onEnterKeyPress : function(aTarget) { + var aInputElement; + + if (aTouchEnKeyEnable) { + aInputElement = document[aTouchEnKeyName][aTouchEnKeyInputName]; + } else { + aInputElement = aOriInput; + } + + aInputElement.onkeypress = function(e) { + if(!e) + e = event; + var aKeyCode = e.which || e.keyCode, + aDispatcher; + + // K-Defense 추가 필요 (플러그인) + //console.log (aKeyCode); + if (aKeyCode == 13) { + //2013.02.15, AI-065, added + if (AnySign.mDivInsertOption == true) { + return false; + } + + aTarget.focus(); + + if (aTarget.dispatchEvent) { + var evt = document.createEvent("HTMLEvents"); + evt.initEvent("click", true, true); + aDispatcher = function () { + //20130325 ldg ie9 enter key can one touch modify + //if (__SANDBOX.isIE () > 0) + if (__SANDBOX.isIE () < 9) + { + return; + } + + aTarget.dispatchEvent(evt); + }; + } + else { + aDispatcher = function () { + aTarget.fireEvent("onclick"); + }; + } + + setTimeout(aDispatcher, 0); // for AOS + + return false; + } + } + }, + getLength : function() { + var aResult = 0; + var aTarget; + if (aTransKeyEnable && document.getElementById(aTransKeyInputID)) { + aTarget = document.getElementById(aTransKeyInputID); + } else if (aTouchEnKeyEnable) { + aTarget = document[aTouchEnKeyName][aTouchEnKeyInputName]; + } else { + aTarget = aOriInput; + } + + if(aTarget || aTarget.value) + aResult = aTarget.value.length; + + return aResult; + }, + focus : function() { + if (aTouchEnKeyEnable) { + if (document[aTouchEnKeyName][aTouchEnKeyInputName].disabled != true) { + document[aTouchEnKeyName][aTouchEnKeyInputName].focus(); + return true; + } + } + else { + if(aOriInput.disabled != true) { + aOriInput.focus(); + return true; + } + } + + return false; + }, + refresh: function() { + //this.clear(); + if (aTransKeyEnable && document.getElementById(aTransKeyInputID)) { + // aTransKey.close(); + } else if (aOpenkeyboardEnable) { + openkeyboard.stop(); + } else if (aXecureKeyPadEnable) { + var xkLayer = document.getElementById("xk-dialog"); + if (xkLayer) + document.body.removeChild(xkLayer); + } + if (aTouchEnKeyEnable) + { + if (navigator.appName == 'Microsoft Internet Explorer' || navigator.userAgent.match('Trident/7.0') || navigator.userAgent.match('MSIE')) + { + if(aTouchEnKeyInputName == 'verifyhsm_tek_input1'||aTouchEnKeyInputName =='certselect_tek_input1' || aTouchEnKeyInputName =='inputpasswd_tek_input1' || aTouchEnKeyInputName == 'certselectwide_tek_input1') + { + setTimeout(function(){TouchEnKey_EnqueueList(aTouchEnKeyName,aTouchEnKeyInputName);}, 0); + } + else if(aTouchEnKeyInputName =='savepasswd_tek_input1') + { + setTimeout(function(){TouchEnkey_EnqueueList_frm(aTouchEnKeyName);}, 0); + } + else + { + setTimeout(function(){document.getElementById("TouchEnKey").ReScanDocument();}, 0); + } + } + else + { //multi browser + setTimeout(function(){TouchEnKey_ApplySecurity();}, 0); + } + } else if (aKDefenseEnable) { + setTimeout(function(){KPluginEventInit();}, 0); + } else if (aTouchEnnxKeyEnable) { + if(aTouchEnKeyInputName == 'verifyhsm_tek_input1'||aTouchEnKeyInputName =='certselect_tek_input1' ||aTouchEnKeyInputName =='certselect_lite_input1' ||aTouchEnKeyInputName =='certselectwide_lite_input1' || aTouchEnKeyInputName =='inputpasswd_tek_input1' || aTouchEnKeyInputName == 'certselectwide_tek_input1') + { + setTimeout(function(){TK_EnqueueList(aTouchEnKeyName,aTouchEnKeyInputName);}, 0); + } + else if(aTouchEnKeyInputName =='savepasswd_tek_input1') + { + setTimeout(function(){TK_EnqueueList_frm(aTouchEnKeyName);}, 0); + } + else + { + setTimeout(function(){TK_Rescan();}, 0); + } + } + }, + enable: function(aEnable) { + if(aOriInput.disabled != true) + { + orgbk = aOriInput.style.backgroundColor; + } + aOriInput.disabled = !aEnable; + if(aEnable) + { + if(orgbk == "") + orgbk = '#FFFFFF'; + aOriInput.style.backgroundColor = orgbk; + } + else + aOriInput.style.backgroundColor ='#EEEEEE'; + if (aTransKeyEnable && aTransKeyCheckbox !=null && typeof(aTransKeyCheckbox) != "undefined") { + aTransKeyCheckbox.style.display = (aEnable == true ? "" : "none"); + } else if (aOpenkeyboardEnable && aOpenkeyboardCheckbox !=null && typeof(aOpenkeyboardCheckbox) != "undefined") { + if (aEnable) openkeyboard.spanEnable(); + else openkeyboard.spanDisable(); + } + }, + finish: function() { + npPfsStartup(document.form, false, true, false, false, "npkencrypt", "Off"); + } + } + } + + // Create Dynamic Filed + var dynamicIndex = 1; + function CreateDynamicFiled() { + var form = aOriInput.form.name; + var name = aOriInput.name; + + // Regist Dynamic Field + npPfsCtrl.RegistDynamicField(form, name); + dynamicIndex++; + } + + function __setAfterAction (aCallbackFunc, aCallbackParam) { + if (AnySign.mAnySignEnable) { + var _CB_external = function (aResult) { + if (aResult == undefined || aResult == 0) { + AnySign.mExtensionSetting.mExternalCallback.result = 0; + aCallbackFunc(aCallbackParam); + } else { + // 외부 함수 실패 (키보드 보안 설치 체크 등) + } + } + + var _Func_external = function (aResult) { + AnySign.mExtensionSetting.mInstallCheck_Level = 0; + if (AnySign.mExtensionSetting.mExternalCallback.func && + AnySign.mExtensionSetting.mExternalCallback.result != 0) + AnySign.mExtensionSetting.mExternalCallback.func(_CB_external); + else + _CB_external(0); + } + + if (!AnySign.mAnySignLoad) { + // StartAnySign 연속 호출 방지 + if (AnySign.mExtensionSetting.mInstallCheck_State == "ANYSIGN4PC_NEED_INSTALL" || AnySign.mExtensionSetting.mInstallCheck_State == "ANYSIGN4PC_NEED_UPDATE") { + var selectResult; + if (typeof AnySign.mLanguage === 'string' && AnySign.mLanguage.toLowerCase() == "ko-kr") + selectResult = confirm(ANYSIGN4PC_INSTALL_MSG); + else + selectResult = confirm(ANYSIGN4PC_INSTALL_MSG_en); + if (selectResult) { + location.href = AnySign.mPlatform.aInstallPage; + } else { + return; + } + } + + AnySign.mExtensionSetting.mInstallCheck_Level = 1; + AnySign.mExtensionSetting.mLoadCallback.func = _Func_external; + AnySign.mExtensionSetting.mLoadCallback.param = ""; + + AnySign.StartAnySign(); + } else { + _Func_external(); + } + } else { + aCallbackFunc (aCallbackParam); + } + } + + function __certSelectDialog (aDialogParam) + { + + var aModule; + var aDialog; + + var aXgateAddress; + var aCAList; + var aCertSerial; + var aCertLocation; + var aPlain; + var aFileInfo; + var aFileHash; + var aOption; + var aForm; + var aData; + var aCert; + var aDescription; + var aLimitTrial, aKeywordTryLimit; + var aHTMLData; + var aCert; + var aUserCallback; + var aErrCallback; + var aMediaID; + var aSubjectDN; + var aCompleteCallback; + var aShowSavePasswdDialog; + var aJobCode; + var aReason; + var aId_num; + var aPEMCert; + + if (aDialogParam.args.userCallback == undefined) + { + alert("user callback error"); + } + + if (aDialogParam.args.errCallback == undefined) + { + aDialogParam.args.errCallback = gErrCallback_common; + } + + aXgateAddress = aDialogParam.args.xgateAddress; + aCAList = aDialogParam.args.caList; + aCertSerial = aDialogParam.args.certSerial; + aCertLocation = aDialogParam.args.certLocation; + aPlain = aDialogParam.args.plain; + aFileInfo = aDialogParam.args.fileInfo; + aFileHash = aDialogParam.args.fileHash; + aInFilePath = aDialogParam.args.inFilePath; + aOutFilePath = aDialogParam.args.outFilePath; + aOption = aDialogParam.args.option; + aForm = aDialogParam.args.form; + aData = aDialogParam.args.data; + aCert = aDialogParam.args.cert; + aDescription = aDialogParam.args.description; + aKeywordTryLimit = aDialogParam.args.keywordTryLimit; + aUserCallback = aDialogParam.args.userCallback; + aErrCallback = aDialogParam.args.errCallback; + aMediaID = aDialogParam.args.mediaID; + aSubjectDN = aDialogParam.args.subjectDN; // TODO Delete + aIssuerRDN = aDialogParam.args.issuerRDN; + aCertSerial = aDialogParam.args.certSerial; + aJobCode = aDialogParam.args.aJobCode; + aReason = aDialogParam.args.aReason; + aCompleteCallback = aDialogParam.args.completeCallback; + aShowSavePasswdDialog = aDialogParam.args.showSavePasswdDialog; + aMultiSignID = aDialogParam.args.multiSignID; + aMultiSignTable = aDialogParam.args.multiSignTable; + aId_num = aDialogParam.args.vid; + aFuncname = aDialogParam.args.funcname; + + function onconfirm_common (aResult) + { + if (aResult.dialog) + aResult.dialog.dispose (); + aDialog.dispose (); + aUserCallback(aResult); + } + + + function onconfirm_sign (aSelectResult) + { + var aSignedData = ""; + var aMediaType; + + aMediaType = Math.floor(parseInt(aSelectResult.mediaID, 10) / 100) * 100; + + if (aMediaType == XW_CERT_LOCATION_WEBPAGE) + { + var aResult = {}; + aResult.subjectDn = aSelectResult.subjectRDN; + aResult.issuerDn = aSelectResult.issuerRDN; + aResult.serial = aSelectResult.certSerial; + + var aInput = aSelectResult.passwd.split("$"); + if (aInput.length == 2) { + if (parseInt(aInput[0]) == XW_SECUREINPUT_XECUREKEYPADE2E) { + var aKeypadInput = aInput[1].split("|"); + aResult.keypadType = "XECUREKEYPAD"; + aResult.keypadSessionId = aKeypadInput[0]; + aResult.keypadSessionToken = aKeypadInput[1]; + aResult.pwd = aKeypadInput[2]; + } else { + aResult.pwd = aInput[1]; + } + } + + if (!AnySign.mDivInsertOption) { + aDialog.dispose (); + } + aUserCallback(aResult); + return; + } + + if (aSelectResult.passwd == "" && aMediaType != XW_CERT_LOCATION_PKCS11 && aMediaType != XW_CERT_LOCATION_MPHONE && aMediaType != XW_CERT_LOCATION_SECUREDISK) + { + alert("Please enter the password that required to sign the certificate."); + return; + } + + if (aSelectResult.passwdResult == -3) + { + if (!AnySign.mDivInsertOption) { + aDialog.dispose (); + } + return; + } + + if (aFuncname == "SignFileInfo" || + aFuncname == "SignFileInfoWithSerial" || + aFuncname == "SignFileInfoWithVID_Serial") + { + _getCertTree (); + } + else + { + _sign (); + } + + var aFileInfoData = ""; + function _getCertTree() { + var aHashValue = ""; + + _getCertTreeCallback = function (result) + { + if (__SANDBOX.isFailed (result, aErrCallback)) + { + _final(); + _close(); + return; + } + + aHashValue = _getSearchHashValue(result, aFileHash); + if (aHashValue == "") + { + _errCallback = function () + { + __SANDBOX.isFailed (aHashValue, aErrCallback); + _final(); + _close(); + } + + __SANDBOX.upInterface().setError(XW_ERROR_PLUGINS_INPUTNULL, _errCallback); + return; + } + + aFileInfoData = aFileInfo + "|" + aHashValue; + _sign(); + } + + __SANDBOX.upInterface().getCertTree (aSelectResult.mediaID, + 2, + 24, + 0, + aSelectResult.issuerRDN, + aSelectResult.certSerial, + _getCertTreeCallback); + } + + function _sign() { + gStartGuideDialog(); + + /*****************************************************************************/ + __resultCheckFun = function (aResult) + { + gEndGuideDialog(); + + if (aSelectResult.mediaID == XW_CERT_LOCATION_MPHONE + 1) { + aErrCallback = null; + } + + if (aResult == "") { + + var aErrorObject = __SANDBOX.upInterface().setErrCodeAndMsg(); + + if (aErrorObject.code == XW_ERROR_SIGN_DUPLICATE_CERT) { + aSelectResult.callback(); + alert (aErrorObject.msg.replace(/\\n/g, '\r\n')); + if (aSelectResult.dialog) + aSelectResult.dialog.dispose (); + } else if (aErrorObject.code != "0") { + _close(); + + if (aErrCallback) { + aErrCallback (aErrorObject); + } + } + + _final(); + } + else + { + _close(); + + var _setCertLocation_callback = function () { + if (aOption & XW_OPTION_PKCS1_ADD) { // jkpark - VID 미지원 + aSignedData = aResult; + _getCertPEM(aSignedData); + } else if (aOption & XW_FVIEW_CREATE_VID) { + _inputVid(aResult); + } else { + gPlainFilePath = ""; + gSignedFilePath = ""; + _done(aResult); + } + } + + _setCertLocation (aXgateAddress, aSelectResult.mediaID, aOption, _setCertLocation_callback); + } + } + /*****************************************************************************/ + + if (aFuncname == "SignFileInfo" || + aFuncname == "SignFileInfoWithSerial" || + aFuncname == "SignFileInfoWithVID_Serial") + { + __SANDBOX.upInterface().signFileInfo (aXgateAddress, + aSelectResult.mediaID, + aSelectResult.issuerRDN, + aSelectResult.certSerial, + aSelectResult.passwd, + aFileInfoData, + aOption, + 0, + __resultCheckFun); + } + else if (aFuncname == "SignFileEx" || + aFuncname == "SignFileExWithVID") + { + __SANDBOX.upInterface().signFileEx (aXgateAddress, + aInFilePath, + aOutFilePath, + (aSelectResult.mediaID == undefined) ? "" : aSelectResult.mediaID, + (aSelectResult.issuerRDN == undefined) ? "" : aSelectResult.issuerRDN, + (aSelectResult.certSerial == undefined) ? "" : aSelectResult.certSerial, + (aSelectResult.withPFX == true) ? aSelectResult.pfxPath : "", + (aMediaType == XW_CERT_LOCATION_PKCS11) ? aSelectResult.pin : aSelectResult.passwd, + aOption, + aDescription, + __resultCheckFun); + } + else // SignData + { + if (aFuncname == "SignDataAdd" || aFuncname =="SignDataAddWithVID_Serial") + { + if (aSelectResult.withPFX) + { + __SANDBOX.upInterface().signDataWithPFX (aPlain, + aSelectResult.pfxPath, + aSelectResult.passwd, + aOption, + 1, + __resultCheckFun); + } + else + { + __SANDBOX.upInterface().signDataAdd (aXgateAddress, + aSelectResult.mediaID, + aSelectResult.issuerRDN, + aSelectResult.certSerial, + aSelectResult.passwd, + aPlain, + aOption, + __resultCheckFun); + } + } + else + { + if (aSelectResult.withPFX) + { + __SANDBOX.upInterface().signDataWithPFX (aPlain, + aSelectResult.pfxPath, + aSelectResult.passwd, + aOption, + 0, + __resultCheckFun); + } + else + { + + __SANDBOX.upInterface().signDataCMS (aXgateAddress, + aSelectResult.mediaID, + aSelectResult.issuerRDN, + aSelectResult.certSerial, + aSelectResult.passwd, + aPlain, + aOption, + __resultCheckFun); + } + } + } + } + + function _inputVid(aResult) { + var aVid; + aSignedData = aResult; + + var _verifyvid = function() { + if( (aDialogParam.args.option & XW_FVIEW_CREATE_VID_FROM_WEB) || (aDialogParam.args.option & XW_FVIEW_CREATE_VID_NO_IDN) ) + { + if (aDialogParam.args.option & XW_FVIEW_CREATE_VID_NO_IDN) + { + aVid = ""; + } + else if (aDialogParam.args.funcname == "SignDataWithVID_Serial" || + aDialogParam.args.funcname == "SignDataAddWithVID_Serial" || + aDialogParam.args.funcname == "SignFileInfoWithVID_Serial" || + aDialogParam.args.funcname == "SignFileExWithVID") + { + aVid = aDialogParam.args.idn; + } + _setVid (aSignedData, aVid); + } + else + { + var guideDialog; + var aInputType = __SANDBOX.getInputType(aSelectResult.mediaID); + + var module = __SANDBOX.loadModule("verifyvid"); + //AnySign.SetUITarget (aDialog.getUITarget()); + var vidDialog = module({ + width: 350, + height: 100, + onconfirm: function(aResult) { _setVid(aSignedData, aResult); vidDialog.dispose(); }, + oncancel: function() { _final(); vidDialog.dispose(); }, + args: {inputType: aInputType} + }); + + vidDialog.show(); + } + } + + if (aMediaType == XW_CERT_LOCATION_ICCARD || aMediaType == XW_CERT_LOCATION_KEPCOICCARD) { + + _logoutTokenCallback = function () { + _input_iccard(); + } + + _loginTokenCallback = function (result) { + guideDialog.dispose (); + + if(result != 0) { + var aErrorObject = __SANDBOX.upInterface().setErrCodeAndMsg(); + alert(aErrorObject.msg.replace(/\\n/g, '\r\n')); + + __SANDBOX.upInterface().logoutStoreToken (aSelectResult.mediaID, _logoutTokenCallback); + } else { + _verifyvid(); + } + } + + _input_iccard = function () { + var aICCardType; + if (aMediaType == XW_CERT_LOCATION_KEPCOICCARD) + aICCardType = "kepco"; + else + aICCardType = "iccard"; + + var iccardModule = __SANDBOX.loadModule("iccard"); + var iccardDialog = iccardModule({ + type: aICCardType, + args: { }, + onconfirm: function (aPin) { + var guideModule; + guideModule = __SANDBOX.loadModule("guidewindow"); + guideDialog = guideModule({ + type: "request", + args: "", + onconfirm: "", + oncancel: function () {guideDialog.dispose();} + }); + + if (guideDialog) + guideDialog.show(); + + __SANDBOX.upInterface().loginStoreToken (aSelectResult.mediaID, aPin, 1, _loginTokenCallback); + + iccardDialog.dispose(); + }, + oncancel: function () { + _final(); + iccardDialog.dispose(); + } + }); + + iccardDialog.show(); + } + + _input_iccard(); + } else { + _verifyvid(); + } + } + + function _setVid (aResult, aVid) { + var guideModule, guideDialog = null; + + aSignedData = aResult; + + /******************************************************************************************/ + _envelopIdNumCallback = function (result) + { + if (guideDialog) + guideDialog.dispose (); + /* + if ( __SANDBOX.isFailed(result, aErrCallback) ) + { + _final(); + return; + } + */ + _done(aSignedData); + } + /******************************************************************************************/ + + + /******************************************************************************************/ + _setIdNumCallback = function (result) + { + if ( __SANDBOX.isFailed(result, aErrCallback) ) + { + _final(); + return; + } + + if (aSelectResult.withPFX) + { + __SANDBOX.upInterface().envelopIdNumWithPFX (aSelectResult.pfxPath, + aSelectResult.passwd, + aCert, + _envelopIdNumCallback); + } + else + { + __SANDBOX.upInterface().envelopIdNum (aXgateAddress, + null, + aSelectResult.mediaID, + aSelectResult.issuerRDN, + aSelectResult.certSerial, + aSelectResult.passwd, + aCert, + _envelopIdNumCallback); + } + } + /******************************************************************************************/ + + if (aFuncname == "SignFileExWithVID") + { + if (aMediaType == XW_CERT_LOCATION_ICCARD || aMediaType == XW_CERT_LOCATION_KEPCOICCARD || aMediaType == XW_CERT_LOCATION_PKCS11) + { + guideModule = __SANDBOX.loadModule("guidewindow"); + guideDialog = guideModule({ + type: "request", + args: "", + onconfirm: "", + oncancel: function () {guideDialog.dispose();} + }); + + if (guideDialog) + guideDialog.show(); + } + + __SANDBOX.upInterface().envelopIdNumEx (aXgateAddress, + (aSelectResult.mediaID == undefined) ? "" : aSelectResult.mediaID, + (aSelectResult.issuerRDN == undefined) ? "" : aSelectResult.issuerRDN, + (aSelectResult.certSerial == undefined) ? "" : aSelectResult.certSerial, + (aSelectResult.pfxPath == undefined) ? "" : aSelectResult.pfxPath, + (aMediaType == XW_CERT_LOCATION_PKCS11) ? aSelectResult.pin : aSelectResult.passwd, + aVid, + aCert, + 0, + _envelopIdNumCallback); + } + else + { + if (aMediaType == XW_CERT_LOCATION_ICCARD || aMediaType == XW_CERT_LOCATION_KEPCOICCARD) + { + guideModule = __SANDBOX.loadModule("guidewindow"); + guideDialog = guideModule({ + type: "request", + args: "", + onconfirm: "", + oncancel: function () {guideDialog.dispose();} + }); + + if (guideDialog) + guideDialog.show(); + } + + __SANDBOX.upInterface().setIdNum (aVid, _setIdNumCallback); + } + } + + function _done(aResult) { + if (aFuncname == "SignFileEx" || + aFuncname == "SignFileExWithVID") { + if (aOption & XW_OPTION_FCMS_CACHE_CERTINFO) { + __SANDBOX.clearCacheCert (); + __SANDBOX.cacheCertData.mediaID = aSelectResult.mediaID; + __SANDBOX.cacheCertData.issuerRDN = aSelectResult.issuerRDN; + __SANDBOX.cacheCertData.certSerial = aSelectResult.certSerial; + __SANDBOX.cacheCertData.pfxPath = (aSelectResult.withPFX == true) ? aSelectResult.pfxPath : ""; + __SANDBOX.cacheCertData.passwd = (aMediaType == XW_CERT_LOCATION_PKCS11) ? aSelectResult.pin : aSelectResult.passwd; + } + } + + if (aSelectResult.dialog) + aSelectResult.dialog.dispose (); + + if (!AnySign.mDivInsertOption) { + if (aDialog) + aDialog.dispose (); + } + + if (AnySign.mAnySignEnable) + __SANDBOX.extension.resetErrAndMsg (); + + var _done_logout = function () + { + aUserCallback (aResult); + } + + if (aMediaType == XW_CERT_LOCATION_ICCARD || aMediaType == XW_CERT_LOCATION_KEPCOICCARD) + { + __SANDBOX.upInterface().logoutStoreToken(aSelectResult.mediaID, _done_logout); + } + else if (aMediaType == XW_CERT_LOCATION_PKCS11) + { + if ((aSelectResult.smartCert == true) && (aOption & XW_OPTION_CACHE_SMARTCERT)) { + __SANDBOX.cacheSmartCert = aSelectResult.smartCert; + _done_logout(); + } else { + __SANDBOX.upInterface().finalizePKCS11FromIndex (aSelectResult.mediaID, _done_logout); + } + } + else if (aMediaType == XW_CERT_LOCATION_SECUREDISK) + { + __SANDBOX.upInterface().finalizeSecureDiskFromName (aSelectResult.providerName, _done_logout); + } + else + { + aUserCallback (aResult); + } + } + + function _final() { + var _final_done = function () {} + + if (aMediaType == XW_CERT_LOCATION_ICCARD || aMediaType == XW_CERT_LOCATION_KEPCOICCARD) { + __SANDBOX.upInterface().logoutStoreToken(aSelectResult.mediaID, _final_done); + } + + if (aMediaType == XW_CERT_LOCATION_PKCS11) { + __SANDBOX.upInterface().finalizePKCS11FromIndex (aSelectResult.mediaID, _final_done); + } + + if (aMediaType == XW_CERT_LOCATION_SECUREDISK) { + __SANDBOX.upInterface().finalizeSecureDiskFromName (aSelectResult.providerName, _final_done); + } + } + + function _close() { + if (aSelectResult.dialog) + aSelectResult.dialog.dispose (); + + if (!AnySign.mDivInsertOption) { + if (aDialog) + aDialog.dispose (); + } + } + + /******************************************************************************** + * function add, 2016.2.19, ymkim + *******************************************************************************/ + function _getCertPEM(aSignedData) { + var _getCertPEMCallBack = function (result) { + aSignedData = aSignedData + "|" + aSelectResult.subjectRDN + "|" + aSelectResult.certSerial + "|" + result; + + _done(aSignedData); + } + + __SANDBOX.upInterface().getCertPEM (aSelectResult.mediaID, + aSelectResult.issuerRDN, + aSelectResult.certSerial, + 0, + _getCertPEMCallBack); + } + + } + + function onconfirm_filesign(aResult) + { + /******************************************************************************** + * signFile callback function + *******************************************************************************/ + var _signFile_callback = function () + { + var aErrorObject = __SANDBOX.upInterface().setErrCodeAndMsg(); + if (aErrorObject.code != 0) + { + aErrCallback (aErrorObject); + return; + } + + gPlainFilePath = ""; + gSignedFilePath = ""; + + var _final = function () { + aUserCallback (0); + if (!AnySign.mDivInsertOption) + aDialog.dispose (); + } + + if ((Math.floor(aResult.mediaID / 100) * 100) == XW_CERT_LOCATION_PKCS11) + __SANDBOX.upInterface().finalizePKCS11FromIndex (aResult.mediaID, _final); + else + _final (); + } + /*****************************************************************************/ + + if (aResult.mediaID == XW_CERT_LOCATION_MPHONE + 1) + { + alert("not supported media ID"); + return; + } + + __SANDBOX.upInterface().signFile (aXgateAddress, + aResult.mediaID, + aResult.issuerRDN, + aResult.certSerial, + aResult.passwd, + gPlainFilePath, + gSignedFilePath, + aOption, + _signFile_callback); + } + + function onconfirm_vid(aResult) + { + if (aResult.passwdResult == -3) + { + aDialog.dispose (); + return; + } + aDialogParam.args.mediaID = aResult.mediaID; + aDialogParam.args.issuerRDN = aResult.issuerRDN; + aDialogParam.args.certSerial = aResult.certSerial; + aDialogParam.args.passwd = aResult.passwd; + if(aResult.withPFX) + { + aDialogParam.args.withPFX = aResult.withPFX; + aDialogParam.args.pfxPath = aResult.pfxPath; + } + + if( (aDialogParam.args.option & XW_FVIEW_CREATE_VID_FROM_WEB) || (aDialogParam.args.option & XW_FVIEW_CREATE_VID_NO_IDN) ) + { + if (aDialogParam.args.option & XW_FVIEW_CREATE_VID_NO_IDN) + { + aDialogParam.args.vid = ""; + } + else + { + aDialogParam.args.vid = aDialogParam.args.idn; + } + aDialogParam.args.completeCallback(aDialogParam); + } + else + { + var aInputType = __SANDBOX.getInputType(aDialogParam.args.mediaID); + + var module = __SANDBOX.loadModule("verifyvid"); + AnySign.SetUITarget (aDialog.getUITarget()); + var dialog = module({ + width: 350, + height: 100, + onconfirm: function(aResult) { + aDialogParam.args.vid = aResult; + aDialogParam.args.completeCallback(aDialogParam); + dialog.dispose(); + }, + oncancel: function() { dialog.dispose(); }, + args: {inputType: aInputType} + }); + dialog.show(); + } + aDialog.dispose(); + } + + function onconfirm_multi (aSelectResult) + { + var aCount = 1; + var aSignedData; + var aCertInfo = ""; + var aMediaType = Math.floor(parseInt(aSelectResult.mediaID, 10) / 100) * 100; + var aAddOption = false; + if (aMediaType == XW_CERT_LOCATION_YESSIGNM && !(aOption & 4)) + { + aOption = aOption + 4; + aAddOption = true; + } + + if (aSelectResult.passwd == "" && aMediaType != XW_CERT_LOCATION_PKCS11 && aMediaType != XW_CERT_LOCATION_MPHONE && aMediaType != XW_CERT_LOCATION_SECUREDISK) + { + alert("Please enter the password that required to sign the certificate."); + return; + } + + if (aSelectResult.passwdResult == -3) + { + if (!AnySign.mDivInsertOption) { + aDialog.dispose (); + } + return; + } + + + var _getCertTree = function() + { + __SANDBOX.upInterface().getCertTree (aSelectResult.mediaID, + 2, + 24, + 0, + aSelectResult.issuerRDN, + aSelectResult.certSerial, + _getCertTreeCallback); + } + + var _getCertTreeCallback = function(result) + { + if (__SANDBOX.isFailed (result, aErrCallback)) + { + _close (); + return; + } + + aCertInfo = result; + + _signDataCMS (); + } + + var _close = function () + { + if (aSelectResult.dialog) + aSelectResult.dialog.dispose (); + + if (!AnySign.mDivInsertOption) + aDialog.dispose (); + } + + var _final = function (aCallback) { + var _final_done = function () { + if (aCallback) + aCallback(); + } + + if (aMediaType == XW_CERT_LOCATION_ICCARD || aMediaType == XW_CERT_LOCATION_KEPCOICCARD) { + __SANDBOX.upInterface().logoutStoreToken(aSelectResult.mediaID, _final_done); + } else if (aMediaType == XW_CERT_LOCATION_PKCS11) { + __SANDBOX.upInterface().finalizePKCS11FromIndex (aSelectResult.mediaID, _final_done); + } else if (aMediaType == XW_CERT_LOCATION_SECUREDISK) { + __SANDBOX.upInterface().finalizeSecureDiskFromName (aSelectResult.providerName, _final_done); + } else { + _final_done (); + } + } + + var _signDataCMS_callback = function (signed) + { + if (__SANDBOX.isFailed(signed, aErrCallback)) + { + _final (); + _close (); + return; + } + + aMultiSignTable.setSignedData(aMultiSignID, signed); + + if (aCount == aMultiSignTable.sizeOfPlain(aMultiSignID) || aSelectResult.mediaID == XW_CERT_LOCATION_MPHONE + 1) + { + _close (); + + var _userCallback = function () { + if (aSelectResult.mediaID == XW_CERT_LOCATION_MPHONE + 1) + aUserCallback (1); + else + aUserCallback (0); + } + + var _setCertLocation_callback = function () { + + if (aOption & XW_FVIEW_CREATE_VID) { + _inputVid(); + } else { + _final (_userCallback); + } + } + + _setCertLocation (aXgateAddress, aSelectResult.mediaID, aOption, _setCertLocation_callback); + } + else + { + aCount++; + if (aMediaType == XW_CERT_LOCATION_PKCS11 && aSelectResult.smartCert != true) + _final (_loginPKCS11); + else if (aMediaType == XW_CERT_LOCATION_SECUREDISK) + _final (_loginSecureDisk); + else + _signDataCMS (); + } + } + + var _loginPKCS11 = function () // 오류 처리 없음 + { + __SANDBOX.upInterface().loginPKCS11FromIndex (aSelectResult.mediaID, + aSelectResult.pin, + _signDataCMS); + } + + var _loginSecureDisk = function () + { + __SANDBOX.upInterface().loginSecureDiskFromIndex (aSelectResult.mediaID, + aSelectResult.pin, + aSelectResult.subjectRDN, + aSelectResult.issuerRDN, + aSelectResult.certSerial, + 0, + _signDataCMS); + } + + var _signDataCMS = function () + { + var aPlainMsg = ""; + if (aSelectResult.mediaID == XW_CERT_LOCATION_MPHONE + 1) + { + aOption = 67108864; + for (var i = 0; i < aMultiSignTable.sizeOfPlain(aMultiSignID); i++) + { + aPlainMsg += aMultiSignTable.getPlainData (aMultiSignID, i); + if (aMultiSignTable.getPlainData(aMultiSignID, i+1)) + aPlainMsg += "||"; + } + } + else + { + aPlainMsg = aMultiSignTable.getPlainData (aMultiSignID, aCount-1); + } + + if (aFuncname == "MultiSignFileInfo" || + aFuncname == "MultiSignFileInfoWithSerial" || + aFuncname == "MultiSignFileInfoWithVID_Serial") + { + var aFileInfoData = ""; + var aHashValue = ""; + + aFileHash = aMultiSignTable.getPlainData2 (aMultiSignID, aCount-1); + aHashValue = _getSearchHashValue(aCertInfo, aFileHash); + if (aHashValue == "") + { + _errCallback = function () + { + __SANDBOX.isFailed (aHashValue, aErrCallback); + _close (); + } + + __SANDBOX.upInterface().setError(XW_ERROR_PLUGINS_INPUTNULL, _errCallback); + return; + } + aFileInfoData = aPlainMsg + "|" + aHashValue; + + __SANDBOX.upInterface().signFileInfo (aXgateAddress, + aSelectResult.mediaID, + aSelectResult.issuerRDN, + aSelectResult.certSerial, + aSelectResult.passwd, + aFileInfoData, + aOption, + 0, + _signDataCMS_callback); + } + else + { + if (aSelectResult.withPFX) + { + __SANDBOX.upInterface().signDataWithPFX (aPlainMsg, + aSelectResult.pfxPath, + aSelectResult.passwd, + aOption, + 0, + _signDataCMS_callback); + } + else + { + if (aCount == aMultiSignTable.sizeOfPlain(aMultiSignID) && aAddOption == true) + aOption = aOption - 4; + + __SANDBOX.upInterface().signDataCMS (aXgateAddress, + aSelectResult.mediaID, + aSelectResult.issuerRDN, + aSelectResult.certSerial, + aSelectResult.passwd, + aPlainMsg, + aOption, + _signDataCMS_callback); + } + } + } + + function _inputVid() { + var aVid; + + var _verifyvid = function() { + if( (aDialogParam.args.option & XW_FVIEW_CREATE_VID_FROM_WEB) || (aDialogParam.args.option & XW_FVIEW_CREATE_VID_NO_IDN) ) + { + if (aDialogParam.args.option & XW_FVIEW_CREATE_VID_NO_IDN) + { + aVid = ""; + } + else if (aDialogParam.args.funcname == "MultiSignExWithVID_Serial" || + aDialogParam.args.funcname == "MultiSignFileInfoWithVID_Serial") + { + aVid = aDialogParam.args.idn; + } + _setVid ( aVid); + } + else + { + var guideDialog; + var aInputType = __SANDBOX.getInputType(aSelectResult.mediaID); + + var module = __SANDBOX.loadModule("verifyvid"); + //AnySign.SetUITarget (aDialog.getUITarget()); + var vidDialog = module({ + width: 350, + height: 100, + onconfirm: function(aResult) { _setVid( aResult); vidDialog.dispose(); }, + oncancel: function() { _final(); vidDialog.dispose(); }, + args: {inputType: aInputType} + }); + + vidDialog.show(); + } + } + + if (aMediaType == XW_CERT_LOCATION_ICCARD || aMediaType == XW_CERT_LOCATION_KEPCOICCARD) { + + _logoutTokenCallback = function () { + _input_iccard(); + } + + _loginTokenCallback = function (result) { + guideDialog.dispose (); + + if(result != 0) { + var aErrorObject = __SANDBOX.upInterface().setErrCodeAndMsg(); + alert(aErrorObject.msg.replace(/\\n/g, '\r\n')); + + __SANDBOX.upInterface().logoutStoreToken (aSelectResult.mediaID, _logoutTokenCallback); + } else { + _verifyvid(); + } + } + + _input_iccard = function () { + var aICCardType; + if (aMediaType == XW_CERT_LOCATION_KEPCOICCARD) + aICCardType = "kepco"; + else + aICCardType = "iccard"; + + var iccardModule = __SANDBOX.loadModule("iccard"); + var iccardDialog = iccardModule({ + type: aICCardType, + args: { }, + onconfirm: function (aPin) { + var guideModule; + guideModule = __SANDBOX.loadModule("guidewindow"); + guideDialog = guideModule({ + type: "request", + args: "", + onconfirm: "", + oncancel: function () {guideDialog.dispose();} + }); + + if (guideDialog) + guideDialog.show(); + + __SANDBOX.upInterface().loginStoreToken (aSelectResult.mediaID, aPin, 1, _loginTokenCallback); + + iccardDialog.dispose(); + }, + oncancel: function () { + _final(); + iccardDialog.dispose(); + } + }); + + iccardDialog.show(); + } + + _input_iccard(); + } else { + _verifyvid(); + } + } + + function _setVid ( aVid) { + var guideModule, guideDialog = null; + + /******************************************************************************************/ + _envelopIdNumCallback = function (result) + { + if (guideDialog) + guideDialog.dispose (); + /* + if ( __SANDBOX.isFailed(result, aErrCallback) ) + { + return; + } + */ + var _userCallback = function () { + if (aSelectResult.mediaID == XW_CERT_LOCATION_MPHONE + 1) + aUserCallback (1); + else + aUserCallback (0); + } + + _final (_userCallback); + } + /******************************************************************************************/ + + + /******************************************************************************************/ + _setIdNumCallback = function (result) + { + if ( __SANDBOX.isFailed(result, aErrCallback) ) + { + _final(); + return; + } + + if (aSelectResult.withPFX) + { + __SANDBOX.upInterface().envelopIdNumWithPFX (aSelectResult.pfxPath, + aSelectResult.passwd, + aCert, + _envelopIdNumCallback); + } + else + { + __SANDBOX.upInterface().envelopIdNum (aXgateAddress, + null, + aSelectResult.mediaID, + aSelectResult.issuerRDN, + aSelectResult.certSerial, + aSelectResult.passwd, + aCert, + _envelopIdNumCallback); + } + } + /******************************************************************************************/ + + { + if (aMediaType == XW_CERT_LOCATION_ICCARD || aMediaType == XW_CERT_LOCATION_KEPCOICCARD) + { + guideModule = __SANDBOX.loadModule("guidewindow"); + guideDialog = guideModule({ + type: "request", + args: "", + onconfirm: "", + oncancel: function () {guideDialog.dispose();} + }); + + if (guideDialog) + guideDialog.show(); + } + + __SANDBOX.upInterface().setIdNum (aVid, _setIdNumCallback); + } + } + + if (aFuncname == "MultiSignFileInfo" || + aFuncname == "MultiSignFileInfoWithSerial" || + aFuncname == "MultiSignFileInfoWithVID_Serial") + { + _getCertTree (); + } + else + { + _signDataCMS (); + } + } + + function onconfirm_multifilesign (aResult) + { + var aCount = 1, + aSignedFilePath, + aSignFilePath; + + if (aResult.passwdResult == -3) + { + aDialog.dispose(); + return; + } + + var _signFile_callback = function (signed) + { + var aErrorObject = __SANDBOX.upInterface().setErrCodeAndMsg(); + if (aErrorObject.code != 0) + { + aErrCallback (aErrorObject); + return; + } + + aMultiSignTable.setSignedData(aMultiSignID, aSignedFilePath); + + if (aCount == aMultiSignTable.sizeOfPlain(aMultiSignID)) + { + aUserCallback(0); + aDialog.dispose(); + } + else + { + aCount++; + _signFile (); + } + } + + var _signFile = function () + { + aSignedFilePath = aSignFilePath = aMultiSignTable.getPlainData (aMultiSignID, aCount-1); + aSignedFilePath += ".sig"; + + __SANDBOX.upInterface().signFile (aXgateAddress, + aResult.mediaID, + aResult.issuerRDN, + aResult.certSerial, + aResult.passwd, + aSignFilePath, + aSignedFilePath, + aOption, + _signFile_callback); + } + + _signFile (); + } + + function onconfirm_renew (aResult) + { + if (aResult.passwdResult == -3) + { + aDialog.dispose (); + return; + } + aDialogParam.args.mediaID = aResult.mediaID; + aDialogParam.args.providerName = aResult.providerName; + aDialogParam.args.oldPasswd = aResult.passwd; + aDialogParam.args.issuerRDN = aResult.issuerRDN; + aDialogParam.args.certSerial = aResult.certSerial; + aDialogParam.args.dialog = aResult.dialog; + + var aMediaType = Math.floor(parseInt(aResult.mediaID, 10) / 100) * 100; + if((aMediaType == XW_CERT_LOCATION_PKCS11 || aMediaType == XW_CERT_LOCATION_SECUREDISK) && AnySign.mShowRenewCertSaveLoc == false) { + aDialogParam.args.newPasswd = ""; + aDialogParam.args.completeCallback(aDialogParam); + } else { + AnySign.SetUITarget(aDialog.getUITarget()); + aDialogParam.args.showSavePasswdDialog(aDialogParam); + } + + aDialog.dispose (); + } + + function onconfirm_revoke (aResult) + { + if (aResult.passwdResult == -3) + { + aDialog.dispose (); + return; + } + + aDialogParam.args.mediaID = aResult.mediaID; + aDialogParam.args.providerName = aResult.providerName; + aDialogParam.args.issuerRDN = aResult.issuerRDN; + aDialogParam.args.certSerial = aResult.certSerial; + aDialogParam.args.oldPasswd = aResult.passwd; + aDialogParam.args.dialog = aResult.dialog; + + aDialogParam.args.completeCallback(aDialogParam); + aDialog.dispose (); + + } + + function oncancel_common () + { + aDialog.dispose (); + } + + function oncancel_sign () + { + var aErrorObject; + gTarget = aDialog.getUITarget(); + aDialog.dispose(); + } + + function oncancel_signfileex () + { + aDialog.dispose(); + aUserCallback(-1); // 추가 서명 시에 취소 시는 성공 처리 + } + + function oncancel_filesign () + { + aDialog.dispose (); + } + + function onconfirm_certPath (aSelectResult) + { + var aSignedData = ""; + _CB_getCertPath = function (aResult) + { + if (!__SANDBOX.isFailed (aResult, aErrCallback)) { + aDialog.dispose (); + aUserCallback (aResult, aSignedData); + } + else { + aDialog.dispose (); + } + } + + _CB_signDataCMS = function (aResult) + { + aSignedData = aResult; + + __SANDBOX.upInterface().getCertPath (aSelectResult.mediaID, + Number(2), + aSelectResult.issuerRDN, + aSelectResult.certSerial, + _CB_getCertPath); + } + + __SANDBOX.upInterface().signDataCMS (aXgateAddress, + aSelectResult.mediaID, + aSelectResult.issuerRDN, + aSelectResult.certSerial, + aSelectResult.passwd, + aPlain, + aOption, + _CB_signDataCMS); + } + + switch (aDialogParam.args.funcname) + { + case "SignFile": + aDialogParam.onconfirm = onconfirm_filesign; + aDialogParam.oncancel = oncancel_filesign; + break; + case "SignDataCMS": + case "SignDataAdd": + case "SignDataCMSWithSerial": + case "SignDataWithVID_Serial": + case "SignDataAddWithVID_Serial": + case "SignDataCMSWithHTMLEx": + case "SignDataCMSWithHTMLExAndSerial": + case "SignFileInfo": + case "SignFileInfoWithSerial": + case "SignFileInfoWithVID_Serial": + aDialogParam.onconfirm = onconfirm_sign; + aDialogParam.oncancel = oncancel_sign; + break; + case "SignFileEx": + case "SignFileExWithVID": + aDialogParam.onconfirm = onconfirm_sign; + aDialogParam.oncancel = oncancel_signfileex; + break; + case "MultiFileSign": + aDialogParam.onconfirm = onconfirm_multifilesign; + aDialogParam.oncancel = oncancel_sign; + break; + case "MultiSignEx": + case "MultiSignExWithSerial": + case "MultiSignExWithVID_Serial": + case "MultiSignFileInfo": + case "MultiSignFileInfoWithSerial": + case "MultiSignFileInfoWithVID_Serial": + aDialogParam.onconfirm = onconfirm_multi; + aDialogParam.oncancel = oncancel_sign; + break; + case "RenewCertificate": + aDialogParam.onconfirm = onconfirm_renew; + aDialogParam.oncancel = oncancel_common; + break; + case "RevokeCertificate": + aDialogParam.onconfirm = onconfirm_revoke; + aDialogParam.oncancel = oncancel_common; + break; + case "RequestCertificateEx": + break; + case "GetCertPath": + aDialogParam.onconfirm = onconfirm_certPath; + aDialogParam.oncancel = oncancel_common; + break; + default: + //case "EnvelopeDataWithCert": + //case "DeEnvelopeDataWithCert": + aDialogParam.onconfirm = onconfirm_common; + aDialogParam.oncancel = oncancel_common; + break; + } + + if (AnySign.mDivInsertOption == 1) { + aModule = loadModule ("certselectwide"); + } else { + aModule = loadModule ("certselect"); + } + + aDialog = aModule (aDialogParam); + if (aDialog) aDialog.show(); + aDialogParam.dialog = aDialog; + //return aDialog; + } + + function __showCertselectDialogCommon (aDialogParam, aType) { + var aCallbackFunc; + if (aType == 2) { + aCallbackFunc = __showCertselectDialogCommon2_after; + } else { + aCallbackFunc = __showCertselectDialogCommon_after; + } + + __setAfterAction (aCallbackFunc, aDialogParam); + } + + function __showCertselectDialogCommon_after (aDialogParam) + { + var aDataArray; + var aFormArray; + var aHTMLData; + + if (aDialogParam.args.storage) + __SANDBOX.refreshCertLocationSet (aDialogParam.args.storage); + else + __SANDBOX.refreshCertLocationSet (aStorage); + + if (aDialogParam.args.caList) + { + aDialogParam.args.searchCondition = 20; + } + + switch (aDialogParam.args.funcname) + { + case "SignDataCMSWithHTMLEx": + case "SignDataCMSWithHTMLExAndSerial": + var aDelimiter = AnySign.mSignHTMLOption.aDelimiter; + var aStringFormat = AnySign.mSignHTMLOption.aStringFormat; + + aDataArray = aDialogParam.args.data.split(aDelimiter); + aFormArray = aDialogParam.args.form.split(aStringFormat); + aHTMLData = ""; + + for (var aIter = 0; aIter < aFormArray.length; aIter++) { + aHTMLData += aFormArray[aIter]; + if (aIter < aFormArray.length - 1 && aDataArray[aIter]) + aHTMLData += aDataArray[aIter]; + } + aDialogParam.args.plain = aDialogParam.args.data; + if (AnySign.mUseIframeData == true) + aDialogParam.args.htmlData = aHTMLData; + else + aDialogParam.args.htmlDataToText = aHTMLData; + break; + } + + var optionCase = 0x01 & aDialogParam.args.option; + switch (optionCase) + { + case 1: // confirmwindow + // begin case 1 + var aModule = loadModule ("confirmwindow"); + var aDialog = aModule ( + { + width: 400, + height: 80, + onconfirm: function () { + aDialog.dispose (); + AnySign.SetUITarget (aDialog.getUITarget()); + __SANDBOX.certSelectDialog(aDialogParam); + return; + }, + oncancel: function () { + aDialog.dispose (); + return; + } + + ,args: {certSelectDialogParam: aDialogParam} + }); + if (aDialog) aDialog.show(); + // end case 1 + break; + case 0: // no confirmwindow + default: + __SANDBOX.certSelectDialog(aDialogParam); + break; + } + } + + function __inputPasswdDialog(aDialogParam) + { + var aInputType = __SANDBOX.getInputType(aDialogParam.args.mediaID); + var aPasswordModule = __SANDBOX.loadModule("inputpasswd"); + var aInputPasswdDialog = aPasswordModule ({ + width: aDialogParam.width, + height: aDialogParam.height, + onconfirm: function (aResult) { + aInputPasswdDialog.dispose(); + aDialogParam.args.userCallback (aResult); + }, + oncancel: function (e) { + aInputPasswdDialog.dispose(); + aDialogParam.args.errCallback (-1); + }, + args: {messageType: aDialogParam.args.messageType, inputType: aInputType} + }); + + if (aInputPasswdDialog) aInputPasswdDialog.show(); + } + + function __verifyVidDialog(aDialogParam) + { + var aInputType = __SANDBOX.getInputType(aDialogParam.args.mediaID); + var aVerifyVidModule = __SANDBOX.loadModule("verifyvid"); + var aVerifyVidDialog = aVerifyVidModule({ + onconfirm: function (aResult) { + aVerifyVidDialog.dispose(); + aDialogParam.args.userCallback (aResult); + }, + oncancel: function (e) { + aVerifyVidDialog.dispose(); + aDialogParam.args.errCallback (-1); + }, + args: {inputType: aInputType} + }); + + if (aVerifyVidDialog) aVerifyVidDialog.show(); + } + + function __showCertselectDialogCommon2_after(aDialogParam) + { + var aResult = ""; + var aSignCount = 0; + var aInputFilePath = aDialogParam.args.inFilePath; + var aOutputFilePath = aDialogParam.args.outFilePath; + var aSignFileOption = aDialogParam.args.option; + var aUserCallback = aDialogParam.args.userCallback; + var aErrCallback = aDialogParam.args.errCallback; + + var _certSelectAndSignFile = function () { + + aDialogParam.args.inFilePath = aInputFilePath; + aDialogParam.args.outFilePath = aOutputFilePath; + aDialogParam.args.option = aSignFileOption; + aDialogParam.args.userCallback = _certSelectAndSignFile_userCallback; + aDialogParam.args.errCallback = _certSelectAndSignFile_errCallback; + + __SANDBOX.showCertselectDialogCommon(aDialogParam); + } + + var _certSelectAndSignFile_errCallback = function(result) { + aErrCallback (result); + } + + var _certSelectAndSignFile_userCallback = function(result) { + if (result == -1) { // cancel + if (aSignCount > 0) + aUserCallback (aResult); + } else if (aSignFileOption & XW_OPTION_SIGN_ADD && + !(aSignFileOption & XW_OPTION_SIGN_DETACHED) && + !(aSignFileOption & XW_OPTION_SIGN_DETACHED_BASE64)) + { + if (aSignCount == 0) { + aInputFilePath = result; + aResult = result; + + if (!(aSignFileOption & XW_OPTION_NO_SELECTFILE)) + aSignFileOption += XW_OPTION_NO_SELECTFILE; + if (aSignFileOption & XW_OPTION_TEMP_SAVE) + aSignFileOption -= XW_OPTION_TEMP_SAVE; + if (aSignFileOption & XW_OPTION_CHECK_WRITE_FILE) + aSignFileOption -= XW_OPTION_CHECK_WRITE_FILE; + } + aSignCount++; + _confirmNextCert (); + } else { + aUserCallback (result); + } + } + + var _confirmNextCert = function() { + var aCommonDialogModule = __SANDBOX.loadModule("commondialog"); + AnySign.SetUITarget (aDialogParam.dialog.getUITarget()); + var aCommonDialog = aCommonDialogModule ({ + width: 350, + height: 0, + onconfirm: function() { + aCommonDialog.dispose(); + AnySign.SetUITarget (aCommonDialog.getUITarget()); + _certSelectAndSignFile(); + }, + oncancel: function(e) { + aCommonDialog.dispose(); + aUserCallback (aResult); + }, + args: {dialogType: "confirm", + messageType: "signFile_confirmNextCert"} + }); + + if (aCommonDialog) aCommonDialog.show(); + } + + _certSelectAndSignFile (); + } + + function __processCacheCert(aParam) { + var aMediaID = __SANDBOX.cacheCertData.mediaID; + var aIssuerRDN = __SANDBOX.cacheCertData.issuerRDN; + var aCertSerial = __SANDBOX.cacheCertData.certSerial; + var aPfxPath = __SANDBOX.cacheCertData.pfxPath; + var aPasswd = __SANDBOX.cacheCertData.passwd; + var aFuncname = aParam.funcname; + var aOption = aParam.option; + var aDescription = aParam.description; + var aXgateAddress = aParam.xgateAddress; + var aInFilePath = aParam.inFilePath; + var aOutFilePath = aParam.outFilePath; + var aUserCallback = aParam.userCallback; + var aErrCallback = aParam.errCallback; + var aSignedData; + + if (aUserCallback == undefined) + alert("user callback error"); + + if (aErrCallback == undefined) + aErrCallback = gErrCallback_common; + + _CB_Result = function (aResult) { + if (!__SANDBOX.isFailed (aResult, aErrCallback)) { + aUserCallback (aResult); + } + } + + if (aFuncname == "SignFileEx") { + if (!aPfxPath) { + if (aMediaID == undefined || aMediaID == null || !aIssuerRDN || !aCertSerial || !aPasswd) { + alert("No cached data."); + return; + } + + var aMediaType = Math.floor(parseInt(aMediaID, 10) / 100) * 100; + if (aMediaType != XW_CERT_LOCATION_HARD && + aMediaType != XW_CERT_LOCATION_REMOVABLE && + aMediaType != XW_CERT_LOCATION_ICCARD && + aMediaType != XW_CERT_LOCATION_KEPCOICCARD && + aMediaType != XW_CERT_LOCATION_PKCS11) { + alert("Not supported media ID."); + return; + } + } + + __SANDBOX.upInterface().signFileEx (aXgateAddress, + aInFilePath, + aOutFilePath, + aMediaID, + aIssuerRDN, + aCertSerial, + aPfxPath, + aPasswd, + aOption, + aDescription, + _CB_Result); + } else { + alert("Not supported API."); + } + } + + function __clearCacheCert() { + __SANDBOX.cacheCertData.mediaID = null; + __SANDBOX.cacheCertData.issuerRDN = null; + __SANDBOX.cacheCertData.certSerial = null; + __SANDBOX.cacheCertData.pfxPath = null; + __SANDBOX.cacheCertData.passwd = null; + return 0; + } + + function __getInputType(aMediaID) { + if (aMediaID == undefined || aMediaID == null || aMediaID == "" || aMediaID < 0) + return ""; + + aMediaID = Math.floor(parseInt(aMediaID, 10) / 100) * 100; + if (aMediaID < 0) + return ""; + + if (aMediaID == XW_CERT_LOCATION_LOCALSTORAGE || + aMediaID == XW_CERT_LOCATION_MEMORYSTORAGE) + return "lite"; + else if (aMediaID == XW_CERT_LOCATION_XECUREFREESIGN) + return "xfs"; // lite or e2e + else if (aMediaID == XW_CERT_LOCATION_WEBPAGE) + return "e2e"; + else + return "4pc"; + } + + function __setMediaType(aMediaID) { + if (aMediaID == undefined || aMediaID == null || aMediaID == "" || aMediaID < 0) + AnySign.mMediaType = XW_MEDIA_TYPE_ANYSIGN4PC; // default ? + + aMediaID = Math.floor(parseInt(aMediaID, 10) / 100) * 100; + if (aMediaID < 0) + AnySign.mMediaType = XW_MEDIA_TYPE_ANYSIGN4PC; // default ? + + if (aMediaID == XW_CERT_LOCATION_LOCALSTORAGE || + aMediaID == XW_CERT_LOCATION_MEMORYSTORAGE) + AnySign.mMediaType = XW_MEDIA_TYPE_ANYSIGNLITE; + else if (aMediaID == XW_CERT_LOCATION_XECUREFREESIGN) + AnySign.mMediaType = XW_MEDIA_TYPE_XECUREFREESIGN; + else + AnySign.mMediaType = XW_MEDIA_TYPE_ANYSIGN4PC; + } + + function __getMediaType(aMediaID) { + if (aMediaID != undefined) + __SANDBOX.setMediaType(aMediaID); + return AnySign.mMediaType; + } + + function _getSearchHashValue(aCertInfo, aFileHash) { + var aResult = ""; + var aCertInfoArray; + var aHashAlgDescArray; + var aHashAlg; + var aFileHashArray; + var aHashValueArray; + + if (aCertInfo == undefined || aCertInfo == "" || aFileHash == undefined || aFileHash == "") + return aResult; + + aCertInfoArray = aCertInfo.split("$"); + aHashAlgDescArray = aCertInfoArray[3].split("+"); + aHashAlg = aHashAlgDescArray[0].trim().toLowerCase(); + + if (aHashAlg == undefined || aHashAlg == "") + return aResult; + + aFileHashArray = aFileHash.split("$"); + for (var i = 0; i < aFileHashArray.length; i++) + { + aHashValueArray = aFileHashArray[i].split("|"); + if (aHashValueArray.length < 2) + break; + + if (aHashValueArray[0].trim().toLowerCase() == aHashAlg) + { + aResult = aHashValueArray[1]; + break; + } + } + + return aResult; + } + + // AnySign4PC setting + function __setConvertTable(aCallbackFunc) { + var aAnySign = AnySign.mAnySignEnable; + var aConvertTable = __SANDBOX.convertTable; + if (aConvertTable.length > 0 && AnySign.mAnySignLoad) + { + var aCount = 0; + + _CB_setConvertTable = function (result) + { + aCount++; + __SANDBOX.isFailed (result, gErrCallback_common); + if (aCount < aConvertTable.length) + { + setConvertTable (); + } + else + { + __SANDBOX.convertTable = []; + AnySign.mAnySignEnable = aAnySign; + aCallbackFunc(); + } + } + + setConvertTable = function () { + if (aConvertTable[aCount].type == "policy") { + __SANDBOX.upInterface().setPolicyConvertTable (aConvertTable[aCount].param1, + aConvertTable[aCount].param2, + aConvertTable[aCount].param3, + aConvertTable[aCount].param4, + _CB_setConvertTable); + } + else + { + __SANDBOX.upInterface().setIssuerConvertTable (aConvertTable[aCount].param1, + aConvertTable[aCount].param2, + aConvertTable[aCount].param3, + aConvertTable[aCount].param4, + _CB_setConvertTable); + + } + } + + AnySign.mAnySignEnable = true; + setConvertTable (); + } + else + { + aCallbackFunc(); + } + } + + function _setCertLocation(aXgateAddress, aMediaID, aOption, aResultCallback) { + if (AnySign.mAnySignLiteSupport || AnySign.mXecureFreeSignSupport) { + // AnySignLite setting + if(aOption & XW_OPTION_CACHE_CERTLOCATION) + __SANDBOX.upInterface().setCacheCertLocation(aXgateAddress, aMediaID); + __SANDBOX.upInterface().setLastLocation(aMediaID); + + var aAnySign = AnySign.mAnySignEnable; + + var _clearCachedData_callback = function (result) { + AnySign.mAnySignEnable = aAnySign; + aResultCallback(); + } + + if (AnySign.mAnySignEnable) { + // AnySignLite setting - delete cache + AnySign.mAnySignEnable = false; + __SANDBOX.upInterface().clearCachedData (aXgateAddress, 0, _clearCachedData_callback); + } else if (AnySign.mAnySignLoad) { + // AnySign4PC setting - delete cache + AnySign.mAnySignEnable = true; + __SANDBOX.upInterface().clearCachedData (aXgateAddress, 0, _clearCachedData_callback); + } else { + _clearCachedData_callback(0); + } + } else { + aResultCallback(); + } + } + + function getPath(url) + { + var path = "/"; + var qs_begin_index = url.indexOf('?'); + + // if action is relative url, get base url from window location + if (url.charAt(0) != '/' && url.substring(0,7) != "http://" && url.substring(0,8) != "https://") { + urlProtocol = window.location.protocol; + + path_end = window.location.href.indexOf('?'); + if (path_end < 0) + path_end_str = window.location.href; + else + path_end_str = window.location.href.substring(0, path_end); + + path_relative_base_end = path_end_str.lastIndexOf('/'); + path_relative_base_str = path_end_str.substring(0, path_relative_base_end+1); + path_begin_index = path_relative_base_str.substring(urlProtocol.length + 2, path_relative_base_str.length).indexOf('/'); + + if (qs_begin_index < 0) + path = path_relative_base_str.substring(urlProtocol.length + 2 + path_begin_index, path_relative_base_str.length) + url; + else + path = path_relative_base_str.substring(urlProtocol.length + 2 + path_begin_index, path_relative_base_str.length) + url.substring(0, qs_begin_index); + } + else if (url.substring(0,7) == "http://") { + path_begin_index = url.substring(7, url.length).indexOf('/'); + + if (qs_begin_index < 0) + path = url.substring (path_begin_index+7, url.length); + else + path = url.substring(path_begin_index+7, qs_begin_index); + } + else if (url.substring(0,8) == "https://") { + path_begin_index = url.substring(8, url.length).indexOf('/'); + + if (qs_begin_index < 0) + path = url.substring (path_begin_index+8, url.length); + else + path = url.substring(path_begin_index+8, qs_begin_index); + } + else if (qs_begin_index < 0) + path = url; + else + path = url.substring(0, qs_begin_index); + + return path; + } + + function XecureMakePlain(form) + { + var len = form.elements.length; + var name = new Array(len); + var value = new Array(len); + var flag = false; + var j = 0; + var plain_text = ""; + + // K-Defense var + /* + var aKDefenseEnable = AnySign.mKDefenseEnable != false && typeof(fnGetKDefenseObject) != "undefined" && fnGetKDefenseObject() != null; + var aKDefenseE2EPrefix = AnySign.mKDefenseE2EPrefix; + var aKDefenseValue = ""; + */ + + for (i=0; i
[" + aSubjectRDN + "]", + align: "left"} + }); + + if (aCommonDialog) aCommonDialog.show(); + } + + function _delete() { + _CB_deleteCertificate = function (aResult) { + if (!__SANDBOX.isFailed (aResult, aErrCallback)) + aUserCallback (aResult); + } + + _CB_getCertTree = function (aCertList) { + if (__SANDBOX.isFailed (aCertList, aErrCallback)) { + aUserCallback (-1); + return; + } + + var aCertInfo = aCertList.split("\t\n")[0].split("$"); + + var aIssuerRDN = aCertInfo[5]; + var aCertSerial = aCertInfo[6]; + + __SANDBOX.upInterface().deleteCertificate (aMediaID, + 3, /* aCertType */ + aIssuerRDN, + aCertSerial, + _CB_deleteCertificate); + } + + __SANDBOX.upInterface().getCertTree (aMediaID, 3, 14, 5, aSubjectRDN, "", _CB_getCertTree); + } + _confirm(); + }, ""); + }, + + // 2013.03.11, add, requirment from kook@wooribank.com + DeleteCertificateFromRevoke: function (aMediaID, + aSubjectRDN, + aUserCallback, + aErrCallback) + { + __SANDBOX.setAfterAction (function () { + aErrCallback = aErrCallback || gErrCallback_common; + + function _confirm() { + var aCommonDialogModule = __SANDBOX.loadModule("commondialog"); + + var aCommonDialog = aCommonDialogModule ({ + onconfirm: function(e) { + aCommonDialog.dispose(); + _delete(); + }, + oncancel: function(e) { + aCommonDialog.dispose(); + //2013.04.06, add + aUserCallback (); + }, + args: {dialogType: "confirm", + messageType: "delete_certificate_from_revoke_process", + postMessage: "

[" + aSubjectRDN + "]", + align: "left"} + }); + + if (aCommonDialog) aCommonDialog.show(); + } + + function _delete() { + _CB_deleteCertificate = function (aResult) { + if (!__SANDBOX.isFailed (aResult, aErrCallback)) + aUserCallback (); + } + + _CB_getCertTree = function (aCertList) { + if (aCertList.length < 1) { + aUserCallback (-1); + return; + } + + var aCertInfo = aCertList.split("\t\n")[0].split("$"); + + var aIssuerRDN = aCertInfo[5]; + var aCertSerial = aCertInfo[6]; + + __SANDBOX.upInterface().deleteCertificate (aMediaID, + 3, /* aCertType */ + aIssuerRDN, + aCertSerial, + _CB_deleteCertificate); + } + + __SANDBOX.upInterface().getCertTree (aMediaID, 3, 14, 5, aSubjectRDN, "", _CB_getCertTree); + } + + _confirm(); + }, ""); + }, + + SignDataWithVID_Serial: function (aXgateAddress, + aCAList, + aCertSerial, + aCertLocation, + aPlain, + aOption, + aDescription, + aLimitTrial, + aIdn, + aSvrCert, + aUserCallback, + aErrCallback) + { + var aDialogParam = {}; + var aDialogArgs = {}; + + // set default values; + aDialogParam.width = 437; + aDialogParam.height = 457; + aDialogParam.type = "sign"; + aDialogParam.args = aDialogArgs; + + aOption |= XW_FVIEW_CREATE_VID; + + aDialogParam.args ={funcname : "SignDataWithVID_Serial", + xgateAddress : aXgateAddress, + caList : aCAList, + certSerial : aCertSerial, + certLocation : aCertLocation, + plain : aPlain, + option : aOption, + description : aDescription, + keywordTryLimit : aLimitTrial, + idn : aIdn, + cert : aSvrCert, + userCallback : aUserCallback, + errCallback : aErrCallback}; + + aDialogParam.onconfirm = null; + aDialogParam.oncancel = null; + + __SANDBOX.showCertselectDialogCommon(aDialogParam); + }, + + SignDataAddWithVID_Serial: function (aXgateAddress, + aCAList, + aCertSerial, + aCertLocation, + aPlain, + aOption, + aDescription, + aLimitTrial, + aIdn, + aSvrCert, + aUserCallback, + aErrCallback) + { + var aDialogParam = {}; + var aDialogArgs = {}; + + // set default values; + aDialogParam.width = 437; + aDialogParam.height = 457; + aDialogParam.type = "sign"; + aDialogParam.args = aDialogArgs; + + aOption |= XW_FVIEW_CREATE_VID; + + aDialogParam.args ={funcname : "SignDataAddWithVID_Serial", + xgateAddress : aXgateAddress, + caList : aCAList, + certSerial : aCertSerial, + certLocation : aCertLocation, + plain : aPlain, + option : aOption, + description : aDescription, + keywordTryLimit : aLimitTrial, + idn : aIdn, + cert : aSvrCert, + userCallback : aUserCallback, + errCallback : aErrCallback}; + + aDialogParam.onconfirm = null; + aDialogParam.oncancel = null; + + __SANDBOX.showCertselectDialogCommon(aDialogParam); + }, + + SignDataCMSWithSerial: function(aXgateAddress, + aCAList, + aCertSerial, + aCertLocation, + aPlain, + aOption, + aDescription, + aLimitTrial, + aUserCallback, + aErrCallback) + { + var aDialogParam = {}; + var aDialogArgs = {}; + + // set default values; + aDialogParam.width = 437; + aDialogParam.height = 457; + aDialogParam.type = "sign"; + aDialogParam.args = aDialogArgs; + + aDialogParam.args ={funcname : "SignDataCMSWithSerial", + xgateAddress : aXgateAddress, + caList : aCAList, + certSerial : aCertSerial, + certLocation : aCertLocation, + plain : aPlain, + option : aOption, + description : aDescription, + keywordTryLimit : aLimitTrial, + userCallback : aUserCallback, + errCallback : aErrCallback}; + + aDialogParam.onconfirm = null; + aDialogParam.oncancel = null; + + __SANDBOX.showCertselectDialogCommon(aDialogParam); + + }, + + SignDataCMSWithHTMLEx: function(aXgateAddress, aCAList, aForm, aData, aCert, aOption, aDescription, aKeywordTryLimit, + aUserCallback, aErrCallback) + { + this.SignDataCMSWithHTMLExAndSerial(aXgateAddress, aCAList, "", 0, aForm, aData, aCert, aOption, aDescription, aKeywordTryLimit, + aUserCallback, aErrCallback); + }, + + SignDataCMSWithHTMLExAndSerial: function(aXgateAddress, aCAList, + aCertSerial, aCertLocation, + aForm, aData, aCert, aOption, aDescription, aKeywordTryLimit, + aUserCallback, aErrCallback) + { + var aDialogParam = {}; + var aDialogArgs = {}; + + // set default values; + aDialogParam.width = 437; + aDialogParam.height = 515; + aDialogParam.type = "sign"; + aDialogParam.args = aDialogArgs; + + aDialogParam.args ={funcname : "SignDataCMSWithHTMLExAndSerial", + xgateAddress : aXgateAddress, + caList : aCAList, + certSerial : aCertSerial, + certLocation : aCertLocation, + form : aForm, + data : aData, + cert : aCert, + option : aOption, + description : aDescription, + keywordTryLimit : aKeywordTryLimit, + htmlData : "", + userCallback : aUserCallback, + errCallback : aErrCallback} + + aDialogParam.onconfirm = null; + aDialogParam.oncancel = null; + + __SANDBOX.showCertselectDialogCommon(aDialogParam); + }, + + MultiSignTable: new function() + { + var __MultiSignTable = new Object(); + + return { + init: function (aMultiSignID) + { + if (__MultiSignTable.hasOwnProperty(aMultiSignID)) + { + alert("MultiSignID is already exist"); + return; + } + + __MultiSignTable[aMultiSignID] = new Object(); + __MultiSignTable[aMultiSignID]['plain'] = new Array(); + __MultiSignTable[aMultiSignID]['plain2'] = new Array(); + __MultiSignTable[aMultiSignID]['signed'] = new Array(); + }, + + initValue: function (aMultiSignID) + { + var aSize = this.sizeOfPlain(aMultiSignID); + for (var i = 0; i < aSize; i ++) + __MultiSignTable[aMultiSignID]['signed'].push(""); + }, + + setPlainData: function (aMultiSignID, + aPlainData, + aPlainData2) + { + if (!__MultiSignTable.hasOwnProperty(aMultiSignID)) + { + alert("Unknown MultiSignID:setPlainData:"+aMultiSignID); + return; + } + + __MultiSignTable[aMultiSignID]['plain'].push(aPlainData); + if (aPlainData2 != undefined) + __MultiSignTable[aMultiSignID]['plain2'].push(aPlainData2); + }, + + setSignedData: function (aMultiSignID, + aPlainData, + aIndex) + { + if (!__MultiSignTable.hasOwnProperty(aMultiSignID)) + { + alert("Unknown MultiSignID:setSignedData:"+aMultiSignID); + return; + } + + if (typeof aIndex != "undefined") + __MultiSignTable[aMultiSignID]['signed'][aIndex] = aPlainData; + else + __MultiSignTable[aMultiSignID]['signed'].push(aPlainData); + }, + + getPlainData: function (aMultiSignID, + aIndex) + { + if (!__MultiSignTable.hasOwnProperty(aMultiSignID)) + { + alert("Unknown MultiSignID:getPlainData:"+aMultiSignID); + return; + } + return __MultiSignTable[aMultiSignID]['plain'][aIndex]; + }, + + getPlainData2: function (aMultiSignID, + aIndex) + { + if (!__MultiSignTable.hasOwnProperty(aMultiSignID)) + { + alert("Unknown MultiSignID:getPlainData:"+aMultiSignID); + return; + } + return __MultiSignTable[aMultiSignID]['plain2'][aIndex]; + }, + + getSignedData: function (aMultiSignID, + aIndex) + { + if (!__MultiSignTable.hasOwnProperty(aMultiSignID)) + { + alert("Unknown MultiSignID:getSignedData:"+aMultiSignID); + return; + } + return __MultiSignTable[aMultiSignID]['signed'][aIndex]; + }, + + clear: function (aMultiSignID) + { + if (!__MultiSignTable.hasOwnProperty(aMultiSignID)) + { + alert("Unknown MultiSignID:clear:"+aMultiSignID); + return; + } + + delete __MultiSignTable[aMultiSignID]['signed']; + delete __MultiSignTable[aMultiSignID]['plain']; + delete __MultiSignTable[aMultiSignID]['plain2']; + delete __MultiSignTable[aMultiSignID]; + }, + + sizeOfPlain: function (aMultiSignID) + { + if (!__MultiSignTable.hasOwnProperty(aMultiSignID)) + { + alert("Unknown MultiSignID:sizeOfPlain:"+aMultiSignID); + return; + } + + return __MultiSignTable[aMultiSignID]['plain'].length; + } + } + }, + + MultiSignInit: function () + { + var aMultiSignID = new Date().getTime(); + + this.MultiSignTable.init(aMultiSignID); + + return aMultiSignID; + }, + + SetMultiSignData: function (aMultiSignID, + aPlain, + aPlain2) + { + this.MultiSignTable.setPlainData(aMultiSignID, aPlain, aPlain2); + }, + + MultiSignEx: function (aMultiSignID, + aXgateAddress, + aCAList, + aOption, + aDescription, + aLimitTrial, + aUserCallback, + aErrCallback) + { + var aDialogParam = {}; + var aDialogArgs = {}; + + // set default values; + aDialogParam.width = 437; + aDialogParam.height = 457; + aDialogParam.type = "sign"; + aDialogParam.args = aDialogArgs; + + aDialogParam.args ={funcname : "MultiSignEx", + multiSignID : aMultiSignID, + xgateAddress : aXgateAddress, + caList : aCAList, + option : aOption, + description : aDescription, + keywordTryLimit : aLimitTrial, + userCallback : aUserCallback, + errCallback : aErrCallback, + multiSignTable : this.MultiSignTable}; + + aDialogParam.onconfirm = null; + aDialogParam.oncancel = null; + + __SANDBOX.showCertselectDialogCommon(aDialogParam); + }, + + MultiSignExWithSerial: function (aMultiSignID, + aXgateAddress, + aCAList, + aCertSerial, + aCertLocation, + aOption, + aDescription, + aLimitTrial, + aUserCallback, + aErrCallback) + { + var aDialogParam = {}; + var aDialogArgs = {}; + + // set default values; + aDialogParam.width = 437; + aDialogParam.height = 457; + aDialogParam.type = "sign"; + aDialogParam.args = aDialogArgs; + + aDialogParam.args ={funcname : "MultiSignExWithSerial", + multiSignID : aMultiSignID, + xgateAddress : aXgateAddress, + caList : aCAList, + certSerial : aCertSerial, + certLocation : aCertLocation, + option : aOption, + description : aDescription, + keywordTryLimit : aLimitTrial, + userCallback : aUserCallback, + errCallback : aErrCallback, + multiSignTable : this.MultiSignTable}; + + + aDialogParam.onconfirm = null; + aDialogParam.oncancel = null; + + __SANDBOX.showCertselectDialogCommon(aDialogParam); + }, + + MultiSignExWithVID_Serial: function (aMultiSignID, + aXgateAddress, + aCAList, + aCertSerial, + aCertLocation, + aOption, + aDescription, + aCert, + aLimitTrial, + aUserCallback, + aErrCallback) + { + var aDialogParam = {}; + var aDialogArgs = {}; + + // set default values; + aDialogParam.width = 437; + aDialogParam.height = 457; + aDialogParam.type = "sign"; + aDialogParam.args = aDialogArgs; + + aOption |= XW_FVIEW_CREATE_VID; + + aDialogParam.args ={funcname : "MultiSignExWithVID_Serial", + multiSignID : aMultiSignID, + xgateAddress : aXgateAddress, + caList : aCAList, + certSerial : aCertSerial, + certLocation : aCertLocation, + option : aOption, + description : aDescription, + keywordTryLimit : aLimitTrial, + cert : aCert, + userCallback : aUserCallback, + errCallback : aErrCallback, + multiSignTable : this.MultiSignTable}; + + + aDialogParam.onconfirm = null; + aDialogParam.oncancel = null; + + __SANDBOX.showCertselectDialogCommon(aDialogParam); + }, + + MultiFileSign: function (aMultiSignID, + aXgateAddress, + aCAList, + aOption, + aDescription, + aLimitTrial, + aUserCallback, + aErrCallback) + { + var aDialogParam = {}; + var aDialogArgs = {}; + + // set default values + aDialogParam.width = 437; + aDialogParam.height = 457; + aDialogParam.type = "sign-no-pfx"; + aDialogParam.args = aDialogArgs; + + aDialogParam.args = {funcname : "MultiFileSign", + multiSignID : aMultiSignID, + xgateAddress : aXgateAddress, + caList : aCAList, + option : aOption, + description : aDescription, + keywordTryLimit : aLimitTrial, + userCallback : aUserCallback, + errCallback : aErrCallback, + multiSignTable : this.MultiSignTable}; + + aDialogParam.onconfirm = null; + aDialogParam.oncancel = null; + + __SANDBOX.showCertselectDialogCommon(aDialogParam); + }, + + MultiSignFileInfo: function (aMultiSignID, + aXgateAddress, + aCAList, + aOption, + aDescription, + aLimitTrial, + aUserCallback, + aErrCallback) + { + var aDialogParam = {}; + var aDialogArgs = {}; + + // set default values; + aDialogParam.width = 437; + aDialogParam.height = 457; + aDialogParam.type = "sign-no-pfx"; + aDialogParam.args = aDialogArgs; + + aDialogParam.args ={funcname : "MultiSignFileInfo", + multiSignID : aMultiSignID, + xgateAddress : aXgateAddress, + caList : aCAList, + option : aOption, + description : aDescription, + keywordTryLimit : aLimitTrial, + userCallback : aUserCallback, + errCallback : aErrCallback, + multiSignTable : this.MultiSignTable}; + + + aDialogParam.onconfirm = null; + aDialogParam.oncancel = null; + + __SANDBOX.showCertselectDialogCommon(aDialogParam); + }, + + MultiSignFileInfoWithSerial: function (aMultiSignID, + aXgateAddress, + aCAList, + aCertSerial, + aCertLocation, + aOption, + aDescription, + aLimitTrial, + aUserCallback, + aErrCallback) + { + var aDialogParam = {}; + var aDialogArgs = {}; + + // set default values; + aDialogParam.width = 437; + aDialogParam.height = 457; + aDialogParam.type = "sign-no-pfx"; + aDialogParam.args = aDialogArgs; + + aDialogParam.args ={funcname : "MultiSignFileInfoWithSerial", + multiSignID : aMultiSignID, + xgateAddress : aXgateAddress, + caList : aCAList, + certSerial : aCertSerial, + certLocation : aCertLocation, + option : aOption, + description : aDescription, + keywordTryLimit : aLimitTrial, + userCallback : aUserCallback, + errCallback : aErrCallback, + multiSignTable : this.MultiSignTable}; + + + aDialogParam.onconfirm = null; + aDialogParam.oncancel = null; + + __SANDBOX.showCertselectDialogCommon(aDialogParam); + }, + + MultiSignFileInfoWithVID_Serial: function (aMultiSignID, + aXgateAddress, + aCAList, + aCertSerial, + aCertLocation, + aOption, + aDescription, + aLimitTrial, + aIdn, + aSvrCert, + aUserCallback, + aErrCallback) + { + var aDialogParam = {}; + var aDialogArgs = {}; + var aPlain = ""; + + // set default values; + aDialogParam.width = 437; + aDialogParam.height = 457; + aDialogParam.type = "sign-no-pfx"; + aDialogParam.args = aDialogArgs; + + aPlain = aFileInfo + "&" + aFileHash; + aOption |= XW_FVIEW_CREATE_VID; + + aDialogParam.args ={funcname : "MultiSignFileInfoWithVID_Serial", + multiSignID : aMultiSignID, + xgateAddress : aXgateAddress, + caList : aCAList, + certSerial : aCertSerial, + certLocation : aCertLocation, + plain : aPlain, + option : aOption, + description : aDescription, + keywordTryLimit : aLimitTrial, + idn : aIdn, + cert : aSvrCert, + userCallback : aUserCallback, + errCallback : aErrCallback, + multiSignTable : this.MultiSignTable}; + + + aDialogParam.onconfirm = null; + aDialogParam.oncancel = null; + + __SANDBOX.showCertselectDialogCommon(aDialogParam); + }, + + GetMultiSignedData: function (aMultiSignID, + aIndex) + { + return this.MultiSignTable.getSignedData(aMultiSignID, aIndex); + }, + + MultiSignFinal: function (aMultiSignID) + { + this.MultiSignTable.clear(aMultiSignID); + }, + + RequestCertificate: function(aCAPort, aCAAddr, aRefNum, aAuthCode, aCAType, aUserCallback, aErrCallback, aUbiKeyUserCallback) + { + this.RequestCertificateEx(aCAPort, aCAAddr, aRefNum, aAuthCode, aCAType, 0, "", "", aUserCallback, aErrCallback, aUbiKeyUserCallback); + }, + + RequestCertificateEx: function(aCAPort, aCAAddr, aRefNum, aAuthCode, aCAType, aReqOption, aCAName, aRAName, aUserCallback, aErrCallback, aUbiKeyUserCallback) + { + this.RequestCertificateEx2 (aCAPort, aCAAddr, aRefNum, aAuthCode, aCAType, aReqOption, aCAName, aRAName, 0, aUserCallback, aErrCallback, aUbiKeyUserCallback); + }, + + RequestCertificateEx2: function(aCAPort, aCAAddr, aRefNum, aAuthCode, aCAType, aReqOption, aCAName, aRAName, aSaveOption, aUserCallback, aErrCallback, aUbiKeyUserCallback) + { + this.RequestCertificateEx2WithWebCMP (aCAPort, null, aCAAddr, null, null, aRefNum, aAuthCode, aCAType, null, null, aReqOption, aCAName, aRAName, aSaveOption, aUserCallback, aErrCallback, aUbiKeyUserCallback); + }, + + RequestCertificateEx2WithWebCMP: function(aCAPort, aCAHTTPPort, aCAAddr, aCAHTTPAddr, aCAHTTPService, aRefNum, aAuthCode, aCAType, aWorkerNum, aWorkerScript, aReqOption, aCAName, aRAName, aSaveOption, aUserCallback, aErrCallback, aUbiKeyUserCallback) + { + __SANDBOX.setAfterAction (function () { + var aKeyword; + var aMediaID; + var aMediaType; + var aProviderName; + var aUbiKeyCallback = false; + + var aGuideModule; + var aGuideDialog = null; + + if (aErrCallback == undefined) + { + aErrCallback = gErrCallback_common; + } + + /****************************************************************************************** + * guidewindow function + ******************************************************************************************/ + _show_guidewindow = function () + { + if (aGuideDialog) return; + + aGuideModule = __SANDBOX.loadModule("guidewindow"); + aGuideDialog = aGuideModule({ + type: "loading", + args: "", + onconfirm: "", + oncancel: function () {aGuideDialog.dispose();} + }); + aGuideDialog.show(); + } + + _close_guidewindow = function () + { + if (aGuideDialog) { + aGuideDialog.dispose (); + aGuideDialog = null; + } + } + /****************************************************************************************** + * final function + ******************************************************************************************/ + _fn_final = function (aCallback) + { + var _final_callback = function () { + _close_guidewindow (); + + if (aCallback) + aCallback (); + } + + if (aMediaType == XW_CERT_LOCATION_ICCARD || aMediaType == XW_CERT_LOCATION_KEPCOICCARD) { + __SANDBOX.upInterface().logoutStoreToken(aMediaID, _final_callback); + } else if (aMediaType == XW_CERT_LOCATION_PKCS11) { + __SANDBOX.upInterface().finalizePKCS11FromIndex (aMediaID, _final_callback); + } else if (aMediaType == XW_CERT_LOCATION_SECUREDISK) { + __SANDBOX.upInterface().finalizeSecureDiskFromName (aProviderName, _final_callback); + } else { + _final_callback (); + } + } + /****************************************************************************************** + * 인증서 저장 위치 선택 + ******************************************************************************************/ + var _certsaveloc = function() + { + var _certsaveloc_result = function(result) { + aMediaID = result; + aMediaType = Math.floor(aMediaID /100) * 100; + + if (aMediaType == XW_CERT_LOCATION_PKCS11) + _hsmselect(); + else if (aMediaType == XW_CERT_LOCATION_SECUREDISK) + _securedisk(); + else if (aMediaType == XW_CERT_LOCATION_ICCARD) + _iccardlist(); + else if (aMediaType == XW_CERT_LOCATION_KEPCOICCARD) + _kepcoiccard(); + else + _savepasswd(); + } + + var certsavelocModule = __SANDBOX.loadModule("certsaveloc"); + var certsavelocDialog = certsavelocModule({ + args: { type: "request" }, + width: 350, + height: 355, + onconfirm: function(result) { + AnySign.SetUITarget (certsavelocDialog.getUITarget()); + certsavelocDialog.dispose(); + _certsaveloc_result(result); + }, + oncancel: function(e) { + certsavelocDialog.dispose(); + } + }); + certsavelocDialog.show(); + } + /****************************************************************************************** + * 인증서 패스워드 입력 + ******************************************************************************************/ + var _savepasswd = function() + { + var _securedisk_result = function (aLoginResult) + { + if (aLoginResult != 0) { + var aErrorObject = __SANDBOX.upInterface().setErrCodeAndMsg(); + var _final_callback = function () { + alert(aErrorObject.msg.replace(/\\n/g, '\r\n')); + _savepasswd(); + } + _fn_final (_final_callback); + } else { + _request(); + } + } + + var aInputType = __SANDBOX.getInputType(aMediaID); + + var savepassModule = __SANDBOX.loadModule("savepasswd"); + var savepassDialog = savepassModule({ + width: 350, height: 190, + onconfirm: function(result) + { + savepassDialog.dispose(); + aKeyword = result; + + if (aMediaType == XW_CERT_LOCATION_SECUREDISK) + { + _show_guidewindow (); + + __SANDBOX.upInterface().loginSecureDiskFromIndex (aMediaID, + aKeyword, + "", + "", + "", + 1, + _securedisk_result); + } + else + { + _request(); + } + }, + oncancel: function(e) { + savepassDialog.dispose() + _fn_final (); + }, + args: {messageType: "request", inputType: aInputType} + }); + savepassDialog.show(); + } + /****************************************************************************************** + * 안전디스크 설치 확인 + ******************************************************************************************/ + var _securedisk = function() + { + _securedisk_install = function() + { + var aURL = AnySign.mSecureDiskData.mInstallURL; + var aOption = AnySign.mSecureDiskData.mInstallPageOption; + if (aURL == null || aURL == undefined || aURL == "") + { + if (typeof AnySign.mLanguage === 'string' && AnySign.mLanguage.toLowerCase() == "ko-kr") + alert (XW_SECUREDISK_NOTABLE_MSG); + else + alert (XW_SECUREDISK_NOTABLE_MSG_en); + } + else + { + var aConfirmMsg; + if (typeof AnySign.mLanguage === 'string' && AnySign.mLanguage.toLowerCase() == "ko-kr") + aConfirmMsg = XW_SECUREDISK_INSTALL_MSG; + else + aConfirmMsg = XW_SECUREDISK_INSTALL_MSG_en; + + if (confirm(aConfirmMsg) == true) + window.open (aURL, 'DownLoadPage', aOption); + } + } + + _initializeSecureDiskFromName = function (result) + { + if (result == 0) + { + _savepasswd(); + } + else + { + var aErrorObject = __SANDBOX.upInterface().setErrCodeAndMsg(); + if (aErrorObject.code == XW_ERROR_SECUREDISK_LOAD_FAILED) { + _securedisk_install (); + } else { + alert(aErrorObject.msg.replace(/\\n/g, '\r\n')); + } + } + + } + + _getMediaList = function (providerName) + { + if (providerName == "") + { + _securedisk_install (); + } + else + { + aMediaID = aMediaID + 1; + aProviderName = providerName; + + __SANDBOX.upInterface().initializeSecureDiskFromName(aProviderName, _initializeSecureDiskFromName); + } + } + + __SANDBOX.upInterface().getMediaList(XW_CERT_LOCATION_SECUREDISK, 0, 1, _getMediaList); + } + /****************************************************************************************** + * 보안토큰 종류 선택 + ******************************************************************************************/ + var _hsmselect = function() + { + var hsmselectModule = __SANDBOX.loadModule("hsmselect"); + var hsmselectDialog = hsmselectModule({ + width: 335, height: 200, + onconfirm: function(result, aProviderName) + { + aMediaID = aMediaID + result; + hsmselectDialog.dispose(); + AnySign.SetUITarget(hsmselectDialog.getUITarget()); + if(result < 0){ + return; + } + + _verifyhsm (); + }, + oncancel: function(e) {hsmselectDialog.dispose()} + }); + hsmselectDialog.show(); + } + /****************************************************************************************** + * 보안토큰 핀번호 입력 + ******************************************************************************************/ + var _verifyhsm = function() + { + var _loginPKCS11FromIndex_callback = function(result) { + _setSecureInput_callback = function () + { + _request(); + } + + if(result != 0) + { + var aErrorObject = __SANDBOX.upInterface().setErrCodeAndMsg(); + var _final_callback = function () { + alert(aErrorObject.msg.replace(/\\n/g, '\r\n')); + _verifyhsm (); + } + _fn_final (_final_callback); + } + else + { + __SANDBOX.upInterface().setSecureInput ("", _setSecureInput_callback); + } + } + + var verifyhsmModule = __SANDBOX.loadModule("verifyhsm"); + var verifyhsmDialog = verifyhsmModule({ + args: {messageType: "request" }, + onconfirm: function(result) { + verifyhsmDialog.dispose(); + + _show_guidewindow (); + + __SANDBOX.upInterface().loginPKCS11FromIndex(aMediaID, result, _loginPKCS11FromIndex_callback); + }, + oncancel: function(e) { + verifyhsmDialog.dispose(); + _fn_final (); + } + }); + verifyhsmDialog.show(); + } + /****************************************************************************************** + * 저장토큰 자동 선택 + ******************************************************************************************/ + var _iccardselect = function() { + aMediaID = XW_CERT_LOCATION_ICCARD + 1; + aMediaType = XW_CERT_LOCATION_ICCARD; + __SANDBOX.upInterface().getMediaList(XW_CERT_LOCATION_ICCARD, 0, 1, _iccard_login); + } + /****************************************************************************************** + * 저장토큰 종류 선택 + ******************************************************************************************/ + var _iccardlist = function() { + var iccardlistModule = __SANDBOX.loadModule("iccardlist"); + var iccardlistDialog = iccardlistModule({ + args: {}, + onconfirm: function (aResult) { + iccardlistDialog.dispose(); + aMediaID = XW_CERT_LOCATION_ICCARD + aResult; + _iccard_login(); + }, + oncancel: function () { + iccardlistDialog.dispose(); + } + }); + iccardlistDialog.show(); + } + /****************************************************************************************** + * KEPCO IC 카드 설치 확인 + ******************************************************************************************/ + var _kepcoiccard = function () { + _CB_initStoreToken = function (aResult) + { + if (!__SANDBOX.isFailed(aResult, aErrCallback)) { + aMediaID = XW_CERT_LOCATION_KEPCOICCARD + 1; + _iccard_login(); + } + } + __SANDBOX.upInterface().initStoreToken(XW_CERT_LOCATION_KEPCOICCARD + 1, _CB_initStoreToken); + } + /****************************************************************************************** + * 저장토큰 암호 입력 + ******************************************************************************************/ + var _iccard_login = function () + { + var loginStoreToken_callback = function (result) + { + if (result!= 0) { + var aErrorObject = __SANDBOX.upInterface().setErrCodeAndMsg(); + var _final_callback = function () { + alert(aErrorObject.msg.replace(/\\n/g, '\r\n')); + _iccard_login(); + } + _fn_final (_final_callback); + } + else + { + _savepasswd(); + } + } + + var aICCardType; + if (aMediaType == XW_CERT_LOCATION_KEPCOICCARD) + aICCardType = "kepco"; + else + aICCardType = "iccard"; + + var iccardModule = __SANDBOX.loadModule("iccard"); + var iccardDialog = iccardModule({ + type: aICCardType, + args: { }, + onconfirm: function (aPin) { + iccardDialog.dispose(); + + _show_guidewindow (); + + __SANDBOX.upInterface().loginStoreToken(aMediaID, aPin, 1, loginStoreToken_callback); + }, + oncancel: function () { + iccardDialog.dispose(); + } + }); + iccardDialog.show(); + } + /****************************************************************************************** + * UbiKey callback function + ******************************************************************************************/ + var UbiKey_callbackFunction = function (result) { + aUbiKeyUserCallback(result); + } + /****************************************************************************************** + * 인증서 발급 + ******************************************************************************************/ + var _request = function () { + + _requestCallback = function (result) + { + _close_guidewindow (); + + if (__SANDBOX.isFailed (result, aErrCallback)) + { + _fn_final (); + } + else + { + var _final_callback = function () { + if (aUbiKeyCallback == false) + aUserCallback (0); + } + _fn_final (_final_callback); + } + } + + _show_guidewindow (); + + if(aMediaID == XW_CERT_LOCATION_YESSIGNM + 1 && aUbiKeyUserCallback != undefined) // Ubikey 1101 + { + if (AnySign.mUbikeyData.mPlatForm == "Linux" || AnySign.mUbikeyData.mPlatForm == "Mac") + { + aUbiKeyCallback = true; + __SANDBOX.setUbiKeyFunction(aUbiKeyUserCallback); + } + } + + if (!AnySign.mAnySignEnable) + { + var tempCAHTTPPort = ""; + + if (aCAHTTPPort !== undefined) + { + tempCAHTTPPort = ":" + tempCAHTTPPort += typeof aCAHTTPPort == "string" ? aCAHTTPPort : aCAHTTPPort.toString(); + } + + if (aCAHTTPService !== undefined) + { + if (aCAHTTPService.charAt(0) !== "/") + tempCAHTTPPort += "/" + aCAHTTPService; + else + tempCAHTTPPort += aCAHTTPService; + } + + aCAPort = tempCAHTTPPort; + aCAAddr = aCAHTTPAddr; + } + + __SANDBOX.upInterface().requestCertificate (aCAPort, + aCAAddr, + aMediaID, + aRefNum, + aAuthCode, + aCAType, + aKeyword, + aWorkerNum, + aWorkerScript, + aReqOption, + aCAName, + aRAName, + _requestCallback); + } + /****************************************************************************************** + * Excute + ******************************************************************************************/ + if (AnySign.mShowLocationDialog) + { + if (aSaveOption == 2) + { + aMediaID = XW_CERT_LOCATION_LOCALSTORAGE; + _savepasswd(); + } + else + { + _certsaveloc(); + } + } + else + _iccardselect(); + }, ""); + }, + + RenewCertificate: function(aCAPort, aCAAddr, aCertLocation, aCAType, aKeywordTryLimit, aUserCallback, aErrCallback) { + this.RenewCertificateWithSerial (aCAPort, aCAAddr, "", aCertLocation, aCAType, aKeywordTryLimit, aUserCallback, aErrCallback); + }, + + RenewCertificateWithSerial: function(aCAPort, aCAAddr, aCertSerial, aCertLocation, aCAType, aKeywordTryLimit, aUserCallback, aErrCallback) { + this.RenewCertificateWithSerialWithWebCMP (aCAPort, null, aCAAddr, null, null, aCertSerial, aCertLocation, aCAType, aKeywordTryLimit, null, null, aUserCallback, aErrCallback); + }, + + RenewCertificateWithSerialWithWebCMP: function(aCAPort, aCAHTTPPort, aCAAddr, aCAHTTPAddr, aCAHTTPService, aCertSerial, aCertLocation, aCAType, aKeywordTryLimit, aWorkerNum, aWorkerScript, aUserCallback, aErrCallback) { + var aDialogParam = {}; + var aDialogArgs = {}; + var aGuideModule; + var aGuideDialog = null; + var aMediaID; + var aMediaType; + var aProviderName; + var aTargetMediaID = -1; + var aTargetMediaType; + var aTargetProviderName; + var aShowRenewCertSaveLoc; + + if (aErrCallback == undefined) + { + aErrCallback = gErrCallback_common; + } + + /****************************************************************************************** + * guidewindow function + ******************************************************************************************/ + __show_guidewindow = function () + { + if (aGuideDialog) return; + + aGuideModule = __SANDBOX.loadModule("guidewindow"); + aGuideDialog = aGuideModule({ + type: "loading", + args: "", + onconfirm: "", + oncancel: function () {aGuideDialog.dispose();} + }); + aGuideDialog.show(); + } + + __close_guidewindow = function () + { + if (aGuideDialog) { + aGuideDialog.dispose (); + aGuideDialog = null; + } + } + /****************************************************************************************** + * final function + ******************************************************************************************/ + __fn_final = function (aCallback) + { + var _final_callback = function () { + __close_guidewindow (); + + if (aCallback) + aCallback (); + } + + var _final_target = function () { + if (aTargetMediaType == XW_CERT_LOCATION_ICCARD || aTargetMediaType == XW_CERT_LOCATION_KEPCOICCARD) { + __SANDBOX.upInterface().logoutStoreToken(aTargetMediaID, _final_callback); + } else if (aTargetMediaType == XW_CERT_LOCATION_PKCS11) { + __SANDBOX.upInterface().finalizePKCS11FromIndex (aTargetMediaID, _final_callback); + } else if (aTargetMediaType == XW_CERT_LOCATION_SECUREDISK) { + __SANDBOX.upInterface().finalizeSecureDiskFromName (aTargetProviderName, _final_callback); + } else { + _final_callback (); + } + } + + if (aMediaType == XW_CERT_LOCATION_ICCARD || aMediaType == XW_CERT_LOCATION_KEPCOICCARD) { + __SANDBOX.upInterface().logoutStoreToken(aMediaID, _final_target); + } else if (aMediaType == XW_CERT_LOCATION_PKCS11) { + __SANDBOX.upInterface().finalizePKCS11FromIndex (aMediaID, _final_target); + } else if (aMediaType == XW_CERT_LOCATION_SECUREDISK) { + __SANDBOX.upInterface().finalizeSecureDiskFromName (aProviderName, _final_target); + } else { + _final_target (); + } + } + /****************************************************************************************** + * renewCertificate callback function + ******************************************************************************************/ + _renewCertificate = function (result) + { + if (!__SANDBOX.isFailed(result, aErrCallback)) + { + var _final_callback = function () { + aDialogParam.args.userCallback(result); + } + __fn_final (_final_callback); + } else { + __fn_final (); + } + } + /******************************************************************************************/ + + function completeCallback(aDialogParam) + { + if (aDialogParam.args.dialog) + aGuideDialog = aDialogParam.args.dialog; + else + __show_guidewindow (); + + var caPort, caAddr; + if (AnySign.mAnySignEnable) + { + caPort = aDialogParam.args.caPort; + caAddr = aDialogParam.args.caAddr; + } + else + { + + var tempCAHTTPPort = ""; + + if (aDialogParam.args.caHTTPPort !== undefined) + { + tempCAHTTPPort = ":" + tempCAHTTPPort += typeof aDialogParam.args.caHTTPPort == "string" ? aDialogParam.args.caHTTPPort : aDialogParam.args.caHTTPPort.toString(); + } + + if (aDialogParam.args.caHTTPService !== undefined) + { + if (aDialogParam.args.caHTTPService.charAt(0) !== "/") + tempCAHTTPPort += "/" + aDialogParam.args.caHTTPService; + else + tempCAHTTPPort += aDialogParam.args.caHTTPService; + } + + caPort = tempCAHTTPPort; + caAddr = aDialogParam.args.caHTTPAddr; + } + + if (aTargetMediaID == -1 || aDialogParam.args.mediaID == aTargetMediaID) { + __SANDBOX.upInterface().renewCertificate (caPort, + caAddr, + aDialogParam.args.issuerRDN, + aDialogParam.args.certSerial, + aDialogParam.args.mediaID, + aDialogParam.args.caType, + aDialogParam.args.oldPasswd, + aDialogParam.args.newPasswd, + aDialogParam.args.workerNum, + aDialogParam.args.workerScript, + aDialogParam.args.option, + _renewCertificate); + } else { + __SANDBOX.upInterface().renewCertificateEx (caPort, + caAddr, + aDialogParam.args.issuerRDN, + aDialogParam.args.certSerial, + aDialogParam.args.mediaID, + aTargetMediaID, + aDialogParam.args.caType, + aDialogParam.args.oldPasswd, + aDialogParam.args.newPasswd, + aDialogParam.args.option, + _renewCertificate); + } + } + + function showSavePasswdDialog(aDialogParam) + { + aMediaID = aDialogParam.args.mediaID; + aMediaType = Math.floor(aMediaID / 100) * 100; + aShowRenewCertSaveLoc = AnySign.mAnySignEnable && AnySign.mShowRenewCertSaveLoc; + AnySign.mAnySignLiteSupport = false; + + var _loginStoreToken = function (result) + { + __close_guidewindow (); + + if (!__SANDBOX.isFailed(result, aErrCallback)) { + if (aShowRenewCertSaveLoc) + _certsaveloc (); + else + _savepasswd_dialog (); + } else { + _iccard_pin_dialog (); + } + } + + var _iccard_pin_dialog = function () + { + if (aMediaType == XW_CERT_LOCATION_KEPCOICCARD) + aICCardType = "kepco"; + else + aICCardType = "iccard"; + + var iccardModule = __SANDBOX.loadModule("iccard"); + var iccardDialog = iccardModule({ + type: aICCardType, + args: { }, + onconfirm: function (aPin) { + iccardDialog.dispose(); + __show_guidewindow (); + __SANDBOX.upInterface().loginStoreToken(aMediaID, aPin, 1, _loginStoreToken); + }, + oncancel: function () { + iccardDialog.dispose(); + __fn_final (); + } + }); + iccardDialog.show(); + } + + var _savepasswd_dialog = function () + { + var aInputType = __SANDBOX.getInputType(aMediaID); + var savepasswdModule = __SANDBOX.loadModule("savepasswd"); + var savepasswdDialog = savepasswdModule({ + width: 350, + height: 190, + onconfirm: function(aResult) { + savepasswdDialog.dispose(); + aDialogParam.args.newPasswd = aResult; + aDialogParam.args.completeCallback(aDialogParam); + }, + oncancel: function() { + savepasswdDialog.dispose(); + __fn_final (); + }, + args: {messageType: "renew", inputType: aInputType} + }); + savepasswdDialog.show(); + } + + /****************************************************************************************** + * 인증서 저장 위치 선택 + ******************************************************************************************/ + var _certsaveloc = function() + { + var _certsaveloc_result = function(result) { + aTargetMediaID = result; + aTargetMediaType = Math.floor(aTargetMediaID /100) * 100; + + if (aMediaID == aTargetMediaID) { + if (aTargetMediaType == XW_CERT_LOCATION_PKCS11 || aTargetMediaType == XW_CERT_LOCATION_SECUREDISK) { + aDialogParam.args.newPasswd = ""; + aDialogParam.args.completeCallback(aDialogParam); + } + else + _savepasswd(); + } + else if (aTargetMediaType == XW_CERT_LOCATION_PKCS11) + _hsmselect(); + else if (aTargetMediaType == XW_CERT_LOCATION_SECUREDISK) + _securedisk(); + else if (aTargetMediaType == XW_CERT_LOCATION_ICCARD) + _iccardlist(); + else if (aTargetMediaType == XW_CERT_LOCATION_KEPCOICCARD) + _kepcoiccard(); + else + _savepasswd(); + } + + var certsavelocModule = __SANDBOX.loadModule("certsaveloc"); + var certsavelocDialog = certsavelocModule({ + args: { type: "request" }, + width: 350, + height: 355, + onconfirm: function(result) { + AnySign.SetUITarget (certsavelocDialog.getUITarget()); + certsavelocDialog.dispose(); + _certsaveloc_result(result); + }, + oncancel: function(e) { + certsavelocDialog.dispose(); + } + }); + certsavelocDialog.show(); + } + /****************************************************************************************** + * 인증서 패스워드 입력 + ******************************************************************************************/ + var _savepasswd = function() + { + var _securedisk_result = function (aLoginResult) + { + if (aLoginResult != 0) { + var aErrorObject = __SANDBOX.upInterface().setErrCodeAndMsg(); + var _final_callback = function () { + alert(aErrorObject.msg.replace(/\\n/g, '\r\n')); + _savepasswd(); + } + __fn_final (_final_callback); + } else { + aDialogParam.args.completeCallback(aDialogParam); + } + } + + var aInputType = __SANDBOX.getInputType(aTargetMediaID); + + var savepassModule = __SANDBOX.loadModule("savepasswd"); + var savepassDialog = savepassModule({ + width: 350, height: 190, + onconfirm: function(result) + { + savepassDialog.dispose(); + aDialogParam.args.newPasswd = result; + + if (aTargetMediaType == XW_CERT_LOCATION_SECUREDISK) + { + __show_guidewindow (); + + __SANDBOX.upInterface().loginSecureDiskFromIndex (aTargetMediaID, + result, + "", + "", + "", + 1, + _securedisk_result); + } + else + { + aDialogParam.args.completeCallback(aDialogParam); + } + }, + oncancel: function(e) { + savepassDialog.dispose() + __fn_final (); + }, + args: {messageType: "request", inputType: aInputType} + }); + savepassDialog.show(); + } + /****************************************************************************************** + * 안전디스크 설치 확인 + ******************************************************************************************/ + var _securedisk = function() + { + _securedisk_install = function() { + var aURL = AnySign.mSecureDiskData.mInstallURL; + var aOption = AnySign.mSecureDiskData.mInstallPageOption; + if (aURL == null || aURL == undefined || aURL == "") { + if (typeof AnySign.mLanguage === 'string' && AnySign.mLanguage.toLowerCase() == "ko-kr") + alert (XW_SECUREDISK_NOTABLE_MSG); + else + alert (XW_SECUREDISK_NOTABLE_MSG_en); + } else { + var aConfirmMsg; + if (typeof AnySign.mLanguage === 'string' && AnySign.mLanguage.toLowerCase() == "ko-kr") + aConfirmMsg = XW_SECUREDISK_INSTALL_MSG; + else + aConfirmMsg = XW_SECUREDISK_INSTALL_MSG_en; + + if (confirm(aConfirmMsg) == true) + window.open (aURL, 'DownLoadPage', aOption); + } + } + + _initializeSecureDiskFromName = function (result) { + if (result == 0) { + _savepasswd(); + } else { + var aErrorObject = __SANDBOX.upInterface().setErrCodeAndMsg(); + if (aErrorObject.code == XW_ERROR_SECUREDISK_LOAD_FAILED) { + _securedisk_install (); + } else { + alert(aErrorObject.msg.replace(/\\n/g, '\r\n')); + } + } + + } + + _getMediaList = function (providerName) { + if (providerName == "") { + _securedisk_install (); + } else { + aTargetMediaID = aTargetMediaID + 1; + aTargetProviderName = providerName; + __SANDBOX.upInterface().initializeSecureDiskFromName(providerName, _initializeSecureDiskFromName); + } + } + + __SANDBOX.upInterface().getMediaList(XW_CERT_LOCATION_SECUREDISK, 0, 1, _getMediaList); + } + /****************************************************************************************** + * 보안토큰 종류 선택 + ******************************************************************************************/ + var _hsmselect = function() + { + var hsmselectModule = __SANDBOX.loadModule("hsmselect"); + var hsmselectDialog = hsmselectModule({ + width: 335, height: 200, + onconfirm: function(result, providerName) { + aTargetMediaID = aTargetMediaID + result; + hsmselectDialog.dispose(); + AnySign.SetUITarget(hsmselectDialog.getUITarget()); + if(result < 0) { + return; + } + _verifyhsm (); + }, + oncancel: function(e) {hsmselectDialog.dispose()} + }); + hsmselectDialog.show(); + } + /****************************************************************************************** + * 보안토큰 핀번호 입력 + ******************************************************************************************/ + var _verifyhsm = function() + { + var _loginPKCS11FromIndex_callback = function(result) { + if(result != 0) { + var aErrorObject = __SANDBOX.upInterface().setErrCodeAndMsg(); + var _final_callback = function () { + alert(aErrorObject.msg.replace(/\\n/g, '\r\n')); + _verifyhsm (); + } + __fn_final (_final_callback); + } else { + aDialogParam.args.newPasswd = ""; + aDialogParam.args.completeCallback(aDialogParam); + } + } + + var verifyhsmModule = __SANDBOX.loadModule("verifyhsm"); + var verifyhsmDialog = verifyhsmModule({ + args: {messageType: "request" }, + onconfirm: function(result) { + verifyhsmDialog.dispose(); + __show_guidewindow (); + __SANDBOX.upInterface().loginPKCS11FromIndex(aTargetMediaID, result, _loginPKCS11FromIndex_callback); + }, + oncancel: function(e) { + verifyhsmDialog.dispose(); + __fn_final (); + } + }); + verifyhsmDialog.show(); + } + /****************************************************************************************** + * 저장토큰 자동 선택 + ******************************************************************************************/ + var _iccardselect = function() + { + aTargetMediaID = XW_CERT_LOCATION_ICCARD + 1; + aTargetMediaType = XW_CERT_LOCATION_ICCARD; + __SANDBOX.upInterface().getMediaList(XW_CERT_LOCATION_ICCARD, 0, 1, _iccard_login); + } + /****************************************************************************************** + * 저장토큰 종류 선택 + ******************************************************************************************/ + var _iccardlist = function() + { + var iccardlistModule = __SANDBOX.loadModule("iccardlist"); + var iccardlistDialog = iccardlistModule({ + args: {}, + onconfirm: function (aResult) { + iccardlistDialog.dispose(); + aTargetMediaID = XW_CERT_LOCATION_ICCARD + aResult; + _iccard_login(); + }, + oncancel: function () { + iccardlistDialog.dispose(); + } + }); + iccardlistDialog.show(); + } + /****************************************************************************************** + * KEPCO IC 카드 설치 확인 + ******************************************************************************************/ + var _kepcoiccard = function () + { + _CB_initStoreToken = function (aResult) { + if (!__SANDBOX.isFailed(aResult, aErrCallback)) { + aTargetMediaID = XW_CERT_LOCATION_KEPCOICCARD + 1; + _iccard_login(); + } + } + __SANDBOX.upInterface().initStoreToken(XW_CERT_LOCATION_KEPCOICCARD + 1, _CB_initStoreToken); + } + /****************************************************************************************** + * 저장토큰 암호 입력 + ******************************************************************************************/ + var _iccard_login = function () + { + var loginStoreToken_callback = function (result) { + if (result!= 0) { + var aErrorObject = __SANDBOX.upInterface().setErrCodeAndMsg(); + var _final_callback = function () { + alert(aErrorObject.msg.replace(/\\n/g, '\r\n')); + _iccard_login(); + } + __fn_final (_final_callback); + } else { + _savepasswd(); + } + } + + var aICCardType; + if (aTargetMediaType == XW_CERT_LOCATION_KEPCOICCARD) + aICCardType = "kepco"; + else + aICCardType = "iccard"; + + var iccardModule = __SANDBOX.loadModule("iccard"); + var iccardDialog = iccardModule({ + type: aICCardType, + args: { }, + onconfirm: function (aPin) { + iccardDialog.dispose(); + __show_guidewindow (); + __SANDBOX.upInterface().loginStoreToken(aTargetMediaID, aPin, 1, loginStoreToken_callback); + }, + oncancel: function () { + iccardDialog.dispose(); + } + }); + iccardDialog.show(); + } + /******************************************************************************************/ + + if (aMediaType == XW_CERT_LOCATION_ICCARD || aMediaType == XW_CERT_LOCATION_KEPCOICCARD) { + _iccard_pin_dialog (); + } else if (aShowRenewCertSaveLoc) { + if (aDialogParam.args.dialog) { + aDialogParam.args.dialog.dispose (); + aDialogParam.args.dialog = null; + } + _certsaveloc (); + } else { + if (aMediaType == XW_CERT_LOCATION_PKCS11 || aMediaType == XW_CERT_LOCATION_SECUREDISK) { + aDialogParam.args.newPasswd = ""; + aDialogParam.args.completeCallback(aDialogParam); + } else { + _savepasswd_dialog (); + } + } + } + + // set default values; + aDialogParam.width = 437; + aDialogParam.height = 410; + aDialogParam.type = "renew"; + aDialogParam.args = aDialogArgs; + + aDialogParam.args ={funcname : "RenewCertificate", + caPort : aCAPort , + caHTTPPort : aCAHTTPPort, + caAddr : aCAAddr , + caHTTPAddr : aCAHTTPAddr, + caHTTPService : aCAHTTPService, + caType : aCAType , + certLocation : aCertLocation, + workerNum : aWorkerNum, + workerScript : aWorkerScript, + option : 0 , // aOption : 0 + keywordTryLimit : aKeywordTryLimit, + certSerial : aCertSerial, + completeCallback : completeCallback, + showSavePasswdDialog: showSavePasswdDialog, + userCallback : aUserCallback, + errCallback : aErrCallback} + + aDialogParam.onconfirm = null; + aDialogParam.oncancel = null; + + __SANDBOX.showCertselectDialogCommon(aDialogParam); + }, + + RevokeCertificate: function(aCAPort, aCAAddr, aJobCode, aReason, aCAType, aKeywordTryLimit, + aUserCallback, aErrCallback) + { + var aDialogParam = {}; + var aDialogArgs = {}; + var aGuideModule; + var aGuideDialog = null; + + if (aErrCallback == undefined) + { + aErrCallback = gErrCallback_common; + } + + /****************************************************************************************** + * guidewindow function + ******************************************************************************************/ + __show_guidewindow = function () + { + if (aGuideDialog) return; + + aGuideModule = __SANDBOX.loadModule("guidewindow"); + aGuideDialog = aGuideModule({ + type: "loading", + args: "", + onconfirm: "", + oncancel: function () {aGuideDialog.dispose();} + }); + aGuideDialog.show(); + } + + __close_guidewindow = function () + { + if (aGuideDialog) { + aGuideDialog.dispose (); + aGuideDialog = null; + } + } + /****************************************************************************************** + * final function + ******************************************************************************************/ + __fn_final = function (aCallback) + { + var _final_callback = function () { + __close_guidewindow (); + + if (aCallback) + aCallback (); + } + + var aMediaType = Math.floor(aDialogParam.args.mediaID / 100) * 100; + + if (aMediaType == XW_CERT_LOCATION_ICCARD || aMediaType == XW_CERT_LOCATION_KEPCOICCARD) { + __SANDBOX.upInterface().logoutStoreToken(aDialogParam.args.mediaID, _final_callback); + } else if (aMediaType == XW_CERT_LOCATION_PKCS11) { + __SANDBOX.upInterface().finalizePKCS11FromIndex (aDialogParam.args.mediaID, _final_callback); + } else if (aMediaType == XW_CERT_LOCATION_SECUREDISK) { + __SANDBOX.upInterface().finalizeSecureDiskFromName (aDialogParam.args.providerName, _final_callback); + } else { + _final_callback (); + } + } + /****************************************************************************************** + * revokeCertificate callback function + ******************************************************************************************/ + _CB_RevokeCertificate = function (aResult) + { + if (__SANDBOX.isFailed (aResult, aErrCallback) ) + { + __fn_final (); + } + else + { + var _final_callback = function () { + aUserCallback (0); + } + __fn_final (_final_callback); + } + } + /******************************************************************************************/ + + function completeCallback(aDialogParam) { + + if (aDialogParam.args.dialog) + aGuideDialog = aDialogParam.args.dialog; + else + __show_guidewindow (); + + __SANDBOX.upInterface().revokeCertificate (aDialogParam.args.caPort, + aDialogParam.args.caAddr, + aDialogParam.args.issuerRDN, + aDialogParam.args.certSerial, + aDialogParam.args.mediaID, + aDialogParam.args.jobCode, + aDialogParam.args.reason, + aDialogParam.args.caType, + aDialogParam.args.oldPasswd, + _CB_RevokeCertificate); + } + + aDialogParam.width = 437; + aDialogParam.height = 410; + aDialogParam.type = "revoke"; + aDialogParam.args = aDialogArgs; + + aDialogParam.args ={funcname : "RevokeCertificate", + caPort : aCAPort , + caAddr : aCAAddr , + jobCode : aJobCode , + reason : aReason , + caType : aCAType , + option : 0 , // aOption : 0 + keywordTryLimit : aKeywordTryLimit, + completeCallback: completeCallback, + userCallback : aUserCallback, + errCallback : aErrCallback} + + aDialogParam.onconfirm = null; + aDialogParam.oncancel = null; + + __SANDBOX.showCertselectDialogCommon(aDialogParam); + }, + + ShowCertManager: function (aErrCallback) + { + __SANDBOX.setAfterAction (function () { + if (aErrCallback == undefined) + { + aErrCallback = gErrCallback_common; + } + + var module = loadModule ("certmanager"); + var dialog = module ( + { + args: { + errCallback: aErrCallback + }, + onconfirm: function () { dialog.dispose (); }, + oncancel: function () { dialog.dispose (); } + }); + if (dialog) + dialog.show(); + }, ""); + }, + + InstallCertificate: function (aMediaID, + aType, + aCertificate, + aKeyword, + aUserCallback) + { + __SANDBOX.setAfterAction (function () { + _CB_InstallCertificate = function (result) + { + if (__SANDBOX.isFailed (result, gErrCallback_common)) + return; + + aUserCallback (result); + } + + __SANDBOX.upInterface().installCertificate (aMediaID, aType, aCertificate, aKeyword, _CB_InstallCertificate); + }, ""); + }, + + SetIssuerConvertTable: function (aIssuer, + aConvertedPool, + aComment, + aLanguage) + { + // AnySign4PC setting + var aIssuerData = {type: "issuer", param1: aIssuer, param2: aConvertedPool, param3: aComment, param4: aLanguage}; + __SANDBOX.convertTable.push (aIssuerData); + + // AnySignLite setting + if (AnySign.mAnySignLiteSupport) + { + var aAnySign = AnySign.mAnySignEnable; + AnySign.mAnySignEnable = false; + + var _setIssuerConvertTable_callback = function (aResult) { + __SANDBOX.isFailed (aResult, gErrCallback_common); + AnySign.mAnySignEnable = aAnySign; + } + + __SANDBOX.upInterface().setIssuerConvertTable (aIssuer, aConvertedPool, aComment, aLanguage, _setIssuerConvertTable_callback); + } + }, + + SetPolicyConvertTable: function (aPolicy, + aConvertedPool, + aComment, + aLanguage) + { + // AnySign4PC setting + var aPolicyData = {type: "policy", param1: aPolicy, param2: aConvertedPool, param3: aComment, param4: aLanguage}; + __SANDBOX.convertTable.push (aPolicyData); + + // AnySignLite setting + if (AnySign.mAnySignLiteSupport) + { + var aAnySign = AnySign.mAnySignEnable; + AnySign.mAnySignEnable = false; + + var _setPolicyConvertTable_callback = function (aResult) { + __SANDBOX.isFailed (aResult, gErrCallback_common); + AnySign.mAnySignEnable = aAnySign; + } + + __SANDBOX.upInterface().setPolicyConvertTable (aPolicy, aConvertedPool, aComment, aLanguage, _setPolicyConvertTable_callback); + } + }, + + EnvelopeData: function (aXgateAddress, + aCAList, + aPlainData, + aEnvelopeOption, + aEnvelopeKeyword, + aEnvelopeCertPEM, + aCertSerial, + aCertLocation, + aDescription, + aUserCallback, + aErrCallback) + { + var aResult; + var aEnvelopeType; + + if (aErrCallback == undefined) + { + aErrCallback = gErrCallback_common; + } + + if (aEnvelopeOption & 1) + { + if (!aEnvelopeCertPEM) + aEnvelopeType = "CERT"; + else + aEnvelopeType = "PEM"; + + } + else if (aEnvelopeOption & 2) + { + aEnvelopeType = "PASSWD"; + } + + switch(aEnvelopeType) + { + case "CERT": + aResult = this.EnvelopeDataWithCert (aXgateAddress, + aCAList, + aPlainData, + aEnvelopeOption, + aCertSerial, + aCertLocation, + aDescription, + aUserCallback, + aErrCallback) + break; + case "PEM": + aResult = this.EnvelopeDataWithPEM (aPlainData, + aEnvelopeOption, + aEnvelopeCertPEM, + aUserCallback, + aErrCallback); + break; + case "PASSWD": + aResult = this.EnvelopeDataWithPasswd (aPlainData, + aEnvelopeOption, + aEnvelopeKeyword, + aUserCallback, + aErrCallback) + break; + default: + alert("Unknown EnvelopeOption"); + return; + } + }, + + EnvelopeDataWithPEM: function (aPlainData, + aEnvelopeOption, + aEnvCertPEM, + aUserCallback, + aErrCallback) + { + __SANDBOX.setAfterAction (function () { + // AnySign4PC 로딩 되어 있으면 AnySign4PC 사용 + if (AnySign.mAnySignLoad) + AnySign.mAnySignEnable = true; + + _CB_envelopeDataWithPEM = function (aResult) { + if (__SANDBOX.isFailed(aResult, aErrCallback)) + { + return; + } + + aUserCallback(aResult); + } + + __SANDBOX.upInterface().envelopeDataWithPEM(aPlainData, + aEnvelopeOption, + aEnvCertPEM, + _CB_envelopeDataWithPEM); + }, ""); + }, + + EnvelopeDataWithCert: function (aXgateAddress, + aCAList, + aPlainData, + aEnvelopeOption, + aCertSerial, + aCertLocation, + aDescription, + aUserCallback, + aErrCallback) + { + if (aErrCallback == undefined) + { + aErrCallback = gErrCallback_common; + } + + var aDialogParam = {}; + var aDialogArgs = {}; + + var aMediaIDList = ""; + var aIssuerRDNList = ""; + var aCertSerialList = ""; + var aDisablePFX = false; + + //인증서 선택 다이얼로그 호출 함수 + var _showCertSelect = function(aOption) { + aDialogParam = {}; + aDialogArgs = {}; + + var aMulticert = false; + if(aOption == 1) { // add cert + if(AnySign.mAnySignEnable) { + // AnySign4PC + aCertLocation = 1; + } else { + // AnySignLite + aCertLocation = 2000; + } + aMulticert = true; + } + + // set default values; + aDialogParam.width = 437; + aDialogParam.height = 457; + aDialogParam.type = "envelope"; + aDialogParam.args = aDialogArgs; + + aDialogParam.args ={funcname : "EnvelopeDataWithCert", + multicert : aMulticert, + disablePFX : aDisablePFX, + xgateAddress : aXgateAddress, + caList : aCAList, + plain : aPlainData, + certSerial : aCertSerial, + certLocation : aCertLocation, + option : (aEnvelopeOption & 0x100) ? 0x10 : 0, // ?? + description : aDescription, + userCallback : _showCertSelect_callback, + errCallback : aErrCallback}; + + aDialogParam.onconfirm = null; + aDialogParam.oncancel = null; + + __SANDBOX.showCertselectDialogCommon(aDialogParam); + } + + //인증서 선택 다이얼로그 Callback 함수 + var _showCertSelect_callback = function(aResult) { + + aMediaIDList += aResult.mediaID + "\t\n"; + aIssuerRDNList += aResult.issuerRDN + "\t\n"; + aCertSerialList += aResult.certSerial + "\t\n"; + + if (aEnvelopeOption & XW_OPTION_ENVELOPE_MULTI_CERT) + { + if(aResult.mediaID == XW_CERT_LOCATION_MEMORYSTORAGE) + aDisablePFX = true; + + _confirmNextCert(); + } + else + { + _envelopeDataWithCert(); + } + } + + //인증서 계속 선택 확인 다이얼로그 호출 + var _confirmNextCert = function() { + var aCommonDialogModule = __SANDBOX.loadModule("commondialog"); + AnySign.SetUITarget (aDialogParam.dialog.getUITarget()); + var aCommonDialog = aCommonDialogModule ({ + width: 350, + height: 0, + onconfirm: function() { + aCommonDialog.dispose(); + AnySign.SetUITarget (aCommonDialog.getUITarget()); + _showCertSelect(1); + }, + oncancel: function(e) { + aCommonDialog.dispose(); + _envelopeDataWithCert(); + }, + args: {dialogType: "confirm", + messageType: "envelopeDataWithCert_confirmNextCert"} + }); + + if (aCommonDialog) aCommonDialog.show(); + } + + //실제 전자봉투(Cert) 함수 + var _envelopeDataWithCert = function() { + + var aResultData; + + /****************************************************************************************/ + _userCallback = function () + { + aUserCallback(aResultData); + } + + _envelopeCertCallback = function (result) + { + if ( __SANDBOX.isFailed(result, aErrCallback) ) + return; + + aResultData = result; + + var mediaID; + var index = aMediaIDList.indexOf("\t\n"); + + _finalCheck = function () + { + if (index > 0) { + mediaID = aMediaIDList.substring (0, index); + aMediaIDList = aMediaIDList.substring (index + 2, aMediaIDList.length); + index = aMediaIDList.indexOf("\t\n"); + + if ((Math.floor(mediaID / 100) * 100) == XW_CERT_LOCATION_PKCS11) { + __SANDBOX.upInterface().finalizePKCS11FromIndex (mediaID, _finalCheck); + } else { + _finalCheck (); + } + } else { + _userCallback (); + } + } + + _finalCheck (); + } + /****************************************************************************************/ + + __SANDBOX.upInterface().envelopeDataWithCert (aPlainData, + aEnvelopeOption, + aMediaIDList, + aIssuerRDNList, + aCertSerialList, + _envelopeCertCallback); + } + + //excute + _showCertSelect(); + }, + + + EnvelopeDataWithPasswd: function (aPlainData, + aEnvelopeOption, + aKeyword, + aUserCallback, + aErrCallback) + { + __SANDBOX.setAfterAction (function () { + // AnySign4PC 로딩 되어 있으면 AnySign4PC 사용 + if (AnySign.mAnySignLoad) + AnySign.mAnySignEnable = true; + + var aResult; + var aInputType; + + if (AnySign.mAnySignEnable) + aInputType = "4pc"; + else + aInputType = "lite"; + + if (aErrCallback == undefined) + { + aErrCallback = gErrCallback_common; + } + + _envelopeDataWithPasswd_callback = function (envelopeData) + { + if ( __SANDBOX.isFailed(envelopeData, aErrCallback) ) + return; + + aUserCallback(envelopeData); + } + + _CB_setSecureInput = function (result) { + _envelopeDataWithPasswd (aKeyword); + } + + // 비밀번호 입력 + var _inputPassword = function () + { + var aPasswordModule = __SANDBOX.loadModule("inputpasswd"); + + var aInputPasswdDialog = aPasswordModule ({ + width: 350, + height: 0, + onconfirm: function (aResult) { + aInputPasswdDialog.dispose(); + _envelopeDataWithPasswd (aResult); + }, + oncancel: function (e) { + aInputPasswdDialog.dispose(); + }, + args: {messageType: "common", + inputType: aInputType} + }); + + if (aInputPasswdDialog) aInputPasswdDialog.show(); + } + + // 전자봉투 (Password) + var _envelopeDataWithPasswd = function (aKeyword) + { + + __SANDBOX.upInterface().envelopeDataWithPasswd (aPlainData, + aEnvelopeOption, + aKeyword, + _envelopeDataWithPasswd_callback); + } + + // excute + if(!aKeyword) + { + _inputPassword(); + } + else + { + __SANDBOX.upInterface().setSecureInput ("", _CB_setSecureInput); + } + }, ""); + }, + + DeEnvelopeData: function (aXgateAddress, + aCAList, + aEnvelopedData, + aDeEnvOption, + aDeEnvKeyword, + aDescription, + aLimitTrial, + aUserCallback, + aErrCallback) + { + var aResult; + + if (aErrCallback == undefined) + { + aErrCallback = gErrCallback_common; + } + + if (aDeEnvOption == 1) + { + this.DeEnvelopeDataWithCert (aXgateAddress, + aCAList, + aEnvelopedData, + aDescription, + aLimitTrial, + aUserCallback, + aErrCallback) + + } + else + { + this.DeEnvelopeDataWithPasswd (aEnvelopedData, + aDeEnvKeyword, + aUserCallback, + aErrCallback) + } + }, + + DeEnvelopeDataWithCert: function (aXgateAddress, + aCAList, + aEnvelopedData, + aDescription, + aLimitTrial, + aUserCallback, + aErrCallback) + { + if (aErrCallback == undefined) + { + aErrCallback = gErrCallback_common; + } + + + var aCertSerial = 0; + + //인증서 선택 다이얼로그 호출 함수 + var _showCertSelect = function() { + var aDialogParam = {}; + var aDialogArgs = {}; + + // set default values; + aDialogParam.width = 437; + aDialogParam.height = 457; + aDialogParam.type = "deenvelope"; + aDialogParam.args = aDialogArgs; + + aDialogParam.args ={funcname : "DeEnvelopeDataWithCert", + xgateAddress : aXgateAddress, + caList : aCAList, + certSerial : aCertSerial, + option : 0, + description : aDescription, + keywordTryLimit : aLimitTrial, + userCallback : _deEnvelopeDataWithCert, + errCallback : aErrCallback}; + + aDialogParam.onconfirm = null; + aDialogParam.oncancel = null; + + __SANDBOX.showCertselectDialogCommon(aDialogParam); + } + + //실제 전자봉투(Cert) 함수 + var _deEnvelopeDataWithCert = function(aResult) { + + var aMediaID = aResult.mediaID, + aIssuerRDN = aResult.issuerRDN, + aCertSerial = aResult.certSerial, + aKeyword = aResult.passwd, + aResultData; + + /****************************************************************************************/ + _userCallback = function () + { + aUserCallback(aResultData); + } + + _deEnvelopeCertCallback = function (result) + { + if ( __SANDBOX.isFailed(result, aErrCallback) ) + return; + + aResultData = result; + + if ((Math.floor(aMediaID / 100) * 100) == XW_CERT_LOCATION_PKCS11) { + __SANDBOX.upInterface().finalizePKCS11FromIndex (aMediaID, _userCallback); + } else { + _userCallback (); + } + } + /****************************************************************************************/ + + __SANDBOX.upInterface().deEnvelopeDataWithCert (aEnvelopedData, + aMediaID, + aIssuerRDN, + aCertSerial, + aKeyword, + _deEnvelopeCertCallback); + } + + //excute + _showCertSelect(); + }, + + DeEnvelopeDataWithCacheCert: function (aXgateAddress, + aEnvelopedData, + aUserCallback, + aErrCallback) + { + __SANDBOX.setAfterAction (function () { + var aMediaID; + + if (aErrCallback == undefined) + aErrCallback = gErrCallback_common; + + _deEnvelopeCertCallback = function (aResult) { + if ( __SANDBOX.isFailed(aResult, aErrCallback) ) + return; + + aUserCallback (aResult); + } + + _CB_hasCachedData = function (aResult) { + if (!aResult) { + var aErrorObject = {}; + aErrorObject.code = -1; + aErrorObject.msg = XW_ERROR_MSG_SIGNCACHE1; + aErrCallback(aErrorObject); + return; + } + + __SANDBOX.upInterface().deEnvelopeDataWithCacheCert (aXgateAddress, + aEnvelopedData, + aMediaID, + "", + "", + "", + _deEnvelopeCertCallback); + } + + _CB_getLastLocation = function (aResult) { + if (aResult < 0) + aMediaID = 0; + else + aMediaID = aResult; + + if (__SANDBOX.getInputType(aMediaID) == "4pc") + AnySign.mAnySignEnable = true; + + __SANDBOX.setAfterAction (function () { + __SANDBOX.upInterface().hasCachedData (aXgateAddress, _CB_hasCachedData); + }, ""); + } + + __SANDBOX.upInterface().getLastLocation (_CB_getLastLocation); + }, ""); + }, + + DeEnvelopeDataWithPasswd: function (aEnvelopedData, + aDeEnvKeyword, + aUserCallback, + aErrCallback) + { + __SANDBOX.setAfterAction (function () { + // AnySign4PC 로딩 되어 있으면 AnySign4PC 사용 + if (AnySign.mAnySignLoad) + AnySign.mAnySignEnable = true; + + var aInputType; + + if (AnySign.mAnySignEnable) + aInputType = "4pc"; + else + aInputType = "lite"; + + if (aErrCallback == undefined) + { + aErrCallback = gErrCallback_common; + } + + var _deEnvelopeDataWithPasswd_callback = function (result) + { + if ( __SANDBOX.isFailed(result, aErrCallback) ) + { + return; + } + + aUserCallback(result); + } + + _CB_setSecureInput = function (result) { + _deEnvelopeDataWithPasswd (aDeEnvKeyword); + } + + // 비밀번호 입력 + var _inputPassword = function () + { + var aPasswordModule = __SANDBOX.loadModule("inputpasswd"); + + var aInputPasswdDialog = aPasswordModule ({ + width: 350, + height: 0, + onconfirm: function (aResult) { + _deEnvelopeDataWithPasswd (aResult); + aInputPasswdDialog.dispose(); + }, + oncancel: function (e) { + aInputPasswdDialog.dispose(); + }, + args: {messageType: "common", + inputType: aInputType} + }); + + if (aInputPasswdDialog) aInputPasswdDialog.show(); + } + + // 전자봉투 (Password) + var _deEnvelopeDataWithPasswd = function (aKeyword) + { + __SANDBOX.upInterface().deEnvelopeDataWithPasswd (aEnvelopedData, + aKeyword, + _deEnvelopeDataWithPasswd_callback); + } + + // excute + if(!aDeEnvKeyword) + { + _inputPassword(); + } + else + { + __SANDBOX.upInterface().setSecureInput ("", _CB_setSecureInput); + } + }, ""); + }, + + SetCharset: function (aCharset, aUserCallback) + { + var aAnySign = AnySign.mAnySignEnable; + AnySign.mCharset = aCharset; + + var _setCharset2_callback = function (result) { + AnySign.mAnySignEnable = aAnySign; + aUserCallback (0); + } + + var _setCharset1_callback = function (result) { + if (AnySign.mAnySignLoad) { + // AnySign4PC setting + AnySign.mAnySignEnable = true; + __SANDBOX.upInterface().setCharset (aCharset, _setCharset2_callback); + } else { + _setCharset2_callback (); + } + } + + if (AnySign.mAnySignLiteSupport) { + // AnySignLite setting + AnySign.mAnySignEnable = false; + __SANDBOX.upInterface().setCharset (aCharset, _setCharset1_callback); + } else { + _setCharset1_callback (); + } + }, + + GetLastLocation: function(aUserCallback) + { + __SANDBOX.setAfterAction (function () { + __SANDBOX.upInterface().getLastLocation (aUserCallback); + }, ""); + }, + + GetCacheCertLocation: function(aXgateAddress, aUserCallback) + { + __SANDBOX.setAfterAction (function () { + __SANDBOX.upInterface().getCacheCertLocation (aXgateAddress, aUserCallback); + }, ""); + }, + + GetCacheCertLocationEx: function(aXgateAddress, aOption, aUserCallback) + { + __SANDBOX.setAfterAction (function () { + __SANDBOX.upInterface().getCacheCertLocationEx(aXgateAddress, aOption, aUserCallback); + }, ""); + }, + + ClearCachedData: function(aXgateAddress, aOption, aUserCallback) + { + var aAnySign = AnySign.mAnySignEnable; + + var _clearCachedData2_callback = function (result) { + AnySign.mAnySignEnable = aAnySign; + aUserCallback (0); + } + + var _clearCachedData1_callback = function (result) { + if (AnySign.mAnySignLoad) { + // AnySign4PC setting + AnySign.mAnySignEnable = true; + __SANDBOX.upInterface().clearCachedData (aXgateAddress, aOption, _clearCachedData2_callback); + } else { + _clearCachedData2_callback (); + } + } + + if (AnySign.mAnySignLiteSupport) { + // AnySignLite setting + AnySign.mAnySignEnable = false; + __SANDBOX.upInterface().clearCachedData(aXgateAddress, aOption, _clearCachedData1_callback); + } else { + _clearCachedData1_callback (); + } + }, + + GetCertInfoEx: function (aSignedData, aOriginalData, aOpOption, aInfoOption, aVerifyOption, aUserCallback) + { + __SANDBOX.setAfterAction (function () { + __SANDBOX.upInterface().getCertInfoEx (aSignedData, aOriginalData, aOpOption, aInfoOption, aVerifyOption, aUserCallback); + }, ""); + }, + + VerifyData: function (aSignedData, aOriginalData, aOption, aUserCallback) + { + __SANDBOX.setAfterAction (function () { + __SANDBOX.upInterface().verifyData (aSignedData, aOriginalData, aOption, aUserCallback); + }, ""); + }, + + Wif: function(aOption, aPEM, aUserCallback) + { + __SANDBOX.setAfterAction (function () { + __SANDBOX.upInterface().wif (aOption, aPEM, aUserCallback); + }, ""); + }, + + XecureLink: function(aXgateAddress, aLink) + { + var aPath = null; + var aHash = null; + var aPlain = null; + var aCharset = AnySign.mEncCharset; + + aPath = aLink.pathname; + + if (__SANDBOX.isIE () < 10) + { + aPath = "/" + aPath; + } + + aHash = aLink.hash; + + if (aLink.search.length > 1) + { + aPlain = aLink.search.substring (1); + } + else + { + aPlain = ""; + } + + /***********************************************************************/ + _blockEncCallback = function (result) + { + var aURL = null; + var aTarget = null; + var aData = null; + + aData = escape_url (result); + + aURL = aPath; + aURL += aHash; + aURL += "?q="; + aURL += aData; + + if (aCharset == "euc-kr") + aURL += "&charset=EUC-KR"; + else + aURL += "&charset=UTF-8"; + + if (aLink.target == null || aLink.target == "") + { + aTarget = "_self"; + } + else + { + aTarget = aLink.target; + } + + open (aURL, aTarget); + } + /***********************************************************************/ + + if (aCharset != "euc-kr") + aCharset = "utf-8"; + + __SANDBOX.upInterface ().blockEncAsync (aXgateAddress, aPath, aPlain, "GET", aCharset, _blockEncCallback); + + return false; + }, + + XecureSubmit: function(aXgateAddress, form, aSessionKey) + { + var aPath = getPath(form.action); + var aPlain = ""; + var cipher = ""; + var xecure_url = ""; + var aResult = ""; + var aCharset = AnySign.mEncCharset; + + if (aCharset != "euc-kr") + aCharset = "utf-8"; + + qs_begin_index = form.action.indexOf('?'); + if ( qs_begin_index >= 0) { + aPlain = form.action.substring(qs_begin_index + 1, form.action.length); + } + + document.xecure.target = form.target; + /********************************************************************************/ + _post_blockEncCallback_next = function (result) + { + document.xecure.p.value = result; + document.xecure.submit(); + } + /********************************************************************************/ + + /********************************************************************************/ + _post_blockEncCallback = function (result) + { + var cipher = result; + + if (aCharset == "euc-kr") + document.xecure.action = aPath + "?q=" + escape_url(result) + "&charset=EUC-KR"; + else + document.xecure.action = aPath + "?q=" + escape_url(result) + "&charset=UTF-8"; + + if (cipher != "") { + posting_data = XecureMakePlain(form); + + if (aSessionKey != undefined && aSessionKey != null && aSessionKey != "") { + __SANDBOX.upInterface().blockEncConvertAsync (aXgateAddress, + aPath, + aSessionKey, + posting_data, + "POST", + aCharset, + _post_blockEncCallback_next); + } else { + __SANDBOX.upInterface().blockEncAsync (aXgateAddress, + aPath, + posting_data, + "POST", + aCharset, + _post_blockEncCallback_next); + } + } + else { + _post_blockEncCallback_next (cipher); + } + } + /********************************************************************************/ + + /********************************************************************************/ + _get_blockEncCallback = function (result) + { + if (aCharset == "euc-kr") + xecure_url = aPath + "?q=" + escape_url(result) + "&charset=EUC-KR"; + else + xecure_url = aPath + "?q=" + escape_url(result) + "&charset=UTF-8"; + + if (form.target == "" || form.target == null) + form.target = "_self"; + + open (xecure_url, form.target); + } + /********************************************************************************/ + + if (form.method == "get" || form.method == "GET") { + // Get Method + + if (aPlain.length != 0) + aPlain += "&" + XecureMakePlain(form); + else + aPlain = XecureMakePlain(form); + + if (aSessionKey != undefined && aSessionKey != null && aSessionKey != "") { + __SANDBOX.upInterface().blockEncConvertAsync (aXgateAddress, + aPath, + aSessionKey, + aPlain, + "GET", + aCharset, + _get_blockEncCallback); + } else { + __SANDBOX.upInterface().blockEncAsync (aXgateAddress, + aPath, + aPlain, + "GET", + aCharset, + _get_blockEncCallback); + } + } + else { + // Post Method + document.xecure.method = "post"; + + if (aSessionKey != undefined && aSessionKey != null && aSessionKey != "") { + __SANDBOX.upInterface().blockEncConvertAsync (aXgateAddress, + aPath, + aSessionKey, + aPlain, + "GET", + aCharset, + _post_blockEncCallback); + } + else { + __SANDBOX.upInterface().blockEncAsync (aXgateAddress, + aPath, + aPlain, + "GET", + aCharset, + _post_blockEncCallback); + } + } + + return false; + }, + + XecureNavigate: function(aXgateAddress, url, aTarget, aFeature) + { + var aPlain = ""; + var aPath = null; + var aCipher = null; + var aURL = null; + var qs_begin_index = url.indexOf('?'); + var aCharset = AnySign.mEncCharset; + + if (aCharset != "euc-kr") + aCharset = "utf-8"; + + aPath = getPath(url) + + if (qs_begin_index >= 0) { + aPlain = url.substring(qs_begin_index + 1, url.length ); + } + + /********************************************************************************/ + _blockEncCallback = function (result) + { + result = escape_url (result); + + aURL = aPath; + aURL += "?q="; + aURL += result; + + if (aCharset == "euc-kr") + aURL += "&charset=EUC-KR"; + else + aURL += "&charset=UTF-8"; + + aFeature = aFeature || undefined; + + open(aURL, aTarget, aFeature); + } + /********************************************************************************/ + + __SANDBOX.upInterface ().blockEncAsync (aXgateAddress, aPath, aPlain, "GET", aCharset, _blockEncCallback); + + return false; + }, + + BlockEnc: function(aXgateAddress, aPath, aPlain, aMethod, aUserCallback) { + __SANDBOX.upInterface().blockEnc (aXgateAddress, aPath, aPlain, aMethod, aUserCallback); + }, + + BlockEnc2: function(aXgateAddress, aPath, aPlain, aMethod, aCharset, aUserCallback) { + __SANDBOX.upInterface().blockEnc2 (aXgateAddress, aPath, aPlain, aMethod, aCharset, aUserCallback); + }, + + BlockEncEx: function(aXgateAddress, aPath, aPlain, aMethod, aCharset, aUserCallback, aParam) { + __SANDBOX.upInterface().blockEncAsync (aXgateAddress, aPath, aPlain, aMethod, aCharset, aUserCallback, aParam); + }, + + BlockDecEx: function(aXgateAddress, aCipher, aCharSet, aElement, aUserCallback, aParam) { + var aResult = __SANDBOX.upInterface().blockDecEx (aXgateAddress, aCipher, aCharSet, aElement, aUserCallback, aParam); + return aResult ? aResult : ""; + }, + + getKTBScanInfo: function(aServerIP, aServerPort, aUserCallback) + { + __SANDBOX.setAfterAction (function () { + __SANDBOX.upInterface().getKTBScanInfo (aServerIP, aServerPort, aUserCallback); + }, ""); + }, + + FileHash: function(aFilePath, aAlg, aUserCallback, aErrCallback) + { + __SANDBOX.setAfterAction (function () { + var _fileHash_callback = function (aResult) + { + if (!__SANDBOX.isFailed(aResult, aErrCallback)) { + aUserCallback (aResult); + } + } + + __SANDBOX.upInterface().fileHash(aFilePath, aAlg, _fileHash_callback); + }, ""); + }, + + generateRandom: function (aLength, aOption, aUserCallback) + { + __SANDBOX.setAfterAction (function () { + __SANDBOX.upInterface().generateRandom (aLength, aOption, aUserCallback); + }, ""); + }, + + AnySign4PC_installCheck: function (aUserCallback) + { + AnySign.mExtensionSetting.mInstallCheck_CB = aUserCallback; + __SANDBOX.extension.GetWebSocket (); + }, + + AnySign4PC_installCallback: function (aUserCallback) + { + AnySign.mExtensionSetting.mInstallCheck_CB = aUserCallback; + }, + + AnySign4PC_LoadCallback: function (aUserCallback) + { + _load_callback = function (aResult) { + aUserCallback(); + } + + AnySign.mExtensionSetting.mImgIntervalError = false; + AnySign.mExtensionSetting.mLoadCallback.func = _load_callback; + AnySign.mExtensionSetting.mLoadCallback.param = ""; + }, + + setInfoDialog: function (aType, aRightoff) + { + if (!AnySign.mShowInfoDialog.enable) return; + + var aElement = document.getElementById('xwup_title_information'); + var aInfoDialog = __SANDBOX.informationDialog; + + if (aType == 'show') + { + if (aElement != null) return; + if (AnySign.mShowInfoDialog.close) return; + + var module = __SANDBOX.loadModule("information"); + __SANDBOX.informationDialog = module({ + onconfirm: "", + oncancel: function () { + __SANDBOX.informationDialog.dispose(); + __SANDBOX.informationDialog = null; + } + }); + + if (aRightoff) { + __SANDBOX.informationDialog.append(); + } else { + setTimeout(function () { + __SANDBOX.informationDialog.append(); + }, 0); + } + } + else + { + if (aElement == null) return; + __SANDBOX.informationDialog.dispose(); + __SANDBOX.informationDialog = null; + } + }, + + GetCertPath: function (aUserCallback, aErrCallback) + { + var aDialogParam = {}; + var aDialogArgs = {}; + + // set default values; + aDialogParam.width = 437; + aDialogParam.height = 457; + aDialogParam.type = "sign-no-pfx"; + aDialogParam.args = aDialogArgs; + + aDialogParam.args ={funcname : "GetCertPath", + xgateAddress : AnySign.mXgateAddress, + caList : AnySign.mCAList, + plain : "test", + option : 512, + description : 0, + keywordTryLimit : 3, + userCallback : aUserCallback, + errCallback : aErrCallback}; + + aDialogParam.onconfirm = null; + aDialogParam.oncancel = null; + + __SANDBOX.showCertselectDialogCommon(aDialogParam); + }, + + // added by leek55 20151203 + setBlockDec_callback: function (aUserCallback, aParam) + { + if ( AnySign.mPageBlockDecDone == false ) + { + var DecCallbackObject = { pageDecCallback : aUserCallback, pageDecCallbackParam : aParam }; + + AnySign.mExtensionSetting.mPageDecCallback.push(DecCallbackObject); + } + else + { + if(aParam) + aUserCallback(aParam); + else + aUserCallback(); + } + }, + // added end by leek55 + + // FCMS + SelectFile: function (aInitPath, + aFilterString, + aOption, + aUserCallback) + { + __SANDBOX.setAfterAction (function () { + __SANDBOX.upInterface().selectFile (aInitPath, aFilterString, aOption, aUserCallback); + }, ""); + }, + + SignFileEx: function (aXgateAddress, + aCAList, + aCertSerial, + aCertLocation, + aLimitTrial, + aInFilePath, + aOutFilePath, + aOption, + aDescription, + aUserCallback, + aErrCallback) + { + var aDialogParam = {}; + var aDialogArgs = {}; + + aDialogParam.width = 437; + aDialogParam.height = 457; + aDialogParam.type = "sign"; + aDialogParam.args = aDialogArgs; + + aDialogParam.args ={funcname : "SignFileEx", + xgateAddress : aXgateAddress, + caList : aCAList, + certSerial : aCertSerial, + certLocation : aCertLocation, + option : aOption, + description : aDescription, + keywordTryLimit : aLimitTrial, + inFilePath : aInFilePath, + outFilePath : aOutFilePath, + userCallback : aUserCallback, + errCallback : aErrCallback}; + + aDialogParam.onconfirm = null; + aDialogParam.oncancel = null; + + __SANDBOX.showCertselectDialogCommon(aDialogParam, 2); + }, + + SignFileExWithCacheCert: function (aXgateAddress, + aInFilePath, + aOutFilePath, + aOption, + aDescription, + aUserCallback, + aErrCallback) + { + __SANDBOX.setAfterAction (function () { + if (aErrCallback == undefined) + aErrCallback = gErrCallback_common; + + _CB_signDataCMS = function (aResult) { + if (!__SANDBOX.isFailed(aResult, aErrCallback)) + aUserCallback (aResult); + } + + _CB_getLastLocation = function (aResult) { + if (aResult < 0) + aResult = 0; + + __SANDBOX.upInterface().signFileEx (aXgateAddress, + aInFilePath, + aOutFilePath, + aResult, + "", + "", + "", + "", + aOption, + aDescription, + _CB_signDataCMS); + } + + _CB_hasCachedData = function (aResult) { + if (!aResult) { + var aErrorObject = {}; + aErrorObject.code = -1; + aErrorObject.msg = XW_ERROR_MSG_SIGNCACHE1; + aErrCallback(aErrorObject); + return; + } + + __SANDBOX.upInterface().getLastLocation (_CB_getLastLocation); + } + + __SANDBOX.upInterface().hasCachedData (aXgateAddress, _CB_hasCachedData); + }, ""); + }, + + SignFileExWithCacheCert2: function (aXgateAddress, + aInFilePath, + aOutFilePath, + aOption, + aDescription, + aUserCallback, + aErrCallback) + { + __SANDBOX.setAfterAction (function () { + var aParam = {}; + + aParam = { funcname : "SignFileEx", + xgateAddress : aXgateAddress, + option : aOption, + description : aDescription, + inFilePath : aInFilePath, + outFilePath : aOutFilePath, + userCallback : aUserCallback, + errCallback : aErrCallback}; + + __SANDBOX.processCacheCert(aParam); + }, ""); + }, + + ClearCacheCert2: function(aUserCallback) + { + if(!aUserCallback) + aUserCallback = function () {} + + var aResult = __SANDBOX.clearCacheCert (); + + aUserCallback (aResult); + }, + + SignFileExWithVID: function (aXgateAddress, + aCAList, + aCertSerial, + aCertLocation, + aLimitTrial, + aInFilePath, + aOutFilePath, + aIdn, + aSvrCert, + aOption, + aDescription, + aUserCallback, + aErrCallback) + { + var aDialogParam = {}; + var aDialogArgs = {}; + + aDialogParam.width = 437; + aDialogParam.height = 457; + aDialogParam.type = "sign"; + aDialogParam.args = aDialogArgs; + + aOption |= XW_FVIEW_CREATE_VID; + + aDialogParam.args ={funcname : "SignFileExWithVID", + xgateAddress : aXgateAddress, + caList : aCAList, + certSerial : aCertSerial, + certLocation : aCertLocation, + option : aOption, + description : aDescription, + keywordTryLimit : aLimitTrial, + inFilePath : aInFilePath, + outFilePath : aOutFilePath, + idn : aIdn, + cert : aSvrCert, + userCallback : aUserCallback, + errCallback : aErrCallback}; + + aDialogParam.onconfirm = null; + aDialogParam.oncancel = null; + + __SANDBOX.showCertselectDialogCommon(aDialogParam, 2); + }, + + SignFileExWithVID_CacheCert: function (aXgateAddress, + aInFilePath, + aOutFilePath, + aIdn, + aSvrCert, + aOption, + aDescription, + aUserCallback, + aErrCallback) + { + __SANDBOX.setAfterAction (function () { + var aMediaID; + var aVid; + var aSignedData = ""; + + aOption |= XW_FVIEW_CREATE_VID; + + if (aErrCallback == undefined) + aErrCallback = gErrCallback_common; + + _CB_envelopIdNum = function (aResult) { + if (!__SANDBOX.isFailed(aResult, aErrCallback)) { + aUserCallback (aSignedData); + } + } + + _CB_signDataCMS = function (aResult) { + if (!__SANDBOX.isFailed(aResult, aErrCallback)) { + aSignedData = aResult; + __SANDBOX.upInterface().envelopIdNumEx (aXgateAddress, + aMediaID, + "", + "", + "", + "", + aVid, + aSvrCert, + 0, + _CB_envelopIdNum); + } + } + + _signDataCMS = function () { + __SANDBOX.upInterface().signFileEx (aXgateAddress, + aInFilePath, + aOutFilePath, + aMediaID, + "", + "", + "", + "", + aOption, + aDescription, + _CB_signDataCMS); + } + + _CB_getLastLocation = function (aResult) { + if (aResult < 0) + aMediaID = 0; + else + aMediaID = aResult; + + if (aOption & XW_FVIEW_CREATE_VID_NO_IDN) { + aVid = ""; + _signDataCMS (); + } else if (aOption & XW_FVIEW_CREATE_VID_FROM_WEB) { + aVid = aIdn; + _signDataCMS (); + } else { + var aInputType = __SANDBOX.getInputType(aMediaID); + var module = __SANDBOX.loadModule("verifyvid"); + var vidDialog = module({ + width: 350, + height: 100, + onconfirm: function(aResult) { aVid = aResult; _signDataCMS (); vidDialog.dispose(); }, + oncancel: function() { vidDialog.dispose(); }, + args: {inputType: aInputType} + }); + + vidDialog.show(); + } + } + + _CB_hasCachedData = function (aResult) { + if (!aResult) { + var aErrorObject = {}; + aErrorObject.code = -1; + aErrorObject.msg = XW_ERROR_MSG_SIGNCACHE1; + aErrCallback(aErrorObject); + return; + } + + __SANDBOX.upInterface().getLastLocation (_CB_getLastLocation); + } + + __SANDBOX.upInterface().hasCachedData (aXgateAddress, _CB_hasCachedData); + }, ""); + }, + + VerifyFile: function (aInFilePath, + aSignedData, + aOption, + aDescription, + aUserCallback, + aErrCallback) + { + __SANDBOX.setAfterAction (function () { + if (aErrCallback == undefined) + aErrCallback = gErrCallback_common; + + _CB_VerifyFile = function (result) { + if (!__SANDBOX.isFailed(result, aErrCallback)) + aUserCallback (result); + } + + __SANDBOX.upInterface ().verifyFile (aInFilePath, + aSignedData, + aOption, + aDescription, + _CB_VerifyFile); + }, ""); + }, + + VerifyAndSignFile: function (aXgateAddress, + aCAList, + aCertSerial, + aCertLocation, + aLimitedTrial, + aInFilePath, + aOutFilePath, + aSignedData, + aVerifyOption, + aSignOption, + aVerifyDescription, + aSignDescription, + aUserCallback, + aErrCallback) + { + __SANDBOX.setAfterAction (function () { + var fSign = this.SignFileEx; + + if (aErrCallback == undefined) + aErrCallback = gErrCallback_common; + + aVerifyOption |= XW_OPTION_ADD_SIGN_BUTTON; + + AddSign = function () + { + fSign (aXgateAddress, + aCAList, + aCertSerial, + aCertLocation, + aLimitedTrial, + aInFilePath, + aOutFilePath, + aSignOption, + aSignDescription, + aUserCallback, + aErrCallback); + } + + SignCancel = function () + { + __SANDBOX.upInterface().setError(XW_ERROR_PLUGINS_SIGN_CANCEL, _CB_errCallback); + } + + _CB_errCallback = function () + { + var aErrorObject = __SANDBOX.upInterface().setErrCodeAndMsg(); + aErrCallback (aErrorObject); + } + + _CB_VerifyFile = function (result) { + if (!__SANDBOX.isFailed(result, aErrCallback)) { + // -1: verify fail, 0: verify success, 1: add sign + if (result == "-1") { + var aCommonDialogModule = __SANDBOX.loadModule("commondialog"); + var aCommonDialog = aCommonDialogModule ({ + width: 350, + height: 0, + onconfirm: function() { + aCommonDialog.dispose(); + AddSign(); + }, + oncancel: function(e) { + aCommonDialog.dispose(); + SignCancel(); + }, + args: {dialogType: "confirm", + messageType: "verifyAndSignFile_confirmSign"} + }); + if (aCommonDialog) aCommonDialog.show(); + } else if (result == "0") { + SignCancel(); + } else { + AddSign(); + } + } + } + + __SANDBOX.upInterface ().verifyFile (aInFilePath, + aSignedData, + aVerifyOption, + aVerifyDescription, + _CB_VerifyFile); + }, ""); + }, + + GetVerifiedFileCertInfo: function (aOption, + aIndex, + aUserCallback, + aErrCallback) + { + __SANDBOX.setAfterAction (function () { + if (aErrCallback == undefined) + aErrCallback = gErrCallback_common; + + _CB_GetVerifiedFileCertInfo = function (result) { + if (!__SANDBOX.isFailed(result, aErrCallback)) { + var aCertInfo = result.split ("$"); + aUserCallback (aCertInfo[aIndex]); + } + } + + __SANDBOX.upInterface ().getVerifiedFileCertInfo (aOption, _CB_GetVerifiedFileCertInfo); + }, ""); + }, + + ExtractFile: function (aInFilePath, + aOutFilePath, + aOption, + aDescription, + aUserCallback, + aErrCallback) + { + __SANDBOX.setAfterAction (function () { + if (aErrCallback == undefined) + aErrCallback = gErrCallback_common; + + _CB_ExtractFile = function (result) { + if (!__SANDBOX.isFailed(result, aErrCallback)) + aUserCallback (result); + } + + __SANDBOX.upInterface ().extractFile (aInFilePath, + aOutFilePath, + aOption, + aDescription, + _CB_ExtractFile); + }, ""); + }, + + EnvelopeFileWithPEM: function (aInFilePath, + aOutFilePath, + aCertPEM, + aOption, + aDescription, + aUserCallback, + aErrCallback) + { + __SANDBOX.setAfterAction (function () { + if (aErrCallback == undefined) + aErrCallback = gErrCallback_common; + + _CB_EnvelopeFileWithPEM = function (result) { + if (!__SANDBOX.isFailed(result, aErrCallback)) + aUserCallback (result); + } + + __SANDBOX.upInterface ().envelopeFileWithPEM (aInFilePath, + aOutFilePath, + aCertPEM, + aOption, + aDescription, + _CB_EnvelopeFileWithPEM); + }, ""); + }, + + EnvelopeFileWithCert: function (aXgateAddress, + aCAList, + aCertSerial, + aCertLocation, + aInFilePath, + aOutFilePath, + aOption, + aDescription, + aUserCallback, + aErrCallback) + { + if (aErrCallback == undefined) + { + aErrCallback = gErrCallback_common; + } + + var aDialogParam = {}; + var aDialogArgs = {}; + + var aMediaIDList = ""; + var aIssuerRDNList = ""; + var aCertSerialList = ""; + + var _showCertSelect = function() { + aDialogParam = {}; + aDialogArgs = {}; + + aDialogParam.width = 437; + aDialogParam.height = 457; + aDialogParam.type = "envelope"; + aDialogParam.args = aDialogArgs; + + aDialogParam.args ={funcname : "EnvelopeFileWithCert", + xgateAddress : aXgateAddress, + caList : aCAList, + certSerial : aCertSerial, + certLocation : aCertLocation, + option : aOption, + description : aDescription, + userCallback : _showCertSelect_callback, + errCallback : aErrCallback}; + + aDialogParam.onconfirm = null; + aDialogParam.oncancel = null; + + __SANDBOX.showCertselectDialogCommon(aDialogParam); + } + + var _showCertSelect_callback = function(aResult) { + + aMediaIDList += aResult.mediaID + "\t\n"; + aIssuerRDNList += aResult.issuerRDN + "\t\n"; + aCertSerialList += aResult.certSerial + "\t\n"; + + if ((Math.floor(aResult.mediaID / 100) * 100) == XW_CERT_LOCATION_PKCS11) { + __SANDBOX.upInterface().finalizePKCS11FromIndex (aResult.mediaID, _CertSelectOrEnvelope); + } else { + _CertSelectOrEnvelope () + } + } + + var _CertSelectOrEnvelope = function () { + if (aOption & XW_OPTION_ENVELOPE_MULTI_CERT) + { + _confirmNextCert(); + } + else + { + _envelopeFileWithCert(); + } + } + + var _confirmNextCert = function() { + var aCommonDialogModule = __SANDBOX.loadModule("commondialog"); + AnySign.SetUITarget (aDialogParam.dialog.getUITarget()); + var aCommonDialog = aCommonDialogModule ({ + width: 350, + height: 0, + onconfirm: function() { + aCommonDialog.dispose(); + AnySign.SetUITarget (aCommonDialog.getUITarget()); + _showCertSelect(); + }, + oncancel: function(e) { + aCommonDialog.dispose(); + _envelopeFileWithCert(); + }, + args: {dialogType: "confirm", + messageType: "envelopeDataWithCert_confirmNextCert"} + }); + + if (aCommonDialog) aCommonDialog.show(); + } + + var _envelopeFileWithCert = function() { + + _envelopeCertCallback = function (result) + { + if ( __SANDBOX.isFailed(result, aErrCallback) ) + return; + + aUserCallback(result); + } + + __SANDBOX.upInterface().envelopeFileWithCert (aInFilePath, + aOutFilePath, + aMediaIDList, + aIssuerRDNList, + aCertSerialList, + "", + aOption, + aDescription, + _envelopeCertCallback); + } + + _showCertSelect(); + }, + + DeEnvelopeFileWithCert: function (aXgateAddress, + aCAList, + aCertSerial, + aCertLocation, + aLimitedTrial, + aInFilePath, + aOutFilePath, + aOption, + aDescription, + aUserCallback, + aErrCallback) + { + var aMediaID = ""; + var aIssuerRDN = ""; + var aKeyword = ""; + + if (aErrCallback == undefined) + { + aErrCallback = gErrCallback_common; + } + + var _showCertSelect = function() { + var aDialogParam = {}; + var aDialogArgs = {}; + + aDialogParam.width = 437; + aDialogParam.height = 457; + aDialogParam.type = "deenvelope"; + aDialogParam.args = aDialogArgs; + + aDialogParam.args ={funcname : "DeEnvelopeFileWithCert", + xgateAddress : aXgateAddress, + caList : aCAList, + certSerial : aCertSerial, + certLocation : aCertLocation, + option : aOption, + description : aDescription, + keywordTryLimit : aLimitedTrial, + userCallback : _showCertSelect_callback, + errCallback : aErrCallback}; + + aDialogParam.onconfirm = null; + aDialogParam.oncancel = null; + + __SANDBOX.showCertselectDialogCommon(aDialogParam); + } + + var _showCertSelect_callback = function(aResult) { + aMediaID = aResult.mediaID; + aIssuerRDN = aResult.issuerRDN; + aCertSerial = aResult.certSerial; + + if ((Math.floor(aMediaID / 100) * 100) == XW_CERT_LOCATION_PKCS11) { + aKeyword = aResult.pin; + __SANDBOX.upInterface().finalizePKCS11FromIndex (aMediaID, _deEnvelopeFileWithCert); + } else { + aKeyword = aResult.passwd; + _deEnvelopeFileWithCert () + } + } + + var _deEnvelopeFileWithCert = function() { + var aResult = ""; + + _deEnvelopeCertCallback = function (result) + { + if ( __SANDBOX.isFailed(result, aErrCallback) ) + return; + + aUserCallback(result); + } + + __SANDBOX.upInterface().deEnvelopeFileWithCert (aInFilePath, + aOutFilePath, + aMediaID, + aIssuerRDN, + aCertSerial, + "", + aKeyword, + aOption, + aDescription, + _deEnvelopeCertCallback); + } + + _showCertSelect(); + }, + + EnvelopeFileWithPasswd: function (aInFilePath, + aOutFilePath, + aSymKey, + aOption, + aDescription, + aUserCallback, + aErrCallback) + { + __SANDBOX.setAfterAction (function () { + if (aErrCallback == undefined) + aErrCallback = gErrCallback_common; + + _CB_EnvelopeFileWithPasswd = function (result) { + if (!__SANDBOX.isFailed(result, aErrCallback)) + aUserCallback (result); + } + + _CB_setSecureInput = function (result) { + _envelopeFileWithPasswd (aSymKey); + } + + var _inputPassword = function () + { + var aPasswordModule = __SANDBOX.loadModule("inputpasswd"); + + var aInputPasswdDialog = aPasswordModule ({ + width: 350, + height: 0, + onconfirm: function (result) { + aInputPasswdDialog.dispose(); + _envelopeFileWithPasswd (result); + }, + oncancel: function (e) { + aInputPasswdDialog.dispose(); + }, + args: {messageType: "common"} + }); + + if (aInputPasswdDialog) aInputPasswdDialog.show(); + } + + var _envelopeFileWithPasswd = function (aKeyword) + { + __SANDBOX.upInterface ().envelopeFileWithPasswd (aInFilePath, + aOutFilePath, + aKeyword, + aOption, + aDescription, + _CB_EnvelopeFileWithPasswd); + } + + if (aOption & 1) { + aOption -= 1; + _inputPassword(); + } else { + __SANDBOX.upInterface().setSecureInput ("", _CB_setSecureInput); + } + }, ""); + }, + + DeEnvelopeFileWithPasswd: function (aInFilePath, + aOutFilePath, + aSymKey, + aOption, + aDescription, + aUserCallback, + aErrCallback) + { + __SANDBOX.setAfterAction (function () { + if (aErrCallback == undefined) + aErrCallback = gErrCallback_common; + + _CB_DeEnvelopeFileWithPasswd = function (result) { + if (!__SANDBOX.isFailed(result, aErrCallback)) + aUserCallback (result); + } + + _CB_setSecureInput = function (result) { + _deEnvelopeFileWithPasswd (aSymKey); + } + + var _inputPassword = function () + { + var aPasswordModule = __SANDBOX.loadModule("inputpasswd"); + + var aInputPasswdDialog = aPasswordModule ({ + width: 350, + height: 0, + onconfirm: function (result) { + aInputPasswdDialog.dispose(); + _deEnvelopeFileWithPasswd (result); + }, + oncancel: function (e) { + aInputPasswdDialog.dispose(); + }, + args: {messageType: "common"} + }); + + if (aInputPasswdDialog) aInputPasswdDialog.show(); + } + + var _deEnvelopeFileWithPasswd = function (aKeyword) + { + __SANDBOX.upInterface ().deEnvelopeFileWithPasswd (aInFilePath, + aOutFilePath, + aKeyword, + aOption, + aDescription, + _CB_DeEnvelopeFileWithPasswd); + } + + if (aOption & 1) { + aOption -= 1; + _inputPassword(); + } else { + __SANDBOX.upInterface().setSecureInput ("", _CB_setSecureInput); + } + }, ""); + }, + + GetEnvelopedFileInfo: function (aEnvelopedFile, + aOption, + aUserCallback, + aErrCallback) + { + __SANDBOX.setAfterAction (function () { + if (aErrCallback == undefined) + aErrCallback = gErrCallback_common; + + _CB_GetEnvelopedFileInfo = function (result) { + if (!__SANDBOX.isFailed(result, aErrCallback)) + aUserCallback (result); + } + + __SANDBOX.upInterface().getEnvelopedFileInfo (aEnvelopedFile, + aOption, + _CB_GetEnvelopedFileInfo); + }, ""); + }, + + UploadFile: function (aXgateAddress, + aPath, + aQuery, + aHostName, + aPort, + aInFilePath, + aOption, + aDescription, + aUserCallback, + aErrCallback) + { + __SANDBOX.setAfterAction (function () { + if (aErrCallback == undefined) + aErrCallback = gErrCallback_common; + + _CB_UploadFile = function (result) { + if (!__SANDBOX.isFailed(result, aErrCallback)) + aUserCallback (result); + } + + __SANDBOX.upInterface().uploadFile (aXgateAddress, + aPath, + aQuery, + aHostName, + aPort, + aInFilePath, + aOption, + aDescription, + _CB_UploadFile); + }, ""); + }, + + UploadFileEx: function (aXgateAddress, + aPath, + aQuery, + aHostName, + aPort, + aInFilePath, + aOption, + aDescription, + aSID, + aCharSet, + aUserCallback, + aErrCallback) + { + __SANDBOX.setAfterAction (function () { + if (aErrCallback == undefined) + aErrCallback = gErrCallback_common; + + _CB_UploadFileEx = function (result) { + if (!__SANDBOX.isFailed(result, aErrCallback)) + aUserCallback (result); + } + + __SANDBOX.upInterface().uploadFileEx (aXgateAddress, + aPath, + aQuery, + aHostName, + aPort, + aInFilePath, + aOption, + aDescription, + aSID, + aCharSet, + _CB_UploadFileEx); + }, ""); + }, + + DownloadFile: function (aXgateAddress, + aPath, + aQuery, + aHostName, + aPort, + aTargetFilePath, + aDownloadFilePath, + aOption, + aDescription, + aUserCallback, + aErrCallback) + { + __SANDBOX.setAfterAction (function () { + if (aErrCallback == undefined) + aErrCallback = gErrCallback_common; + + _CB_DownloadFile = function (result) { + if (!__SANDBOX.isFailed(result, aErrCallback)) + aUserCallback (result); + } + + __SANDBOX.upInterface().downloadFile (aXgateAddress, + aPath, + aQuery, + aHostName, + aPort, + aTargetFilePath, + aDownloadFilePath, + aOption, + aDescription, + _CB_DownloadFile); + }, ""); + }, + + DownloadFileEx: function (aXgateAddress, + aPath, + aQuery, + aHostName, + aPort, + aTargetFilePath, + aDownloadFilePath, + aOption, + aDescription, + aSID, + aCharSet, + aUserCallback, + aErrCallback) + { + __SANDBOX.setAfterAction (function () { + if (aErrCallback == undefined) + aErrCallback = gErrCallback_common; + + _CB_DownloadFileEx = function (result) { + if (!__SANDBOX.isFailed(result, aErrCallback)) + aUserCallback (result); + } + + __SANDBOX.upInterface().downloadFileEx (aXgateAddress, + aPath, + aQuery, + aHostName, + aPort, + aTargetFilePath, + aDownloadFilePath, + aOption, + aDescription, + aSID, + aCharSet, + _CB_DownloadFileEx); + }, ""); + }, + + ZipFile: function (aXgateAddress, + aSourceFile, + aTargetFile, + aOption, + aDescription, + aUserCallback, + aErrCallback) + { + __SANDBOX.setAfterAction (function () { + if (aErrCallback == undefined) + aErrCallback = gErrCallback_common; + + _CB_ZipFile = function (result) { + if (!__SANDBOX.isFailed(result, aErrCallback)) + aUserCallback (result); + } + + __SANDBOX.upInterface().zipFile (aXgateAddress, + aSourceFile, + aTargetFile, + aOption, + aDescription, + _CB_ZipFile); + }, ""); + }, + + UnZipFile: function (aXgateAddress, + aSourceFile, + aDestDir, + aOption, + aDescription, + aUserCallback, + aErrCallback) + { + __SANDBOX.setAfterAction (function () { + if (aErrCallback == undefined) + aErrCallback = gErrCallback_common; + + _CB_UnZipFile = function (result) { + if (!__SANDBOX.isFailed(result, aErrCallback)) + aUserCallback (result); + } + + __SANDBOX.upInterface().unZipFile (aXgateAddress, + aSourceFile, + aDestDir, + aOption, + aDescription, + _CB_UnZipFile); + }, ""); + }, + + GetFileInfo: function (aFilePath, + aOption, + aUserCallback, + aErrCallback) + { + __SANDBOX.setAfterAction (function () { + if (aErrCallback == undefined) + aErrCallback = gErrCallback_common; + + _CB_GetFileInfo = function (result) { + if (!__SANDBOX.isFailed(result, aErrCallback)) + aUserCallback (result); + } + + __SANDBOX.upInterface().getFileInfo (aFilePath, + aOption, + _CB_GetFileInfo); + }, ""); + }, + + ClearTempFile: function (aXgateAddress, + aUserCallback, + aErrCallback) + { + __SANDBOX.setAfterAction (function () { + if (aErrCallback == undefined) + aErrCallback = gErrCallback_common; + + _CB_ClearTempFile = function (result) { + if (!__SANDBOX.isFailed(result, aErrCallback)) + aUserCallback (result); + } + + __SANDBOX.upInterface().clearTempFile (aXgateAddress, _CB_ClearTempFile); + }, ""); + }, + + GetHomeDir: function (aUserCallback, + aErrCallback) + { + __SANDBOX.setAfterAction (function () { + if (aErrCallback == undefined) + aErrCallback = gErrCallback_common; + + _CB_GetHomeDir = function (result) { + if (!__SANDBOX.isFailed(result, aErrCallback)) + aUserCallback (result); + } + + __SANDBOX.upInterface().getHomeDir (_CB_GetHomeDir); + }, ""); + }, + + GetCertPEM: function (aMediaID, + aIssuerRDN, + aCertSerial, + aOption, + aUserCallback, + aErrCallback) + { + __SANDBOX.setAfterAction (function () { + if (aErrCallback == undefined) + aErrCallback = gErrCallback_common; + + _CB_getCertPEM = function (aCertPEM) { + if (!__SANDBOX.isFailed(aCertPEM, aErrCallback)) + aUserCallback (aCertPEM); + } + + __SANDBOX.upInterface().getCertPEM (aMediaID, + aIssuerRDN, + aCertSerial, + aOption, + _CB_getCertPEM); + }, ""); + }, + + XFSLogout: function (aUserCallback) + { + __SANDBOX.upInterface().xfsLogout (aUserCallback); + }, + + SetStorage: function (aUserCallback) + { + if (typeof XCrypto == "undefined") { + if(aUserCallback) aUserCallback(); + return; + } + + if (XCrypto.checkXCrypto() != 0) { + if(aUserCallback) aUserCallback(); + return ; + } + + var aCallback = function (aReturn) { + if (aReturn != 0) + { + var aInternalErrorMessage = XCrypto.getLastErrInternal(); + var aErrorObject = __SANDBOX.upInterface().setErrCodeAndMsg(); + + if(typeof aInternalErrorMessage !== "undefined" && aInternalErrorMessage.length > 0 ) + aErrorObject.msg += aInternalErrorMessage; + + if(AnySign.mOpenCertAlertEnable) + { + alert(aErrorObject.msg.replace(/\\n/g, '\r\n')); + + if (typeof AnySign.mLanguage === 'string' && AnySign.mLanguage.toLowerCase() == "ko-kr") + alert(XW_OPENCERT_INIT_ERROR_NOTABLE_MSG); + else + alert(XW_OPENCERT_INIT_ERROR_NOTABLE_MSG_en); + } + else + { + console.log(aErrorObject.msg); + } + + // When setOpenStorage return error, inside xcrypto set used localStorage(or crossStorage). + // so AnySign.mOpenCertInitFlag set true because secondtime setOpenStorage fail is not return callback. (Be assumed yessign opencert module error.) + // when yessign can fix that bug, then AnySign.mOpenCertInitFlag can set true if user choose confirm button. The button message is I will continue to use localstorage. + AnySign.mOpenCertInitFlag = true; + } + else + { + AnySign.mOpenCertInitFlag = true; + } + + var aCallback2 = function (aReturn) { + if (aReturn != 0) + console.log("[setCrossStorage] fail set Cross Storage URL."); + + if(aUserCallback) aUserCallback(); + } + + __SANDBOX.upInterface().setCrossStorage(AnySign.mCrossStorageHub, AnySign.mCrossStorageOption, aCallback2); + } + + if(AnySign.mOpenCertEnable == true && AnySign.mOpenCertInitFlag == false) + { + // 금결원 인증서 정보 목록 변경 이벤트 리스터 + var aOpenCertEventListener = function (listener) { + if (!__SANDBOX.isDialogLoaded) return; + + var element = document.getElementById('xwup_media_localstorage'); + if (!element) return; + + var loader = document.getElementById('xwup_loader_img'); + if (loader) return; + + if (listener == "connect" || listener == "disconnect" || listener == "removeCertFromTray") + element.onclick(); + }; + + var aGuideModule = __SANDBOX.loadModule("guidewindow"); + __SANDBOX.upInterface().setOpenStorage(AnySign.mOpenApi, [AnySign.mOpenCertJS, AnySign.mOpenCertRelayJS], aOpenCertEventListener, aGuideModule, aCallback); + + } + else + { + aCallback(0); + } + } +} + +})(); + + diff --git a/src/main/webapp/AnySign4PC/AnySign4PC/css/common.css b/src/main/webapp/AnySign4PC/AnySign4PC/css/common.css new file mode 100644 index 00000000..7441c1cd --- /dev/null +++ b/src/main/webapp/AnySign4PC/AnySign4PC/css/common.css @@ -0,0 +1,505 @@ +@charset "utf-8"; + +/* common css */ +.xwup_common{background:0;background-color:transparent;background-image:none;background-position:0;background-repeat:repeat;background-size:auto;box-shadow:none;box-sizing:border-box;clear:none;color:inherit;empty-cells:show;float:none;font:normal;font-family:inherit;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;height:auto;left:auto;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:none;list-style-type:none;margin:0;max-height:none;max-width:none;min-height:0;min-width:0;opacity:1;overflow:visible;padding:0;table-layout:auto;text-align:left;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-shadow:none;vertical-align:middle;visibility:inherit;white-space:normal;widows:0;width:auto;word-spacing:normal;z-index:auto;position:static;cursor:auto} +.xwup_cert_wide,.xwup_cert_pop,.xwup_cert_mini{display:block;visibility:visible;overflow:visible;height:auto;background-color:#fff;color:#000;font-weight:normal;line-height:normal;background-image:none;cursor:auto} +.xwup_cert_mini{width:600px;border:0} /* 미니UI */ +.xwup_cert_pop{position:absolute;top:0;left:0;border-style:solid} /* 팝업UI */ +.xwup_cert_wide{border-style:solid} /* 바닥UI */ +.xwup_common div,.xwup_common a,.xwup_common span,.xwup_common table,.xwup_common tr,.xwup_common th,.xwup_common td,.xwup_common ul,.xwup_common ol,.xwup_common li,.xwup_common dl,.xwup_common dt,.xwup_common dd,.xwup_common form,.xwup_common button,.xwup_common fieldset,.xwup_common legend,.xwup_common select,.xwup_common textarea,.xwup_common p,.xwup_common label,.xwup_common input,.xwup_common h1,.xwup_common h2,.xwup_common h3,.xwup_common h4,.xwup_common h5,.xwup_common h6,.xwup_common blockquote{margin:0;padding:0;font-family:'Malgun Gothic',Dotum,Helvetica,AppleGothic,Sans-serif;font-size:12px;color:#000;background:0;background-color:transparent;background-image:none;background-position:0;background-repeat:repeat;background-size:auto;box-shadow:none;clear:none;empty-cells:show;float:none;font:normal;font-style:normal;font-variant:normal;font-weight:normal;height:auto;left:auto;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:none;list-style-type:none;margin:0;opacity:1;overflow:visible;padding:0;table-layout:auto;text-align:left;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-shadow:none;vertical-align:middle;visibility:inherit;white-space:normal;widows:0;width:auto;word-spacing:normal;z-index:auto;position:static;cursor:auto} + +/* default setting */ +.xwup_common img,.xwup_common fieldset{border:0} +.xwup_common form,.xwup_common fieldset,.xwup_common legend,.xwup_common input,.xwup_common button,.xwup_common textarea,.xwup_common select{color:#000;font-size:12px} +.xwup_common button::-moz-focus-inner{padding:0;border:0} +.xwup_common ul,.xwup_common ol{list-style:none} +.xwup_common table{border-collapse:collapse} +.xwup_common label{cursor:default} +.xwup_common input,.xwup_common textarea{display:inline-block;font-size:13px;vertical-align:middle} +.xwup_common textarea{resize:none} +.xwup_common address,.xwup_common em{font-style:normal} +.xwup_common fieldset,.xwup_common img{border:0;position:relative} +.xwup_common em{font-style:normal} +.xwup_common h3{top:0} +.xwup_common button{cursor:pointer} +.xwup_common a{text-decoration:none;cursor:pointer} +.xwup_common table{border-collapse:collapse} +.xwup_common th,.xwup_common td{padding:0;vertical-align:middle;text-align:left;font-weight:normal} +.xwup_common input[type="text"],.xwup_common input[type="password"],.xwup_common input[type="email"],.xwup_common input[type="search"],.xwup_common input[type="image"],.xwup_common input[type="button"],.xwup_common textarea{border:1px solid #777;background:#fff;-webkit-appearance:none;border-radius:0} +.xwup_common input[type="checkbox"]:checked{background-color:#fff;-webkit-appearance:checkbox} +.xwup_common input[type="text"],.xwup_common input[type="password"]{height:18px;position:relative;margin:1px 2px 0;padding:2px 3px 3px;border:1px solid #777;background:#fff;color:#000} +.xwup_common .lt-css3 input[type="text"],.xwup_common input[type="password"]{padding:1px 3px 4px} +.xwup_common input[type="text"]:focus,.xwup_common input[type="password"]:focus,.xwup_common textarea:focus{border:1px solid #009ae6;outline-width:0} +.xwup_common input[disabled="disabled"]{background:#f0f0f0;border:1px solid #f0f0f0;color:#555} +.xwup_common input[readonly="readonly"]{background:#f0f0f0;border:1px solid #777;color:#555} +.xwup_common .disabled{background:#f0f0f0;border:1px solid #f0f0f0;color:#555} +.xwup_common input.error-input{background:#fff;border:1px solid #ff4b2a;color:#000} +.xwup_common .form-error{display:block;background:url(../img/common/etc/ico_form_error.gif) no-repeat left 5px;padding:0 0 0 23px;color:#ff4b2a;vertical-align:top} +.xwup_common input[type="checkbox"],.xwup_common input[type="radio"]{width:13px;height:13px;margin:0;padding:0;vertical-align:middle;line-height:27px} +.xwup_common select{position:relative;height:25px;vertical-align:middle;border:1px solid #777;padding:2px 2px 2px 0;margin:-1px 0 0 2px} +.xwup_common .ie7 select{line-height:1.65;font-family:'돋움',dotum;padding:4px 4px 5px 0} + +/* Layout */ +.xwup_common .xwup_mbottom img{height:auto;margin-right:5px;vertical-align:middle} +.xwup_common .hidden{overflow:hidden;position:absolute;top:-9999px;left:-9999px;width:0;height:0;font-size:0;line-height:0;text-indent:-9999px} +.xwup_common .w100{width:100px} +.xwup_common div.xwup-w300-body{width:300px} +.xwup_common div.xwup-w400-body{width:400px} +.xwup_common div.xwup-w410-body{width:410px} +.xwup_common div.xwup-w420-body{width:420px} +.xwup_common div.xwup-w500-body{width:500px} +.xwup_common div.xwup-w530-body{width:530px} +.xwup_common div.xwup-w730-body{width:730px} +.xwup_common div.xwup-w946-body{width:946px} +.xwup_common .xwup-font10{font-size:10px} +.xwup_common .xwup-degap{margin:10px 10px 20px} +.xwup_common .xwup-mr5{margin-right:15px} +.xwup_common .xwup-fontb{font-weight:bold} +.xwup_common .xwup_mbottom{margin:0 0 10px;text-align:left} +.xwup_common .xwup-legend{display:none !important;margin:0 0 0 5px;background-color:#fff;font-weight:normal;text-align:left} +.xwup_common caption{visibility:hidden;width:0;height:0;line-height:0;position:relative} +.xwup_common .xwup-h140{height:140px} +.xwup_common .xwup-str-pd0{padding:0} +.xwup_common .brt-color-none{border-top-color:transparent} +.xwup_common .xwup-wrd-normal{word-wrap:normal} +.xwup_common .xwup-ovf-yscroll{oveflow:hidden;overflow-y:scroll} +.xwup_common .xwup-ovf-yscroll-none{overflow-y:hidden} + +/* common title */ +.xwup_common .xwup-title2{_width:452px} +.xwup_common .title h3,.xwup_common .xwup-title h3{height:40px;padding:0 0 0 15px;font-size:18px;line-height:40px;letter-spacing:-2px;font-weight:bold;cursor:move} +.xwup_common .xwup-title h3{font-weight:bold} +.xwup_common .xwup-title-mini{top:0;left:0;width:100%;height:30px;margin-bottom:-15px;border-radius:0;background:none} +.xwup_common .xwup-title-mini h3{font-size:20px;height:31px;color:#000;background:none;line-height:27px;vertical-align:middle;letter-spacing:-2px} + +/* contents body */ +.xwup_common .xwup-body{margin:0 20px 20px 20px;padding-top:20px} +.xwup_common .blank0,.xwup_common .xwup-blank0{overflow:hidden;position:absolute;top:-9999px;left:-9999px;width:0;height:0;font-size:0;line-height:0;text-indent:-9999px} +.xwup_common .blank10,.xwup_common .xwup-blank10{height:10px;margin:0} +.xwup_common .blank15,.xwup_common .xwup-blank15{height:15px;margin:0} + +/* button */ +.xwup_common .xwup-buttons-layout,.xwup_common .xwup-buttons-layout2,.xwup_common .xwup-buttons-layout4{display:block;margin:15px 0;text-align:center} +.xwup_common .xwup-buttons-layout2{text-align:right} +.xwup_common .xwup-buttons-layout3{text-align:left} +.xwup_common .xwup-buttons-layout4{margin:0;text-align:right} +.xwup_common .xwup-buttons-layout button,.xwup_common .xwup-buttons-layout2 button,.xwup_common .xwup-buttons-layout3 button,.xwup_common .xwup-buttons-layout4 button{height:25px;margin:0 5px;padding:0 13px;*padding:0 10px;_padding:0 10px;border:1px solid gray;border-radius:6px;background-color:#EFEFEF;background-image:url(../img/btn_bg.png);text-align:center;vertical-align:top} +.xwup_common .xwup-buttons-layout .ok,.xwup_common .xwup-buttons-layout2 .ok,.xwup_common .xwup-buttons-layout3 .ok,.xwup_common .xwup-buttons-layout4 .ok{overflow:hidden;height:28px;border:0;background:url(../img/btn_ok_blue.png);line-height:9000px;cursor:pointer} +.xwup_common .xwup-buttons-layout .cancel,.xwup_common .xwup-buttons-layout2 .cancel,.xwup_common .xwup-buttons-layout3 .cancel,.xwup_common .xwup-buttons-layout4 .cancel{overflow:hidden;height:28px;border:0;background:url(../img/btn_cancel.png);line-height:9000px;cursor:pointer} +.xwup_common .xwup-buttons-layout .view,.xwup_common .xwup-buttons-layout2 .view,.xwup_common .xwup-buttons-layout3 .view,.xwup_common .xwup-buttons-layout4 .view{margin:5px;padding:0 13px;border:1px solid #c7c7c7;border-radius:4px;-webkit-border-radius:4px} +.xwup_common .xwup-button-disabled{color:gray} +.xwup_common .xwup-box-layout{position:relative;padding-top:7px} +.xwup_common .xwup-box-border{display:block;padding:10px;border:1px solid #c7c7c7} +.xwup_common .xwup-close-button {background:url(../img/btn_pop_close.png) no-repeat;position:absolute;height:15px;width:15px;top:14px;right:13px} + +/* tab */ +.xwup_common div.xwup-tab-view{display:block;clear:both;padding:15px;border:2px solid #6C9CDA;border-radius:0 8px 8px 8px;background-color:#fff;text-align:left;zoom:1} +.xwup_common div.xwup-tab-list ul{float:left;position:relative;margin:0;padding:0;color:#666;text-align:left} +.xwup_common div.xwup-tab-list ul li{display:inline-block;*display:inline;margin:0;border:1px solid #999;border-bottom:0;border-radius:6px 6px 0 0;background:#f9f9f9;list-style-type:none;*zoom:1} +.xwup_common div.xwup-tab-list ul li a{display:block;padding:6px 10px 2px;font-weight:normal;color:#000;list-style:none;white-space:nowrap} +.xwup_common div.xwup-tab-list .selected a{border-top:1px solid #6c9cda;border-right:1px solid #6c9cda;background-color:#6C9CDA;font-weight:bold;color:#FFF;list-style:none} +.xwup_common div.xwup-tab-list .tmenu{width:46px} +.xwup_common div.xwup-tab-list .tmenu2{width:98px} +.xwup_common div.xwup-tab-list .tmenu3{width:138px} +.xwup_common div.xwup-tab-list .tmenu4{width:98px} +.xwup_common div.xwup-tab-list .tmenu5{width:48px} +.xwup_common div.xwup-tab-list .tmenu6{width:60px} + +/* label */ +.xwup_common .xwup-for-password{display:inline-block;margin:0;font-weight:bold;color:#000;vertical-align:top} + +/* input */ +.xwup_common .xwup-password{overflow:hidden;margin:0 5px;padding:0 0 0 5px;border:1px solid;font-size:12px;vertical-align:middle} +.xwup_common .xwup-checkbox{margin:0 5px 0 0} + +/* fieldset */ +.xwup_common .xwup-location-item{display:block;margin:0;padding:0 0 5px;border:1px solid #949494} +.xwup_common .xwup-location-item button{display:inline-block;*display:block;width:78px;height:62px;padding:2px;border:2px solid #fff;border-radius:6px;background:#fff} +.xwup_common fieldset.manager{display:inline-block;*display:inline;width:207px;height:125px;margin:10px 2px 0;padding:2px 0;border:1px solid #949494;text-align:center;*zoom:1} +.xwup_common fieldset.manager .xwup-legend{margin:0 0 0 10px} +.xwup_common .importexport{display:block;overflow:hidden;margin-top:15px;padding:0 10px 10px;border:1px solid #949494} +.xwup_common .importexport div{margin:8px 0 3px} +.xwup_common .p10x10-gray1{display:block;overflow:hidden;padding:10px;border:1px solid #949494;text-align:left} +.xwup_common .p10x10-gray1 .group{margin-top:3px} +.xwup_common .p10x10-gray1 input{width:13px;height:13px;vertical-align:middle} +.xwup_common .p10x10-gray1 label{vertical-align:middle} +.xwup_common .p10x10-gray1 .margin-top{margin-top:12px} +.xwup_common .p10x10-gray1 .margin-bottom{margin-bottom:12px} +.xwup_common .xwup-cert-position,.xwup_common .xwup-cert-position2{margin:7px 4px 5px;table-layout:fixed;zoom:1} +.xwup_common .xwup-cert-position2{width:410px;margin:7px 7px 5px} +.xwup_common .xwup-cert-position td,.xwup_common .xwup-cert-position2 td{width:20%} +.xwup_common .xwup-cert-position span,.xwup_common .xwup-cert-position2 span{display:block;margin:0 auto;background-repeat:no-repeat;cursor:pointer} +.xwup_common .xwup-cert-position .xwup-rbg-text,.xwup_common .xwup-cert-position2 .xwup-rbg-text{display:block;height:auto;margin:2px 0 0;text-align:center;background:none;cursor:pointer} +.xwup_common .mngr-btn-text{display:inline-block;margin:2px 0 0;text-align:center} +.xwup_common .mngr-btn-img{display:inline-block;height:16px;margin:0 0 0 15px;background-repeat:no-repeat} + +/* radio button group */ +.xwup_common .xwup-location-item .xwup-rbg-normal{background:#fff;border-color:#fff} +.xwup_common .xwup-location-item .xwup-rbg-hover,.xwup_common .xwup-location-item .xwup-rbg-pressed{background:#eee;border-color:#999 #ddd #ddd #999} +.xwup_common .xwup-location-item .xwup-rbg-disabled{border:2px solid #FFF;background-color:#fff;background-image:none} +.xwup_common .exclamation{display:inline-block;width:16px;height:16px;margin:4px 0 0;background-image:url(../img/bu.png);background-repeat:no-repeat} + +/* password field */ +.xwup_common .xwup-password-field,.xwup_common .xwup-password-field2{margin:8px 0 0} +.xwup_common .xwup-password-field2{text-align:center} +.xwup_common .xwup-password-field label,.xwup_common .xwup-password-field2 label{display:inline-block;min-width:100px;_width:100px;margin:0 10px 0 0;text-align:right} +.xwup_common .xwup-password-field2 label{width:145px} + +/* cert manager */ +.xwup_common .xwup-group-btn-layout{display:block;height:132px; text-align:left} +.xwup_common .xwup-group-btn-layout button{width:75px;height:25px;border:1px solid gray;border-radius:6px;background-color:#efefef;background-image:url(../img/btn_bg.png);text-align:center;vertical-align:top;cursor:pointer} +.xwup_common .xwup-group-btn-layout span{display:inline-block;margin:0 5px;background-repeat:no-repeat;vertical-align:middle;cursor:pointer} +.xwup_common span.xwup-group-btn-desc{display:inline-block;height:12px;margin:10px 5px;text-align:left;vertical-align:top;*zoom:1} +.xwup_common .xwup-group-btn-layout .xwup-size150{width:150px;margin:8px 0 0;padding:1px 0 1px 7px;background-repeat:no-repeat;background-position:10% 50%;text-align:left} +.xwup_common .xwup-group-btn-layout .xwup-size180{width:180px;margin:8px 0 0;padding:1px 0 1px 5px;background-repeat:no-repeat;background-position:10% 50%;text-align:left} + +/* table view */ +.xwup_common .xwup-tableview{overflow-x:hidden;overflow-y:auto;position:relative;width:100%;_width:423px;height:140px;margin:10px 0 15px;border:1px solid #949494;box-sizing:content-box} +.xwup_common .xwup-tableview table{width:100%;margin:0;border-width:0;table-layout:fixed} +.xwup_common .xwup-tableview caption{visibility:hidden;width:0;height:0;line-height:0} +.xwup_common .xwup-tableview thead{border:0;border-bottom:1px solid #c7c7c7;background:#f5f5f5;background-image:url(../img/btn_bg.png);font-weight:bold} +.xwup_common .xwup-tableview th{position:static;padding:5px 0;background-color:#f5f5f5;font-weight:bold;text-align:center;white-space:nowrap;text-overflow:ellipsis;cursor:default} +.xwup_common .xwup-tableview th .wide-cert-table-resizearea{position:relative;zoom:1;text-align:center;font-weight:bold} +.xwup_common .xwup-tableview .xwup-mcert{width:82px} +.xwup_common .xwup-tableview .xwup-mcert2{width:164px} +.xwup_common .xwup-tableview .xwup-mcert3{width:82px} +.xwup_common .xwup-tableview .xwup-mcert4{width:82px} +.xwup_common .xwup-tableview tbody tr{border-bottom:1px solid #e3e3e3} +.xwup_common .xwup-tableview td{padding:0 5px;border:1px solid #eee;border-width:0 1px 1px 0;word-wrap:normal} +.xwup_common .xwup-tableview-cell{overflow:hidden;width:100%;max-width:100%;margin:0;padding:1px 0;text-align:left;white-space:nowrap;text-overflow:ellipsis;cursor:pointer;word-wrap:normal} +.xwup_common .xwup-tableview-cell img{vertical-align:middle} +.xwup_common .xwup-tableview-selected-row td{background-color:#6c9cda;color:#fff;cursor:pointer} +.xwup_common .xwup-tableview-selected-row .xwup-tableview-cell{color:#fff} +.xwup_common .xwup-tableview-unselected-row{background-color:transparent;color:#000;cursor:pointer} +.xwup_common .xwup-tableview-resizer{position:absolute;top:-5px;left:100%;width:6px;height:27px;margin-left:-3px;*margin-left:4px;cursor:w-resize} +.xwup_common .xwup-tableview-button{width:15px} +.xwup_common .xwup-tableview-viewbutton{width:70px;height:24px;margin:0 2px;border:1px solid #c7c7c7;border-radius:4px;background-color:#FFF;font-size:11px;text-align:center;cursor:pointer} + +/* certselect */ +.xwup_common .xwup-widget-sec{position:relative;width:100%;height:0px} +.xwup_common .xwup-widget-sec .fb{display:inline-block;color:#000;font-weight:bold} +.xwup_common .xwup-widget-sec .fc{color:#000} +.xwup_common .exclamation-image{display:inline-block;margin:4px 0 0 0;width:16px;height:16px;background:url(../img/bu.png) no-repeat} +.xwup_common .xwup-cert-passwd{padding-left:10px} +.xwup_common .xwup-cert-passwd span{display:block;padding:10px 0 2px} +.xwup_common .xwup-passwd-field{width:100%;height:26px;padding:13px 0 0;color:#986e3b;box-sizing:content-box} +.xwup_common .xwup-passwd-field .xwup-tit-pw{display:inline-block;font-weight:bold;color:#000;margin:0;padding-top:5px;vertical-align:top;cursor:default} +.xwup_common .xwup-passwd-field .xwup-pw-box{width:180px;height:18px;margin-left:4px;padding-left:4px;border:1px solid #000;vertical-align:middle;color:#000;box-sizing:content-box} +.xwup_common .xwup-passwd-field img{margin-right:4px;vertical-align:middle} +.xwup_common .xwup-passwd-field span{display:inline-block;padding:0;vertical-align:middle} +.xwup_common .xwup-expire-alert{display:none;width:220px;position:absolute;padding:7px;border:1px solid gray;border-radius:6px;background:#FFF;text-align:left;-webkit-border-radius:6px;box-shadow:3px 3px 10px gray;-webkit-box-shadow:3px 3px 10px gray} +.xwup_common .xwup-expire-icon{display:block;position:absolute;top:0;left:0;margin:0;padding:10px} +.xwup_common .xwup-expire-message{display:block;margin-left:28px;font-weight:bold} +.xwup_common .xwup-renew-message{display:block;margin-left:28px} +.xwup_common .xwup-expire-arrow{position:absolute;top:-19px;left:30px;width:0;height:0;border:10px solid;border-color:transparent transparent #FFF} +.xwup_common .xwup-expire-arrow-border{position:absolute;top:-20px;left:30px;width:0;height:0;border:10px solid;border-color:transparent transparent #c7c7c7} +.xwup_common #xwup_header{text-align:center} + +/* fileselect */ +.xwup_common .xwup-medialist{display:inline-block;*float:left;overflow-x:scroll;overflow-y:auto;width:160px;height:250px;border:1px solid #949494;background-color:#fff;margin:14px 14px 14px 0px;cursor:auto} +.xwup_common .xwup-medialist table{width:100%} +.xwup_common .xwup-medialist td{overflow:hidden;padding:2px 3px 1px;text-overflow:ellipsis;white-space:nowrap} +.xwup_common .xwup-medialist td a,.xwup_common .xwup-filelist td a{display:block} +.xwup_common .xwup-medialist td span,.xwup_common .xwup-filelist td span{display:inline-block;width:16px;height:16px;margin:0 4px} +.xwup_common .xwup-filelist{display:inline-block;overflow-x:scroll;overflow-y:auto;_float:left;width:512px;height:250px;border:1px solid #949494;background-color:#fff;margin:14px 0px;cursor:auto} +.xwup_common .xwup-filelist table{width:100%;table-layout:fixed} +.xwup_common .xwup-filelist td{overflow:hidden;padding:2px 10px 1px 3px;white-space:nowrap;cursor:default} +.xwup_common .xwup-tab-list .selected{background-color:#3875D7;color:#fff} +.xwup_common .media-list-image{display:inlinewidth:16px;height:16px;vertical-align:middle;margin-right:4px} +.xwup_common .file-list-image{display:inline;width:16px;height:16px;vertical-align:middle} +.xwup_common .file-list-cell{overflow:hidden;padding:2px 3px 1px 3px;border:0;white-space:nowrap;padding-right:10px;cursor:default} +.xwup_common .file-url,.xwup_common .filename-url{text-align:right} +.xwup_common .file-url .btn-folder{width:80px;height:25px;margin-right:14px;border:1px solid gray;border-radius:6px;background-color:#EFEFEF;background-image:url(../img/btn_bg.png);text-align:center;vertical-align:top} +.xwup_common .file-url .txt-url{width:516px;height:24px;padding:0 5px;background:#f0f0f0;cursor:auto;line-height:24px} +.xwup_common .filename-url .txt-nurl{width:516px;height:24px;margin-left:4px;padding:0 0 0 2px;border:1px solid #c9c9c9;background:#f0f0f0;line-height:22px;vertical-align:middle} + +/* viewverify */ +.xwup_common .xwup-cert-infos{width:420px} +.xwup_common .xwup-cert-infos table{overflow-x:hidden;font-size:11px;table-layout:fixed} +.xwup_common .xwup-cert-infos th.filed-value{width:100px;text-align:center} +.xwup_common .xwup-cert-infos th.value-end{width:296px;text-align:center} +.xwup_common .xwup-cert-infos img{margin-right:5px} +.xwup_common .xwup-cert-infos button{width:100px} +.xwup_common .xwup-textview{overflow:auto;width:400px;height:323px;margin:0 0 10px;padding:5px 7px 5px 7px;background-color:#fff;border:1px solid #6C9CDA;resize:none;box-sizing:content-box} +.xwup_common .xwup-textview2{overflow:auto;width:404px;height:63px;margin:0 0 3px;padding:5px 7px 5px 7px;background-color:#fff;border:1px solid #6C9CDA;resize:none;box-sizing:content-box} +.xwup_common .xwup-textview3{overflow:auto;width:450px;height:160px;margin:0 0 3px;padding:5px 7px 5px 7px;background-color:#fff;border:1px solid #6C9CDA;resize:none;box-sizing:content-box} + +/* savelog */ +.xwup_common .xwup-slsave{margin:6px 0 0 0} +.xwup_common .xwup-slremovable{margin:6px 0 0 0} +.xwup_common .xwup-slselect-cert{width:180px;margin:6px 0px 10px 0} +.xwup_common .xwup-sl-pkcs{margin:6px 0 0 6px} +.xwup_common .xwup-sl-securedisk{margin:6px 0 0 6px} + +/* changepasswd */ +.xwup_common .xwup-ch-title{margin:0 10px 0 0} +.xwup_common .xwup-ch-title table{width:370px} +.xwup_common .xwup-ch-title .timg{margin:7px 8px 0 0} +.xwup_common .xwup-ch-section{width:100%} +.xwup_common .xwup-ch-section .xwup-input-pwd{overflow:hidden;width:170px;height:24px;line-height:24px;padding:0 4px;margin:0 5px} +.xwup_common .xwup-widget-sec2{position:relative;width:100%;height:0px} +.xwup_common .xwup-widget-sec2.fb{display:inline-block;color:#000;font-weight:bold} +.xwup_common .xwup-widget-sec2.fc{color:#000} +.xwup_common .xwup-widget-sec2 .xwup-expire-alert{display:none;width:195px;position:absolute;padding:7px;border:1px solid gray;border-radius:6px;background:#FFF;text-align:left;-webkit-border-radius:6px;box-shadow:3px 3px 10px gray;-webkit-box-shadow:3px 3px 10px gray} + +/* commondialog */ +.xwup_common .xwup-dialog-sec{width:100%;margin:0px 0px 20px;text-align:center;word-wrap:break-word} + +/* confimwindow */ +.xwup_common .xwup-confim-area{overflow:hidden;width:338px;height:380px;padding:10px} + +/* export */ +.xwup_common .xwup-export-area{width:100%;height:240px} +.xwup_common .xwup-export-guide {border:0;padding:0 0 10px 10px} +.xwup_common .xwup-export-sec .xwup-box-layout{margin:0 0 10px} +.xwup_common .xwup-export-sec .xwup-box-border{border:0} +.xwup_common .xwup-export-sec .xwup-box-border span{font-weight:bold;font-size:13px} +.xwup_common .xwup-export-sec2 .xwup-box-layout{margin:0 0 20px} +.xwup_common .xwup-export-sec2 .xwup-box-border{border:0} +.xwup_common .xwup-export-sec2 .xwup-box-border span{padding-left:6px} +.xwup_common .xwup-export-sec2 .filename{margin-bottom:5px} +.xwup_common .xwup-export-sec2 .find-btn{display:inline-block;width:80px;vertical-align:middle} +.xwup_common .xwup-export-sec2 .xwup-input-find{display:inline-block;overflow:hidden;width:240px;height:22px;margin:3px 0 0 6px;line-height:22px;vertcial-align:middle} +.xwup_common .xwup-ex-passwd .xwup-passwd-group{margin:3px 0 10px} +.xwup_common .xwup-ex-passwd .xwup-passwd-group .input-passwd{width:245px} +.xwup_common .xwup-ex-passwd .xwup-passwd-group .input-mouse{margin:0 4px 0 0} +.xwup_common .xwup-passwd-group .pw-txt{display:block;margin:0 0 7px} +.xwup_common .xwup-passwd-group .input-passwd{overflow:hidden;width:370px;height:24px;margin:0 5px 0 0;padding:0 4px;line-height: 24px} +.xwup_common .xwup-export-area .xwup-expire-alert{display:none;width:180px} +.xwup_common .xwup-export-area .xwup-input-find{width:260px} +.xwup_common .xwup-btn-find{width:68px;height:25px;margin:0 5px;border:1px solid gray;border-radius:6px;background-color:#EFEFEF;background-image:url(../img/btn_bg.png);text-align:center;vertical-align:middle} + +/* hmsselect */ +.xwup_common .description-layout{height:16px;margin:10px 0 0 0;padding:2px 0 0 0;background-color:#ccc;text-align:center} + +/* import */ +.xwup_common .xwup-import-area{height:240px} +.xwup_common .xwup-import-area .xwup-select-sert{margin:15px 0} +.xwup_common .xwup-import-area .xwup-tit-import{margin:0 0 3px;font-weight:bold} +.xwup_common .xwup-import-area .xwup-input-imfile,.xwup_common .xwup-import-area .xwup-input-imfile2{overflow:hidden;width:350px;_height:24px;margin:0 0 5px;line-height:24px;background:#fff;_border:1px solid #777} +.xwup_common .xwup-import-area .xwup-input-imfile2{width:210px;margin:0 5px 0 0} +.xwup_common .xwup-import-area .xwup-import-passwd{margin:15px 0 0 0} + +/* inputpasswd */ +.xwup_common .xwup-inpwd-sec .xwup-input-name{margin:0 10px 0 0} +.xwup_common .xwup-inpwd-sec .xwup-input-pwd{overflow:hidden;width:165px;height:24px;margin:0 5px;padding:0 4px;line-height:24px} + +/* iccard */ +.xwup_common .xwup-inpwd-sec2{position:relative;padding:20px} +.xwup_common .xwup-inpwd-sec2 .xwup-input-name{display:block;margin:0 10px 13px 0} +.xwup_common .xwup-inpwd-sec2 .xwup-input-pwd{overflow:hidden;width:165px;height:24px;margin:0px 5px 0 0;padding:0 4px;line-height:24px} +.xwup_common .xwup-inpwd-sec2 .xwup-buttons-layout{margin:10px 0px 0px 0px} + +/* iccardlist */ +.xwup_common .xwup-iccardlist{margin:10px} +.xwup_common .xwup-iccardlist .xwup-tableview{_width:300px;height:125px} + +/* scpselect */ +.xwup_common .xwup-scpselect{margin:10px} +.xwup_common .xwup-scpselect .xwup-tableview{_width:420px;height:170px} + +/* rootverify */ +.xwup_common .xwup-boxtitle{margin:10px 0 0 0;font-size:11px;font-weight:bold;color:#606060} +.xwup_common .xwup-content-box2{display:none;margin:0 0 8px;padding:5px 0px 3px 5px;border:1px solid #a0a0a0;border-radius:5px;text-align:center} +.xwup_common .xwup-verify-input{width:100%;margin:0 0 5px} +.xwup_common .xwup-verify-info{margin:10px 0 15px 0;text-align:left} +.xwup_common .xwup-verify-info .info{margin-bottom:8px;font-weight:bold;text-decoration:underline} + +/* savepasswd */ +.xwup_common .xwup-savepwd-sec .xwup-input-pwd{overflow:hidden;width:154px;height:24px;margin:0 5px;padding:0 4px;line-height:24px} +.xwup_common .xwup-txt-message{padding:0 14px 10px;line-height:18px} + +/* usernotify */ +.xwup_common .xwup-usernoti-box{width:344px;height:288px;padding:5px;border:1px solid #949494} + +/* verifyhsm */ +.xwup_common .xwup-verrify-sec .xwup-input-pwd{overflow:hidden;width:190px;height:24px;margin:0 5px;padding:0 4px;line-height:24px} + +/* verifyvid */ +.xwup_common .xwup-veriid-sec .xwup-input-name{display:block;margin:0 0 5px} +.xwup_common .xwup-veriid-sec .xwup-input-pwd{overflow:hidden;width:330px;height:24px;margin:0 5px;padding:0 4px;line-height:24px} + +/* guidewindow */ +.xwup_common .xwup-guidewindow{text-align:center;margin-top:10px} + +/* pfxdialog */ +.xwup_common .xwup-tit-pfxdialog{margin:0 0 3px;font-weight:bold} +.xwup_common .xwup-pfx-drag{border:2px dashed #bbb;/*border-radius:5px;*/padding:10px;text-align:center;color:#bbb} +.xwup_common .xwup-drag-guide-certselect{display:none;border:2px dashed #bbb;padding-top:29px;text-align:center;color:#bbb;width:404px;height:80px;margin-left:1px;position:absolute;top:-129px;box-sizing:content-box} +.xwup_common .xwup-drag-guide-certselect2{display:none;border:2px dashed #fff;padding-top:36px;text-align:center;color:#bbb;width:412px;height:108px;margin-left:-3px;position:absolute;top:-160px;} +.xwup_common .xwup-drag-guide-certmanager{display:none;border:2px dashed #bbb;padding-top:21px;text-align:center;color:#bbb;width:420px;height:88px;margin-left:1px;position:absolute;top:-129px;} +.xwup_common .xwup-drag-guide-certmanager2{display:none;border:2px dashed #fff;padding-top:40px;text-align:center;color:#bbb;width:428px;height:104px;margin-left:-3px;position:absolute;top:-160px;z-index:-1} +.xwup_common .xwup-drag-overlay-certselect{width:452px;height:578px;top:-575px;left:0;} +.xwup_common .xwup-drag-overlay-certmanager{width:500px;height:585px;top:-582px;left:0;} +.xwup_common .xwup-drag-guide-certselectwide{display:none;border:2px dashed #bbb;padding-top:20px;text-align:center;color:#bbb;width:903px;height:73px;margin-left:20px;margin-top:9px;position:absolute;top:-107px} +.xwup_common .xwup-drag-guide-certselectwide2{display:none;border:2px dashed #bbb;padding-top:30px;text-align:center;color:#bbb;width:903px;height:97px;margin-left:20px;margin-top:9px;position:absolute;top:-138px} +.xwup_common .xwup-drag-overlay-certselectwide{width:948px;height:325px;top:-320px;left:0;} +.xwup_common .xwup-drag-guide-certselectmini{display:none;border:2px dashed #bbb;padding-top:29px;text-align:center;color:#bbb;width:404px;height:80px;margin-left:1px;position:absolute;top:-129px;} +.xwup_common .xwup-drag-overlay-certselectmini{width:422px;height:384px;top:-396px;left:14px;} +.xwup_common .xwup-drag-hover{border:2px dashed #20509f;background-color:#bcd5ff} +.xwup_common .xwup-drag-guide-span{color:grey;} +.xwup_common .xwup-drag-guide-span-hover{color:#000;} +.xwup_common .xwup-input-pfxfile{overflow:hidden;width:300px} +.xwup_common .xwup-pfx-filebox label {display: inline-block;padding: .5em .75em;color:#fff;font-size: inherit;line-height: normal;vertical-align: middle;background-color: #337ab7;cursor: pointer;border: 1px solid #2e6da4;border-radius: .25em} +/*.xwup_common .xwup-pfx-filebox2 {display: inline-block;padding: .5em .75em;color:#fff;font-size: inherit;line-height: normal;vertical-align: middle;background-color: #337ab7;cursor: pointer;border: 1px solid #2e6da4;border-radius: .25em}*/ +.xwup_common .xwup-pfx-filebox input[type="file"] {position: absolute;width: 1px;height: 1px;padding: 0;margin: -1px;overflow: hidden;clip:rect(0,0,0,0);border: 0} + +/* xfslogin */ +.xwup_common .xwup-xfs-section{width:100%} +.xwup_common .xwup-xfs-section .xwup-password-field label{vertical-align:baseline} +.xwup_common .xwup-xfs-section .xwup-input-pwd{overflow:hidden;width:170px;height:24px;line-height:24px;padding:0 4px;margin:0 5px} +.xwup_common .xwup-xfs-section .xwup-buttons-layout3 button{vertical-align:middle} +.xwup_common .xwup-xfs-section .xwup-buttons-layout3 input[type="checkbox"]{margin:0 5px;} +.xwup_common .xwup-xfs-regist{width:100%;text-align:right;text-decoration:underline} +/* +.xwup_common .xwup-widget-sec2{position:relative;width:100%;height:0px} +.xwup_common .xwup-widget-sec2.fb{display:inline-block;color:#000;font-weight:bold} +.xwup_common .xwup-widget-sec2.fc{color:#000} +.xwup_common .xwup-widget-sec2 .xwup-expire-alert{display:none;width:195px;position:absolute;padding:7px;border:1px solid gray;border-radius:6px;background:#FFF;text-align:left;-webkit-border-radius:6px;box-shadow:3px 3px 10px gray;-webkit-box-shadow:3px 3px 10px gray} +*/ + +/* certselectwide */ +.xwup_common .xwup-title-wide{height:55px;background:#fff;color:#20509f} +.xwup_common .xwup-title-wide h3{height:55px;font-size:20px;line-height:55px;color:#20509f;letter-spacing:-2px} +.xwup_common .xwup-location-wideitem{width:946px} +.xwup_common .xwup-location-wideitem span{display:inline-block;height:34px;background-repeat:no-repeat;vertical-align:middle;cursor:pointer} +.xwup_common .xwup-location-wideitem .xwup-rbg-text{display:inline-block;height:auto;margin:2px 0 0;vertical-align:middle;background:none} +.xwup_common .xwup-location-wideitem td{height:45px} +.xwup_common .xwup-location-wideitem button{display:block;position:relative;height:45px;margin:0 -1px;border:1px solid #c7c7c7;border-bottom:1px solid #346ad5;border-radius:4px 4px 0 0;background:#fff;color:#000;white-space:nowrap;-webkit-border-radius:4px 4px 0 0;z-index:10} +.xwup_common .xwup-wide-rbg{text-align:center} +.xwup_common .xwup-wide-rbg:hover{color:#0078d4} +.xwup_common .xwup-location-wideitem .wide-xwup-rbg-pressed{zoom:1;padding:0 0 1px;border:1px solid #346ad5;border-bottom:0;z-index:20;color:#0078d4;text-align:center} +.xwup_common .xwup-wide-body{margin:0 -1px;*margin:0 0 0 -1px;padding:20px 0;border:1px solid #346ad5} +.xwup_common .wide-cert-table-outline{overflow-x:hidden;overflow-y:auto;height:126px;margin:0 20px 0 20px;border-bottom:1px solid #c7c7c7;zoom:1} +.xwup_common .wide-cert-table-outline table.wide-cert-table{width:100%;margin-right:-1px;border-top:1px solid #000;table-layout:fixed} +.xwup_common .xwup-wide-body .wide-cert-table-outline table.wide-cert-table thead{background:#e9e9e9} +.xwup_common .xwup-wide-body .wide-cert-table-outline table.wide-cert-table th{width:25%;border-right:1px solid #e9e9e9;background-color:#efefef} +.xwup_common .xwup-wide-body .wide-cert-table-outline table.wide-cert-table th div{height:30px;line-height:30px;font-weight:bold;text-align:center;vertical-align:middle} +.xwup_common .xwup-wide-body .wide-cert-table-outline table.wide-cert-table th .wide-cert-table-resizearea{zoom:1} +.xwup_common .button-on-table{width:70px;height:24px;margin-right:10px;border:1px solid #c7c7c7;font-size:11px;background-image:url(../img/btn_bg.png);background-color:transparent;border-radius:4px;text-align:center} +.xwup_common .button-on-table:hover{color:#0078d4} +.xwup_common .xwup-password-field-wide{height:45px;margin:0 20px;padding:0 0 0 10px;border:1px solid #c7c7c7} +.xwup_common .xwup-password-field-wide table{width:100%;height:100%} +.xwup_common .xwup-password-field-wide img{vertical-align:middle} +.xwup_common .xwup-password-field-wide .xwup-password-input-wide{width:269px;height:24px;line-height:24px;padding:0 0 0 5px;margin:0 5px;vertical-align:middle;overflow:hidden;border:1px solid #0078d4;font-size:12px;font-family:Dotum,Helvetica,AppleGothic,Sans-serif;color:#000} +.xwup_common .xwup-password-field-wide .xwup-password-label-wide{color:#0078D4;font-weight:bold;font-size:16px} +.xwup_common .xwup-password-field-wide .xwup-password-text-wide{display:inline;color:#986e3b;margin-left:5px} + + /* Conetxt Menu */ +.xwup_common .context-menu-item-focused{background:#6C9CDA;color:#FFF} +.xwup_common .context-menu-item-unfocused{background:transparent;color:#000} +.xwup_common .xwup-content-box{margin-top:10px;border:1px solid #949494} +.xwup_common .xwup-content-box table{width:100%} +.xwup_common .xwup-content-box td{vertical-align:top} +.xwup_common .xwup-content-box button{width:90px;height:25px;margin:5px;border:1px solid #c7c7c7;border-radius:6px;background-image:url(../img/btn_bg.png);text-align:center;vertical-align:top} +.xwup_common .xwup-content-box .cert-buttons{width:100px} +.xwup_common .xwup-ico-save,.xwup_common .xwup-ico-del,.xwup_common .xwup-ico-pfx16,.xwup_common .xwup-ico-prop,.xwup_common .xwup-ico-secure05,.xwup_common .xwup-ico-misc25,.xwup_common .xwup-ico-install{width:16px;height:16px;cursor:pointer} +.xwup_common .xwup-ico-save{width:20px;height:18px;background-image:url(../img/save.png)} +.xwup_common .xwup-ico-del{width:20px;height:18px;background-image:url(../img/delete.png)} +.xwup_common .xwup-ico-pfx16{width:20px;height:18px;background-image:url(../img/pfx16.png)} +.xwup_common .xwup-ico-prop{width:20px;height:18px;background-image:url(../img/prop.png)} +.xwup_common .xwup-ico-secure05{width:20px;height:18px;background-image:url(../img/secure05.png)} +.xwup_common .xwup-ico-misc25{width:20px;height:18px;background-image:url(../img/misc25.png)} +.xwup_common .xwup-ico-install{width:20px;height:18px;background-image:url(../img/install.png)} + +/* TabView */ +.xwup_common .layout-tab-content{display:block;clear:both;margin-bottom:10px;padding:20px 0px;border:2px solid #6C9CDA;border-radius:0px 12px 12px;-moz-border-radius:0px 12px 12px;background-color:#fff;text-align:center} +.xwup_common ul.tabnav{float:left;position:relative;margin:10px 0 0;padding:0;color:#666;cursor:pointer;text-align:left} +.xwup_common ul.tabnav li{display:inline-block;*display:inline;margin:0px;padding:6px 10px 2px;border-bottom-width:0px;border-radius:6px 6px 0px 0px;-moz-border-radius:6px 6px 0px 0px;list-style:none;*zoom:1} +.xwup_common .tabnav-unselected{margin:0;border:1px solid #999;border-bottom-width:0;background-color:#f9f9f9;list-style:none;font-weight:normal;color:#000} +.xwup_common .xwup-tab-list ul li.tabnav-selected{margin:0;border:1px solid #6c9cda;border-bottom-width:0;background-color:#6c9cda;color:#fff;list-style:none} +.xwup_common .xwup-tab-list ul li.tabnav-selected a{color:#fff} +.xwup_common .tabcontent-unselected{display:none} +.xwup_common .tabcontent-selected{display:inline-block;*display:inline;text-align:center;*zoom:1} +.xwup_common .tabcontent-selected .xwup-tableview{height:300px;margin:10px 0 18px} + +.xwup_common .xwup-td-style-case1{height:30px;padding:0;border-bottom:1px solid #e3e3e3;border-right:1px solid #e3e3e3;border-top-color:transparent;word-wrap:normal} +.xwup_common .xwup-td-style-case2{padding:0;border-bottom:1px solid #e3e3e3;border-right:1px solid #e3e3e3;border-top-color:transparent;word-wrap:normal} +.xwup_common .xwup-td-style-case3{padding:0;border-bottom:1px solid #e3e3e3;border-top-color:transparent;word-wrap:normal} +.xwup_common .context-menu-item-focused{background-color:#6c9cda;color:#fff} +.xwup_common .context-menu-item-unfocused{background-color:transparent;color:#000} +.xwup_common .context-menu-layout{position:absolute;*display:block;min-width:190px;background:#fff;font-size:16px;cursor:default;box-shadow:10px 12px 35px gray;-moz-box-shadow:10px 12px 35px gray;-webkit-box-shadow:10px 12px 35px gray} +.xwup_common .ul-list-type1{margin:0;padding:3px;list-style:none} +.xwup_common .ul-list-type1 li{display:block;padding:3px 10px;font-weight:bold;font-size:16px;text-decoration:none;white-space:nowrap} +.xwup_common .info-type1{display:block;margin:7px 0 0;font-weight:bold;font-size:11px} + +.xwup_common .frame-type1{width:401px;height:160px;padding:4px;border:1px solid gray;background:#fff} +.xwup_common .xwup_btn_ok{background:url(../img/btn_ok_blue_eng.png) no-repeat} +.xwup_common .xwup_btn_cancel{background:url(../img/btn_cancel_blue_eng.png) no-repeat} +.xwup_common .certselect_input_type1{height:18px;padding:5px 0 0 5px} +.xwup_common .xwup-td-style-case1 .xwup-tableview-cell,.xwup_common .xwup-td-style-case2 .xwup-tableview-cell,.xwup_common .xwup-td-style-case3 .xwup-tableview-cell{text-align:center} +.xwup_common .xwup-td-style-case3 .xwup-tableview-cell button{width:74px;height:25px;margin:0 0 0 5px;color:#000;border:1px solid gray;border-radius:4px;-moz-border-radius:2px;font-size:12px;text-align:center} +.xwup_common .xwup-td-style-case3 .xwup-tableview-cell button:hover{color:#0078d4} +.xwup_common .xwup-td-style-case3 .xwup-tableview-cell button:first-child{margin:0} + +.xwup_common .xwup_expire_alert{position:absolute;top:0;left:0;z-index:200;padding:10px;background:#fff;border:1px solid gray} +.xwup_common .xwup-table-mini{overflow-y:auto;width:auto;height:140px;margin:10px 0 15px;border:1px solid #949494} +.xwup_common .xwup-table-mini table{width:100%;margin:0;border:0;table-layout:fixed} +.xwup_common .xwup-table-mini table thead{border-bottom:1px solid #c7c7c7;background:#f5f5f5 url(../img/btn_bg.png)} +.xwup_common .xwup-table-mini table th.xwup-mcert,.xwup_common .xwup-table-mini table th.xwup-mcert2,.xwup_common .xwup-table-mini table th.xwup-mcert3,.xwup_common .xwup-table-mini table th.xwup-mcert4{position:static;width:82px;padding:5px 0;background:#f5f5f5;font-weight:bold;text-align:center;white-space:nowrap;text-overflow:eliipsis;cursor:default} +.xwup_common .xwup-table-mini table th.xwup-mcert2{width:164px} +.xwup_common .xwup-table-mini table td .xwup-tableview-cell{text-align:center !Important} +.xwup_common div.xwup-complete-page{position:relative} +.xwup_common p.xwup-txt-notice{position:absolute;top:100px;left:150px;width:215px} + +/* Bug & IE6 */ +.xwup_common iframe.not{position:absolute;top:0;left:0;background:transparent;z-index:-1;width:900px;height:900px;filter:alpha(opacity=0);opacity:0} +.xwup_common button[disabled="disabled"]{background:none;color:gray;cursor:default} +.xwup_common .xwup-group-btn-layout button.xwup-size180[disabled="disabled"] span{color:gray;cursor:default} + +/* design modify - img */ +/* 타이틀 영역 */ +.xwup_common .title,.xwup_common .xwup-title{top:0;left:0;width:100%;height:45px;border-radius:0;background:url(../img/btn_background.gif) repeat-x;cursor:move} /* 1px 이미지로 repeat시킨 Type */ +/*.xwup_common .title,.xwup_common .xwup-title{top:0;left:0;width:100%;height:45px;border-radius:0;background:#20509f url(../img/title_bg.png) no-repeat 100% 50%;cursor:move}*/ /* 단색위에 이미지얹어진 형태 (우측에 이미지) */ +/*.xwup_common .title,.xwup_common .xwup-title{top:0;left:0;width:100%;height:45px;border-radius:0;background:#20509f url(../img/title_bg.png) no-repeat 0 50%;cursor:move}*/ /* 단색위에 이미지얹어진 형태 (좌측에 이미지) */ +/*.xwup_common .title,.xwup_common .xwup-title{top:0;left:0;width:100%;height:45px;border-radius:0;background:#20509f;cursor:move}*/ /* 단색으로만 되어있는 형태 */ +.xwup_common .title h3,.xwup_common .xwup-title h3{color:#777} + +/* 배너 */ +.xwup_common #xwup_header .banner{width:410px;height:66px} /* 이미지크기에 따라 같이 변경해야함. */ + +/* 인증서 위치내부 이미지 */ +/* 공통 */ +.xwup_common .xwup-cert-position span,.xwup_common .xwup-cert-position2 span{height:32px} +/* 활성화 */ +.xwup_common .xwup-ico-localstorage{width:32px;background-image:url(../img/icon_localstorage.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_localstorage.png', sizingMethod='crop')} +.xwup_common .xwup-ico-memorystorage{width:32px;background-image:url(../img/icon_memorystorage.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_memorystorage.png', sizingMethod='crop')} +.xwup_common .xwup-ico-hdd{width:32px;background-image:url(../img/icon_hdd.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_hdd.png', sizingMethod='crop')} +.xwup_common .xwup-ico-removable{width:32px;background-image:url(../img/icon_removable.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_removable.png', sizingMethod='crop')} +.xwup_common .xwup-ico-savetoken{width:32px;background-image:url(../img/icon_savetoken.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_savetoken.png', sizingMethod='crop')} +.xwup_common .xwup-ico-securedisk{width:32px;background-image:url(../img/icon_securedisk.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_securedisk.png', sizingMethod='crop')} +.xwup_common .xwup-ico-xfs{width:32px;background-image:url(../img/icon_cloud.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_cloud.png', sizingMethod='crop')} +.xwup_common .xwup-ico-nfciccard{width:32px;background-image:url(../img/icon_nfciccard.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_nfciccard.png', sizingMethod='crop')} +.xwup_common .xwup-ico-smartcert{width:32px;background-image:url(../img/icon_smartcert.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_smartcert.png', sizingMethod='crop')} +.xwup_common .xwup-ico-pkcs11{width:32px;background-image:url(../img/icon_pkcs11.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_pkcs11.png', sizingMethod='crop')} +.xwup_common .xwup-ico-mobile{width:32px;background-image:url(../img/icon_mobile.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_mobile.png', sizingMethod='crop')} +.xwup_common .xwup-ico-arrow-left{width:6px;background-image:url(../img/icon_arrow_left.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_localstorage.png', sizingMethod='crop')} +.xwup_common .xwup-ico-arrow-right{width:6px;background-image:url(../img/icon_arrow_right.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_localstorage.png', sizingMethod='crop')} + +/* 비활성화 */ +.xwup_common .xwup-ico-localstorage-disabled{width:32px;background-image:url(../img/icon_localstorage_disabled.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_localstorage_disabled.png', sizingMethod='crop')} +.xwup_common .xwup-ico-memorystorage-disabled{width:32px;background-image:url(../img/icon_memorystorage_disabled.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_memorystorage_disabled.png', sizingMethod='crop')} +.xwup_common .xwup-ico-hdd-disabled{width:32px;background-image:url(../img/icon_hdd_disabled.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_hdd_disabled.png', sizingMethod='crop')} +.xwup_common .xwup-ico-removable-disabled{width:32px;background-image:url(../img/icon_removable_disabled.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_removable_disabled.png', sizingMethod='crop')} +.xwup_common .xwup-ico-savetoken-disabled{width:32px;background-image:url(../img/icon_savetoken_disabled.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_savetoken_disabled.png', sizingMethod='crop')} +.xwup_common .xwup-ico-securedisk-disabled{width:32px;background-image:url(../img/icon_securedisk_disabled.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_securedisk_disabled.png', sizingMethod='crop')} +.xwup_common .xwup-ico-xfs-disabled{width:32px;background-image:url(../img/icon_cloud_disabled.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_cloud_disabled.png', sizingMethod='crop')} +.xwup_common .xwup-ico-nfciccard-disabled{width:32px;background-image:url(../img/icon_nfciccard_disabled.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_nfciccard_disabled.png', sizingMethod='crop')} +.xwup_common .xwup-ico-smartcert-disabled{width:32px;background-image:url(../img/icon_smartcert_disabled.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_smartcert_disabled.png', sizingMethod='crop')} +.xwup_common .xwup-ico-pkcs11-disabled{width:32px;background-image:url(../img/icon_pkcs11_disabled.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_pkcs11_disabled.png', sizingMethod='crop')} +.xwup_common .xwup-ico-mobile-disabled{width:32px;background-image:url(../img/icon_mobile_disabled.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_mobile_disabled.png', sizingMethod='crop')} +.xwup_common .xwup-ico-arrow-left-disabled{width:6px;background-image:url(../img/icon_arrow_left_disabled.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_localstorage.png', sizingMethod='crop')} +.xwup_common .xwup-ico-arrow-right-disabled{width:6px;background-image:url(../img/icon_arrow_right_disabled.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_localstorage.png', sizingMethod='crop')} + +/* design modify - border */ +.xwup_cert_pop{border-width:1px 1px 5px 1px;border-color:#777;box-shadow:10px 12px 45px gray;-webkit-box-shadow:10px 12px 45px gray} /* 팝업UI */ +.xwup_cert_wide{border-width:0 0 5px 0;border-color:#777} /* 바닥UI */ + +.xwup_common .context-menu-layout{border-width:3px 3px 3px 3px;border-style:solid;border-color:#20509f} +.xwup_common .xwup-drag-zone{position:absolute;border-radius:4px;background-color:#000;opacity:0.1;display:none} +.xwup_common .xwup-loader-img{display:block;margin-left:192px;margin-top:30px} + +.xwup_common .xwup-information-close {position:absolute;margin-left:-24px;margin-top:9px;cursor:pointer} +.xwup_common .xwup-information-link {text-decoration:underline;vertical-align:bottom;font-weight:bold} +.xwup_common .xwup-information-box {position:absolute;top:506px;width:100%;text-align:center} +.xwup_common .xwup-information-space {margin-top:10px} diff --git a/src/main/webapp/AnySign4PC/AnySign4PC/css/common_min.css b/src/main/webapp/AnySign4PC/AnySign4PC/css/common_min.css new file mode 100644 index 00000000..af0b1982 --- /dev/null +++ b/src/main/webapp/AnySign4PC/AnySign4PC/css/common_min.css @@ -0,0 +1 @@ +@charset "utf-8"; .xwup_common{background:0;background-color:transparent;background-image:none;background-position:0;background-repeat:repeat;background-size:auto;box-shadow:none;box-sizing:border-box;clear:none;color:inherit;empty-cells:show;float:none;font:normal;font-family:inherit;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;height:auto;left:auto;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:none;list-style-type:none;margin:0;max-height:none;max-width:none;min-height:0;min-width:0;opacity:1;overflow:visible;padding:0;table-layout:auto;text-align:left;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-shadow:none;vertical-align:middle;visibility:inherit;white-space:normal;widows:0;width:auto;word-spacing:normal;z-index:auto;position:static;cursor:auto}.xwup_cert_wide,.xwup_cert_pop,.xwup_cert_mini{display:block;visibility:visible;overflow:visible;height:auto;background-color:#fff;color:#000;font-weight:normal;line-height:normal;background-image:none;cursor:auto}.xwup_cert_mini{width:600px;border:0}.xwup_cert_pop{position:absolute;top:0;left:0;border-style:solid}.xwup_cert_wide{border-style:solid}.xwup_common div,.xwup_common a,.xwup_common span,.xwup_common table,.xwup_common tr,.xwup_common th,.xwup_common td,.xwup_common ul,.xwup_common ol,.xwup_common li,.xwup_common dl,.xwup_common dt,.xwup_common dd,.xwup_common form,.xwup_common button,.xwup_common fieldset,.xwup_common legend,.xwup_common select,.xwup_common textarea,.xwup_common p,.xwup_common label,.xwup_common input,.xwup_common h1,.xwup_common h2,.xwup_common h3,.xwup_common h4,.xwup_common h5,.xwup_common h6,.xwup_common blockquote{margin:0;padding:0;font-family:'Malgun Gothic',Dotum,Helvetica,AppleGothic,Sans-serif;font-size:12px;color:#000;background:0;background-color:transparent;background-image:none;background-position:0;background-repeat:repeat;background-size:auto;box-shadow:none;clear:none;empty-cells:show;float:none;font:normal;font-style:normal;font-variant:normal;font-weight:normal;height:auto;left:auto;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:none;list-style-type:none;margin:0;opacity:1;overflow:visible;padding:0;table-layout:auto;text-align:left;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-shadow:none;vertical-align:middle;visibility:inherit;white-space:normal;widows:0;width:auto;word-spacing:normal;z-index:auto;position:static;cursor:auto}.xwup_common img,.xwup_common fieldset{border:0}.xwup_common form,.xwup_common fieldset,.xwup_common legend,.xwup_common input,.xwup_common button,.xwup_common textarea,.xwup_common select{color:#000;font-size:12px}.xwup_common button::-moz-focus-inner{padding:0;border:0}.xwup_common ul,.xwup_common ol{list-style:none}.xwup_common table{border-collapse:collapse}.xwup_common label{cursor:default}.xwup_common input,.xwup_common textarea{display:inline-block;font-size:13px;vertical-align:middle}.xwup_common textarea{resize:none}.xwup_common address,.xwup_common em{font-style:normal}.xwup_common fieldset,.xwup_common img{border:0;position:relative}.xwup_common em{font-style:normal}.xwup_common h3{top:0}.xwup_common button{cursor:pointer}.xwup_common a{text-decoration:none;cursor:pointer}.xwup_common table{border-collapse:collapse}.xwup_common th,.xwup_common td{padding:0;vertical-align:middle;text-align:left;font-weight:normal}.xwup_common input[type="text"],.xwup_common input[type="password"],.xwup_common input[type="email"],.xwup_common input[type="search"],.xwup_common input[type="image"],.xwup_common input[type="button"],.xwup_common textarea{border:1px solid #777;background:#fff;-webkit-appearance:none;border-radius:0}.xwup_common input[type="checkbox"]:checked{background-color:#fff;-webkit-appearance:checkbox}.xwup_common input[type="text"],.xwup_common input[type="password"]{height:18px;position:relative;margin:1px 2px 0;padding:2px 3px 3px;border:1px solid #777;background:#fff;color:#000}.xwup_common .lt-css3 input[type="text"],.xwup_common input[type="password"]{padding:1px 3px 4px}.xwup_common input[type="text"]:focus,.xwup_common input[type="password"]:focus,.xwup_common textarea:focus{border:1px solid #009ae6;outline-width:0}.xwup_common input[disabled="disabled"]{background:#f0f0f0;border:1px solid #f0f0f0;color:#555}.xwup_common input[readonly="readonly"]{background:#f0f0f0;border:1px solid #777;color:#555}.xwup_common .disabled{background:#f0f0f0;border:1px solid #f0f0f0;color:#555}.xwup_common input.error-input{background:#fff;border:1px solid #ff4b2a;color:#000}.xwup_common .form-error{display:block;background:url(../img/common/etc/ico_form_error.gif) no-repeat left 5px;padding:0 0 0 23px;color:#ff4b2a;vertical-align:top}.xwup_common input[type="checkbox"],.xwup_common input[type="radio"]{width:13px;height:13px;margin:0;padding:0;vertical-align:middle;line-height:27px}.xwup_common select{position:relative;height:25px;vertical-align:middle;border:1px solid #777;padding:2px 2px 2px 0;margin:-1px 0 0 2px}.xwup_common .ie7 select{line-height:1.65;font-family:'돋움',dotum;padding:4px 4px 5px 0}.xwup_common .xwup_mbottom img{height:auto;margin-right:5px;vertical-align:middle}.xwup_common .hidden{overflow:hidden;position:absolute;top:-9999px;left:-9999px;width:0;height:0;font-size:0;line-height:0;text-indent:-9999px}.xwup_common .w100{width:100px}.xwup_common div.xwup-w300-body{width:300px}.xwup_common div.xwup-w400-body{width:400px}.xwup_common div.xwup-w410-body{width:410px}.xwup_common div.xwup-w420-body{width:420px}.xwup_common div.xwup-w500-body{width:500px}.xwup_common div.xwup-w530-body{width:530px}.xwup_common div.xwup-w730-body{width:730px}.xwup_common div.xwup-w946-body{width:946px}.xwup_common .xwup-font10{font-size:10px}.xwup_common .xwup-degap{margin:10px 10px 20px}.xwup_common .xwup-mr5{margin-right:15px}.xwup_common .xwup-fontb{font-weight:bold}.xwup_common .xwup_mbottom{margin:0 0 10px;text-align:left}.xwup_common .xwup-legend{display:block;*display:inline-block;margin:0 0 0 5px;background-color:#fff;font-weight:normal;text-align:left}.xwup_common caption{visibility:hidden;width:0;height:0;line-height:0;position:relative}.xwup_common .xwup-h140{height:140px}.xwup_common .xwup-str-pd0{padding:0}.xwup_common .brt-color-none{border-top-color:transparent}.xwup_common .xwup-wrd-normal{word-wrap:normal}.xwup_common .xwup-ovf-yscroll{oveflow:hidden;overflow-y:scroll}.xwup_common .xwup-ovf-yscroll-none{overflow-y:hidden}.xwup_common .xwup-title2{_width:452px}.xwup_common .title h3,.xwup_common .xwup-title h3{height:40px;padding:0 0 0 15px;font-size:18px;line-height:40px;letter-spacing:-2px;font-weight:bold;cursor:move}.xwup_common .xwup-title h3{font-weight:bold}.xwup_common .xwup-title-mini{top:0;left:0;width:100%;height:30px;margin-bottom:-15px;border-radius:0;background:none}.xwup_common .xwup-title-mini h3{font-size:20px;height:31px;color:#000;background:none;line-height:27px;vertical-align:middle;letter-spacing:-2px}.xwup_common .xwup-body{margin:0 20px 20px 20px;padding-top:20px}.xwup_common .blank0,.xwup_common .xwup-blank0{overflow:hidden;position:absolute;top:-9999px;left:-9999px;width:0;height:0;font-size:0;line-height:0;text-indent:-9999px}.xwup_common .blank10,.xwup_common .xwup-blank10{height:10px;margin:0}.xwup_common .blank15,.xwup_common .xwup-blank15{height:15px;margin:0}.xwup_common .xwup-buttons-layout,.xwup_common .xwup-buttons-layout2,.xwup_common .xwup-buttons-layout4{display:block;margin:15px 0;text-align:center}.xwup_common .xwup-buttons-layout2{text-align:right}.xwup_common .xwup-buttons-layout3{text-align:left}.xwup_common .xwup-buttons-layout4{margin:0;text-align:right}.xwup_common .xwup-buttons-layout button,.xwup_common .xwup-buttons-layout2 button,.xwup_common .xwup-buttons-layout3 button,.xwup_common .xwup-buttons-layout4 button{height:25px;margin:0 5px;padding:0 13px;*padding:0 10px;_padding:0 10px;border:1px solid gray;border-radius:6px;background-color:#EFEFEF;background-image:url(../img/btn_bg.png);text-align:center;vertical-align:top}.xwup_common .xwup-buttons-layout .ok,.xwup_common .xwup-buttons-layout2 .ok,.xwup_common .xwup-buttons-layout3 .ok,.xwup_common .xwup-buttons-layout4 .ok{overflow:hidden;height:28px;border:0;background:url(../img/btn_ok_blue.png);line-height:9000px;cursor:pointer}.xwup_common .xwup-buttons-layout .cancel,.xwup_common .xwup-buttons-layout2 .cancel,.xwup_common .xwup-buttons-layout3 .cancel,.xwup_common .xwup-buttons-layout4 .cancel{overflow:hidden;height:28px;border:0;background:url(../img/btn_cancel.png);line-height:9000px;cursor:pointer}.xwup_common .xwup-buttons-layout .view,.xwup_common .xwup-buttons-layout2 .view,.xwup_common .xwup-buttons-layout3 .view,.xwup_common .xwup-buttons-layout4 .view{margin:5px;padding:0 13px;border:1px solid #c7c7c7;border-radius:4px;-webkit-border-radius:4px}.xwup_common .xwup-button-disabled{color:gray}.xwup_common .xwup-box-layout{position:relative;padding-top:7px}.xwup_common .xwup-box-border{display:block;padding:10px;border:1px solid #c7c7c7}.xwup_common .xwup-close-button{background:url(../img/btn_pop_close.png) no-repeat;position:absolute;height:15px;width:15px;top:14px;right:13px}.xwup_common div.xwup-tab-view{display:block;clear:both;padding:15px;border:2px solid #6C9CDA;border-radius:0 8px 8px 8px;background-color:#fff;text-align:left;zoom:1}.xwup_common div.xwup-tab-list ul{float:left;position:relative;margin:0;padding:0;color:#666;text-align:left}.xwup_common div.xwup-tab-list ul li{display:inline-block;*display:inline;margin:0;border:1px solid #999;border-bottom:0;border-radius:6px 6px 0 0;background:#f9f9f9;list-style-type:none;*zoom:1}.xwup_common div.xwup-tab-list ul li a{display:block;padding:6px 10px 2px;font-weight:normal;color:#000;list-style:none;white-space:nowrap}.xwup_common div.xwup-tab-list .selected a{border-top:1px solid #6c9cda;border-right:1px solid #6c9cda;background-color:#6C9CDA;font-weight:bold;color:#FFF;list-style:none}.xwup_common div.xwup-tab-list .tmenu{width:46px}.xwup_common div.xwup-tab-list .tmenu2{width:98px}.xwup_common div.xwup-tab-list .tmenu3{width:138px}.xwup_common div.xwup-tab-list .tmenu4{width:98px}.xwup_common div.xwup-tab-list .tmenu5{width:48px}.xwup_common div.xwup-tab-list .tmenu6{width:60px}.xwup_common .xwup-for-password{display:inline-block;margin:0;font-weight:bold;color:#000;vertical-align:top}.xwup_common .xwup-password{overflow:hidden;margin:0 5px;padding:0 0 0 5px;border:1px solid;font-size:12px;vertical-align:middle}.xwup_common .xwup-checkbox{margin:0 5px 0 0}.xwup_common .xwup-location-item{display:block;margin:0;padding:0 0 5px;border:1px solid #949494}.xwup_common .xwup-location-item button{display:inline-block;*display:block;width:78px;height:62px;padding:2px;border:2px solid #fff;border-radius:6px;background:#fff}.xwup_common fieldset.manager{display:inline-block;*display:inline;width:207px;height:125px;margin:10px 2px 0;padding:2px 0;border:1px solid #949494;text-align:center;*zoom:1}.xwup_common fieldset.manager .xwup-legend{margin:0 0 0 10px}.xwup_common .importexport{display:block;overflow:hidden;margin-top:15px;padding:0 10px 10px;border:1px solid #949494}.xwup_common .importexport div{margin:8px 0 3px}.xwup_common .p10x10-gray1{display:block;overflow:hidden;padding:10px;border:1px solid #949494;text-align:left}.xwup_common .p10x10-gray1 .group{margin-top:3px}.xwup_common .p10x10-gray1 input{width:13px;height:13px;vertical-align:middle}.xwup_common .p10x10-gray1 label{vertical-align:middle}.xwup_common .p10x10-gray1 .margin-top{margin-top:12px}.xwup_common .p10x10-gray1 .margin-bottom{margin-bottom:12px}.xwup_common .xwup-cert-position,.xwup_common .xwup-cert-position2{margin:7px 4px 5px;table-layout:fixed;zoom:1}.xwup_common .xwup-cert-position2{width:410px;margin:7px 7px 5px}.xwup_common .xwup-cert-position td,.xwup_common .xwup-cert-position2 td{width:20%}.xwup_common .xwup-cert-position span,.xwup_common .xwup-cert-position2 span{display:block;margin:0 auto;background-repeat:no-repeat;cursor:pointer}.xwup_common .xwup-cert-position .xwup-rbg-text,.xwup_common .xwup-cert-position2 .xwup-rbg-text{display:block;height:auto;margin:2px 0 0;text-align:center;background:none;cursor:pointer}.xwup_common .mngr-btn-text{display:inline-block;margin:2px 0 0;text-align:center}.xwup_common .mngr-btn-img{display:inline-block;height:16px;margin:0 0 0 15px;background-repeat:no-repeat}.xwup_common .xwup-location-item .xwup-rbg-normal{background:#fff;border-color:#fff}.xwup_common .xwup-location-item .xwup-rbg-hover,.xwup_common .xwup-location-item .xwup-rbg-pressed{background:#eee;border-color:#999 #ddd #ddd #999}.xwup_common .xwup-location-item .xwup-rbg-disabled{border:2px solid #FFF;background-color:#fff;background-image:none}.xwup_common .exclamation{display:inline-block;width:16px;height:16px;margin:4px 0 0;background-image:url(../img/bu.png);background-repeat:no-repeat}.xwup_common .xwup-password-field,.xwup_common .xwup-password-field2{margin:8px 0 0}.xwup_common .xwup-password-field2{text-align:center}.xwup_common .xwup-password-field label,.xwup_common .xwup-password-field2 label{display:inline-block;min-width:100px;_width:100px;margin:0 10px 0 0;text-align:right}.xwup_common .xwup-password-field2 label{width:145px}.xwup_common .xwup-group-btn-layout{display:block;height:132px;text-align:left}.xwup_common .xwup-group-btn-layout button{width:75px;height:25px;border:1px solid gray;border-radius:6px;background-color:#efefef;background-image:url(../img/btn_bg.png);text-align:center;vertical-align:top;cursor:pointer}.xwup_common .xwup-group-btn-layout span{display:inline-block;margin:0 5px;background-repeat:no-repeat;vertical-align:middle;cursor:pointer}.xwup_common span.xwup-group-btn-desc{display:inline-block;height:12px;margin:10px 5px;text-align:left;vertical-align:top;*zoom:1}.xwup_common .xwup-group-btn-layout .xwup-size150{width:150px;margin:8px 0 0;padding:1px 0 1px 7px;background-repeat:no-repeat;background-position:10% 50%;text-align:left}.xwup_common .xwup-group-btn-layout .xwup-size180{width:180px;margin:8px 0 0;padding:1px 0 1px 5px;background-repeat:no-repeat;background-position:10% 50%;text-align:left}.xwup_common .xwup-tableview{overflow-x:hidden;overflow-y:auto;position:relative;width:100%;_width:423px;height:140px;margin:10px 0 15px;border:1px solid #949494;box-sizing:content-box}.xwup_common .xwup-tableview table{width:100%;margin:0;border-width:0;table-layout:fixed}.xwup_common .xwup-tableview caption{visibility:hidden;width:0;height:0;line-height:0}.xwup_common .xwup-tableview thead{border:0;border-bottom:1px solid #c7c7c7;background:#f5f5f5;background-image:url(../img/btn_bg.png);font-weight:bold}.xwup_common .xwup-tableview th{position:static;padding:5px 0;background-color:#f5f5f5;font-weight:bold;text-align:center;white-space:nowrap;text-overflow:ellipsis;cursor:default}.xwup_common .xwup-tableview th .wide-cert-table-resizearea{position:relative;zoom:1;text-align:center;font-weight:bold}.xwup_common .xwup-tableview .xwup-mcert{width:82px}.xwup_common .xwup-tableview .xwup-mcert2{width:164px}.xwup_common .xwup-tableview .xwup-mcert3{width:82px}.xwup_common .xwup-tableview .xwup-mcert4{width:82px}.xwup_common .xwup-tableview tbody tr{border-bottom:1px solid #e3e3e3}.xwup_common .xwup-tableview td{padding:0 5px;border:1px solid #eee;border-width:0 1px 1px 0;word-wrap:normal}.xwup_common .xwup-tableview-cell{overflow:hidden;width:100%;max-width:100%;margin:0;padding:1px 0;text-align:left;white-space:nowrap;text-overflow:ellipsis;cursor:pointer;word-wrap:normal}.xwup_common .xwup-tableview-cell img{vertical-align:middle}.xwup_common .xwup-tableview-selected-row td{background-color:#6c9cda;color:#fff;cursor:pointer}.xwup_common .xwup-tableview-selected-row .xwup-tableview-cell{color:#fff}.xwup_common .xwup-tableview-unselected-row{background-color:transparent;color:#000;cursor:pointer}.xwup_common .xwup-tableview-resizer{position:absolute;top:-5px;left:100%;width:6px;height:27px;margin-left:-3px;*margin-left:4px;cursor:w-resize}.xwup_common .xwup-tableview-button{width:15px}.xwup_common .xwup-tableview-viewbutton{width:70px;height:24px;margin:0 2px;border:1px solid #c7c7c7;border-radius:4px;background-color:#FFF;font-size:11px;text-align:center;cursor:pointer}.xwup_common .xwup-widget-sec{position:relative;width:100%;height:0px}.xwup_common .xwup-widget-sec .fb{display:inline-block;color:#000;font-weight:bold}.xwup_common .xwup-widget-sec .fc{color:#000}.xwup_common .exclamation-image{display:inline-block;margin:4px 0 0 0;width:16px;height:16px;background:url(../img/bu.png) no-repeat}.xwup_common .xwup-cert-passwd{padding-left:10px}.xwup_common .xwup-cert-passwd span{display:block;padding:10px 0 2px}.xwup_common .xwup-passwd-field{width:100%;height:26px;padding:13px 0 0;color:#986e3b;box-sizing:content-box}.xwup_common .xwup-passwd-field .xwup-tit-pw{display:inline-block;font-weight:bold;color:#000;margin:0;padding-top:5px;vertical-align:top;cursor:default}.xwup_common .xwup-passwd-field .xwup-pw-box{width:180px;height:18px;margin-left:4px;padding-left:4px;border:1px solid #000;vertical-align:middle;color:#000;box-sizing:content-box}.xwup_common .xwup-passwd-field img{margin-right:4px;vertical-align:middle}.xwup_common .xwup-passwd-field span{display:inline-block;padding:0;vertical-align:middle}.xwup_common .xwup-expire-alert{display:none;width:220px;position:absolute;padding:7px;border:1px solid gray;border-radius:6px;background:#FFF;text-align:left;-webkit-border-radius:6px;box-shadow:3px 3px 10px gray;-webkit-box-shadow:3px 3px 10px gray}.xwup_common .xwup-expire-icon{display:block;position:absolute;top:0;left:0;margin:0;padding:10px}.xwup_common .xwup-expire-message{display:block;margin-left:28px;font-weight:bold}.xwup_common .xwup-renew-message{display:block;margin-left:28px}.xwup_common .xwup-expire-arrow{position:absolute;top:-19px;left:30px;width:0;height:0;border:10px solid;border-color:transparent transparent #FFF}.xwup_common .xwup-expire-arrow-border{position:absolute;top:-20px;left:30px;width:0;height:0;border:10px solid;border-color:transparent transparent #c7c7c7}.xwup_common #xwup_header{text-align:center}.xwup_common .xwup-medialist{display:inline-block;*float:left;overflow-x:scroll;overflow-y:auto;width:160px;height:250px;border:1px solid #949494;background-color:#fff;margin:14px 14px 14px 0px;cursor:auto}.xwup_common .xwup-medialist table{width:100%}.xwup_common .xwup-medialist td{overflow:hidden;padding:2px 3px 1px;text-overflow:ellipsis;white-space:nowrap}.xwup_common .xwup-medialist td a,.xwup_common .xwup-filelist td a{display:block}.xwup_common .xwup-medialist td span,.xwup_common .xwup-filelist td span{display:inline-block;width:16px;height:16px;margin:0 4px}.xwup_common .xwup-filelist{display:inline-block;overflow-x:scroll;overflow-y:auto;_float:left;width:512px;height:250px;border:1px solid #949494;background-color:#fff;margin:14px 0px;cursor:auto}.xwup_common .xwup-filelist table{width:100%;table-layout:fixed}.xwup_common .xwup-filelist td{overflow:hidden;padding:2px 10px 1px 3px;white-space:nowrap;cursor:default}.xwup_common .xwup-tab-list .selected{background-color:#3875D7;color:#fff}.xwup_common .media-list-image{display:inlinewidth:16px;height:16px;vertical-align:middle;margin-right:4px}.xwup_common .file-list-image{display:inline;width:16px;height:16px;vertical-align:middle}.xwup_common .file-list-cell{overflow:hidden;padding:2px 3px 1px 3px;border:0;white-space:nowrap;padding-right:10px;cursor:default}.xwup_common .file-url,.xwup_common .filename-url{text-align:right}.xwup_common .file-url .btn-folder{width:80px;height:25px;margin-right:14px;border:1px solid gray;border-radius:6px;background-color:#EFEFEF;background-image:url(../img/btn_bg.png);text-align:center;vertical-align:top}.xwup_common .file-url .txt-url{width:516px;height:24px;padding:0 5px;background:#f0f0f0;cursor:auto;line-height:24px}.xwup_common .filename-url .txt-nurl{width:516px;height:24px;margin-left:4px;padding:0 0 0 2px;border:1px solid #c9c9c9;background:#f0f0f0;line-height:22px;vertical-align:middle}.xwup_common .xwup-cert-infos{width:420px}.xwup_common .xwup-cert-infos table{overflow-x:hidden;font-size:11px;table-layout:fixed}.xwup_common .xwup-cert-infos th.filed-value{width:100px;text-align:center}.xwup_common .xwup-cert-infos th.value-end{width:296px;text-align:center}.xwup_common .xwup-cert-infos img{margin-right:5px}.xwup_common .xwup-cert-infos button{width:100px}.xwup_common .xwup-textview{overflow:auto;width:400px;height:323px;margin:0 0 10px;padding:5px 7px 5px 7px;background-color:#fff;border:1px solid #6C9CDA;resize:none;box-sizing:content-box}.xwup_common .xwup-textview2{overflow:auto;width:404px;height:63px;margin:0 0 3px;padding:5px 7px 5px 7px;background-color:#fff;border:1px solid #6C9CDA;resize:none;box-sizing:content-box}.xwup_common .xwup-textview3{overflow:auto;width:450px;height:160px;margin:0 0 3px;padding:5px 7px 5px 7px;background-color:#fff;border:1px solid #6C9CDA;resize:none;box-sizing:content-box}.xwup_common .xwup-slsave{margin:6px 0 0 0}.xwup_common .xwup-slremovable{margin:6px 0 0 0}.xwup_common .xwup-slselect-cert{width:180px;margin:6px 0px 10px 0}.xwup_common .xwup-sl-pkcs{margin:6px 0 0 6px}.xwup_common .xwup-sl-securedisk{margin:6px 0 0 6px}.xwup_common .xwup-ch-title{margin:0 10px 0 0}.xwup_common .xwup-ch-title table{width:370px}.xwup_common .xwup-ch-title .timg{margin:7px 8px 0 0}.xwup_common .xwup-ch-section{width:100%}.xwup_common .xwup-ch-section .xwup-input-pwd{overflow:hidden;width:170px;height:24px;line-height:24px;padding:0 4px;margin:0 5px}.xwup_common .xwup-widget-sec2{position:relative;width:100%;height:0px}.xwup_common .xwup-widget-sec2.fb{display:inline-block;color:#000;font-weight:bold}.xwup_common .xwup-widget-sec2.fc{color:#000}.xwup_common .xwup-widget-sec2 .xwup-expire-alert{display:none;width:195px;position:absolute;padding:7px;border:1px solid gray;border-radius:6px;background:#FFF;text-align:left;-webkit-border-radius:6px;box-shadow:3px 3px 10px gray;-webkit-box-shadow:3px 3px 10px gray}.xwup_common .xwup-dialog-sec{width:100%;margin:0px 0px 20px;text-align:center;word-wrap:break-word}.xwup_common .xwup-confim-area{overflow:hidden;width:338px;height:380px;padding:10px}.xwup_common .xwup-export-area{width:100%;height:240px}.xwup_common .xwup-export-guide{border:0;padding:0 0 10px 10px}.xwup_common .xwup-export-sec .xwup-box-layout{margin:0 0 10px}.xwup_common .xwup-export-sec .xwup-box-border{border:0}.xwup_common .xwup-export-sec .xwup-box-border span{font-weight:bold;font-size:13px}.xwup_common .xwup-export-sec2 .xwup-box-layout{margin:0 0 20px}.xwup_common .xwup-export-sec2 .xwup-box-border{border:0}.xwup_common .xwup-export-sec2 .xwup-box-border span{padding-left:6px}.xwup_common .xwup-export-sec2 .filename{margin-bottom:5px}.xwup_common .xwup-export-sec2 .find-btn{display:inline-block;width:80px;vertical-align:middle}.xwup_common .xwup-export-sec2 .xwup-input-find{display:inline-block;overflow:hidden;width:240px;height:22px;margin:3px 0 0 6px;line-height:22px;vertcial-align:middle}.xwup_common .xwup-ex-passwd .xwup-passwd-group{margin:3px 0 10px}.xwup_common .xwup-ex-passwd .xwup-passwd-group .input-passwd{width:245px}.xwup_common .xwup-ex-passwd .xwup-passwd-group .input-mouse{margin:0 4px 0 0}.xwup_common .xwup-passwd-group .pw-txt{display:block;margin:0 0 7px}.xwup_common .xwup-passwd-group .input-passwd{overflow:hidden;width:370px;height:24px;margin:0 5px 0 0;padding:0 4px;line-height:24px}.xwup_common .xwup-export-area .xwup-expire-alert{display:none;width:180px}.xwup_common .xwup-export-area .xwup-input-find{width:260px}.xwup_common .xwup-btn-find{width:68px;height:25px;margin:0 5px;border:1px solid gray;border-radius:6px;background-color:#EFEFEF;background-image:url(../img/btn_bg.png);text-align:center;vertical-align:middle}.xwup_common .description-layout{height:16px;margin:10px 0 0 0;padding:2px 0 0 0;background-color:#ccc;text-align:center}.xwup_common .xwup-import-area{height:240px}.xwup_common .xwup-import-area .xwup-select-sert{margin:15px 0}.xwup_common .xwup-import-area .xwup-tit-import{margin:0 0 3px;font-weight:bold}.xwup_common .xwup-import-area .xwup-input-imfile,.xwup_common .xwup-import-area .xwup-input-imfile2{overflow:hidden;width:350px;_height:24px;margin:0 0 5px;line-height:24px;background:#fff;_border:1px solid #777}.xwup_common .xwup-import-area .xwup-input-imfile2{width:210px;margin:0 5px 0 0}.xwup_common .xwup-import-area .xwup-import-passwd{margin:15px 0 0 0}.xwup_common .xwup-inpwd-sec .xwup-input-name{margin:0 10px 0 0}.xwup_common .xwup-inpwd-sec .xwup-input-pwd{overflow:hidden;width:165px;height:24px;margin:0 5px;padding:0 4px;line-height:24px}.xwup_common .xwup-inpwd-sec2{position:relative;padding:20px}.xwup_common .xwup-inpwd-sec2 .xwup-input-name{display:block;margin:0 10px 13px 0}.xwup_common .xwup-inpwd-sec2 .xwup-input-pwd{overflow:hidden;width:165px;height:24px;margin:0px 5px 0 0;padding:0 4px;line-height:24px}.xwup_common .xwup-inpwd-sec2 .xwup-buttons-layout{margin:10px 0px 0px 0px}.xwup_common .xwup-iccardlist{margin:10px}.xwup_common .xwup-iccardlist .xwup-tableview{_width:300px;height:125px}.xwup_common .xwup-scpselect{margin:10px}.xwup_common .xwup-scpselect .xwup-tableview{_width:420px;height:170px}.xwup_common .xwup-boxtitle{margin:10px 0 0 0;font-size:11px;font-weight:bold;color:#606060}.xwup_common .xwup-content-box2{display:none;margin:0 0 8px;padding:5px 0px 3px 5px;border:1px solid #a0a0a0;border-radius:5px;text-align:center}.xwup_common .xwup-verify-input{width:100%;margin:0 0 5px}.xwup_common .xwup-verify-info{margin:10px 0 15px 0;text-align:left}.xwup_common .xwup-verify-info .info{margin-bottom:8px;font-weight:bold;text-decoration:underline}.xwup_common .xwup-savepwd-sec .xwup-input-pwd{overflow:hidden;width:154px;height:24px;margin:0 5px;padding:0 4px;line-height:24px}.xwup_common .xwup-txt-message{padding:0 14px 10px;line-height:18px}.xwup_common .xwup-usernoti-box{width:344px;height:288px;padding:5px;border:1px solid #949494}.xwup_common .xwup-verrify-sec .xwup-input-pwd{overflow:hidden;width:190px;height:24px;margin:0 5px;padding:0 4px;line-height:24px}.xwup_common .xwup-veriid-sec .xwup-input-name{display:block;margin:0 0 5px}.xwup_common .xwup-veriid-sec .xwup-input-pwd{overflow:hidden;width:330px;height:24px;margin:0 5px;padding:0 4px;line-height:24px}.xwup_common .xwup-guidewindow{text-align:center;margin-top:10px}.xwup_common .xwup-tit-pfxdialog{margin:0 0 3px;font-weight:bold}.xwup_common .xwup-pfx-drag{border:2px dashed #bbb;padding:10px;text-align:center;color:#bbb}.xwup_common .xwup-drag-guide-certselect{display:none;border:2px dashed #bbb;padding-top:29px;text-align:center;color:#bbb;width:404px;height:80px;margin-left:1px;position:absolute;top:-129px;box-sizing:content-box}.xwup_common .xwup-drag-guide-certselect2{display:none;border:2px dashed #fff;padding-top:36px;text-align:center;color:#bbb;width:412px;height:108px;margin-left:-3px;position:absolute;top:-160px;}.xwup_common .xwup-drag-guide-certmanager{display:none;border:2px dashed #bbb;padding-top:21px;text-align:center;color:#bbb;width:420px;height:88px;margin-left:1px;position:absolute;top:-129px;}.xwup_common .xwup-drag-guide-certmanager2{display:none;border:2px dashed #fff;padding-top:40px;text-align:center;color:#bbb;width:428px;height:104px;margin-left:-3px;position:absolute;top:-160px;z-index:-1}.xwup_common .xwup-drag-overlay-certselect{width:452px;height:578px;top:-575px;left:0;}.xwup_common .xwup-drag-overlay-certmanager{width:500px;height:585px;top:-582px;left:0;}.xwup_common .xwup-drag-guide-certselectwide{display:none;border:2px dashed #bbb;padding-top:20px;text-align:center;color:#bbb;width:903px;height:73px;margin-left:20px;margin-top:9px;position:absolute;top:-107px}.xwup_common .xwup-drag-guide-certselectwide2{display:none;border:2px dashed #bbb;padding-top:30px;text-align:center;color:#bbb;width:903px;height:97px;margin-left:20px;margin-top:9px;position:absolute;top:-138px}.xwup_common .xwup-drag-overlay-certselectwide{width:948px;height:325px;top:-320px;left:0;}.xwup_common .xwup-drag-guide-certselectmini{display:none;border:2px dashed #bbb;padding-top:29px;text-align:center;color:#bbb;width:404px;height:80px;margin-left:1px;position:absolute;top:-129px;}.xwup_common .xwup-drag-overlay-certselectmini{width:422px;height:384px;top:-396px;left:14px;}.xwup_common .xwup-drag-hover{border:2px dashed #20509f;background-color:#bcd5ff}.xwup_common .xwup-drag-guide-span{color:grey;}.xwup_common .xwup-drag-guide-span-hover{color:#000;}.xwup_common .xwup-input-pfxfile{overflow:hidden;width:300px}.xwup_common .xwup-pfx-filebox label{display:inline-block;padding:.5em .75em;color:#fff;font-size:inherit;line-height:normal;vertical-align:middle;background-color:#337ab7;cursor:pointer;border:1px solid #2e6da4;border-radius:.25em}.xwup_common .xwup-pfx-filebox input[type="file"]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.xwup_common .xwup-xfs-section{width:100%}.xwup_common .xwup-xfs-section .xwup-password-field label{vertical-align:baseline}.xwup_common .xwup-xfs-section .xwup-input-pwd{overflow:hidden;width:170px;height:24px;line-height:24px;padding:0 4px;margin:0 5px}.xwup_common .xwup-xfs-section .xwup-buttons-layout3 button{vertical-align:middle}.xwup_common .xwup-xfs-section .xwup-buttons-layout3 input[type="checkbox"]{margin:0 5px;}.xwup_common .xwup-xfs-regist{width:100%;text-align:right;text-decoration:underline}.xwup_common .xwup-title-wide{height:55px;background:#fff;color:#20509f}.xwup_common .xwup-title-wide h3{height:55px;font-size:20px;line-height:55px;color:#20509f;letter-spacing:-2px}.xwup_common .xwup-location-wideitem{width:946px}.xwup_common .xwup-location-wideitem span{display:inline-block;height:34px;background-repeat:no-repeat;vertical-align:middle;cursor:pointer}.xwup_common .xwup-location-wideitem .xwup-rbg-text{display:inline-block;height:auto;margin:2px 0 0;vertical-align:middle;background:none}.xwup_common .xwup-location-wideitem td{height:45px}.xwup_common .xwup-location-wideitem button{display:block;position:relative;height:45px;margin:0 -1px;border:1px solid #c7c7c7;border-bottom:1px solid #346ad5;border-radius:4px 4px 0 0;background:#fff;color:#000;white-space:nowrap;-webkit-border-radius:4px 4px 0 0;z-index:10}.xwup_common .xwup-wide-rbg{text-align:center}.xwup_common .xwup-wide-rbg:hover{color:#0078d4}.xwup_common .xwup-location-wideitem .wide-xwup-rbg-pressed{zoom:1;padding:0 0 1px;border:1px solid #346ad5;border-bottom:0;z-index:20;color:#0078d4;text-align:center}.xwup_common .xwup-wide-body{margin:0 -1px;*margin:0 0 0 -1px;padding:20px 0;border:1px solid #346ad5}.xwup_common .wide-cert-table-outline{overflow-x:hidden;overflow-y:auto;height:126px;margin:0 20px 0 20px;border-bottom:1px solid #c7c7c7;zoom:1}.xwup_common .wide-cert-table-outline table.wide-cert-table{width:100%;margin-right:-1px;border-top:1px solid #000;table-layout:fixed}.xwup_common .xwup-wide-body .wide-cert-table-outline table.wide-cert-table thead{background:#e9e9e9}.xwup_common .xwup-wide-body .wide-cert-table-outline table.wide-cert-table th{width:25%;border-right:1px solid #e9e9e9;background-color:#efefef}.xwup_common .xwup-wide-body .wide-cert-table-outline table.wide-cert-table th div{height:30px;line-height:30px;font-weight:bold;text-align:center;vertical-align:middle}.xwup_common .xwup-wide-body .wide-cert-table-outline table.wide-cert-table th .wide-cert-table-resizearea{zoom:1}.xwup_common .button-on-table{width:70px;height:24px;margin-right:10px;border:1px solid #c7c7c7;font-size:11px;background-image:url(../img/btn_bg.png);background-color:transparent;border-radius:4px;text-align:center}.xwup_common .button-on-table:hover{color:#0078d4}.xwup_common .xwup-password-field-wide{height:45px;margin:0 20px;padding:0 0 0 10px;border:1px solid #c7c7c7}.xwup_common .xwup-password-field-wide table{width:100%;height:100%}.xwup_common .xwup-password-field-wide img{vertical-align:middle}.xwup_common .xwup-password-field-wide .xwup-password-input-wide{width:269px;height:24px;line-height:24px;padding:0 0 0 5px;margin:0 5px;vertical-align:middle;overflow:hidden;border:1px solid #0078d4;font-size:12px;font-family:Dotum,Helvetica,AppleGothic,Sans-serif;color:#000}.xwup_common .xwup-password-field-wide .xwup-password-label-wide{color:#0078D4;font-weight:bold;font-size:16px}.xwup_common .xwup-password-field-wide .xwup-password-text-wide{display:inline;color:#986e3b;margin-left:5px}.xwup_common .context-menu-item-focused{background:#6C9CDA;color:#FFF}.xwup_common .context-menu-item-unfocused{background:transparent;color:#000}.xwup_common .xwup-content-box{margin-top:10px;border:1px solid #949494}.xwup_common .xwup-content-box table{width:100%}.xwup_common .xwup-content-box td{vertical-align:top}.xwup_common .xwup-content-box button{width:90px;height:25px;margin:5px;border:1px solid #c7c7c7;border-radius:6px;background-image:url(../img/btn_bg.png);text-align:center;vertical-align:top}.xwup_common .xwup-content-box .cert-buttons{width:100px}.xwup_common .xwup-ico-save,.xwup_common .xwup-ico-del,.xwup_common .xwup-ico-pfx16,.xwup_common .xwup-ico-prop,.xwup_common .xwup-ico-secure05,.xwup_common .xwup-ico-misc25,.xwup_common .xwup-ico-install{width:16px;height:16px;cursor:pointer}.xwup_common .xwup-ico-save{width:20px;height:18px;background-image:url(../img/save.png)}.xwup_common .xwup-ico-del{width:20px;height:18px;background-image:url(../img/delete.png)}.xwup_common .xwup-ico-pfx16{width:20px;height:18px;background-image:url(../img/pfx16.png)}.xwup_common .xwup-ico-prop{width:20px;height:18px;background-image:url(../img/prop.png)}.xwup_common .xwup-ico-secure05{width:20px;height:18px;background-image:url(../img/secure05.png)}.xwup_common .xwup-ico-misc25{width:20px;height:18px;background-image:url(../img/misc25.png)}.xwup_common .xwup-ico-install{width:20px;height:18px;background-image:url(../img/install.png)}.xwup_common .layout-tab-content{display:block;clear:both;margin-bottom:10px;padding:20px 0px;border:2px solid #6C9CDA;border-radius:0px 12px 12px;-moz-border-radius:0px 12px 12px;background-color:#fff;text-align:center}.xwup_common ul.tabnav{float:left;position:relative;margin:10px 0 0;padding:0;color:#666;cursor:pointer;text-align:left}.xwup_common ul.tabnav li{display:inline-block;*display:inline;margin:0px;padding:6px 10px 2px;border-bottom-width:0px;border-radius:6px 6px 0px 0px;-moz-border-radius:6px 6px 0px 0px;list-style:none;*zoom:1}.xwup_common .tabnav-unselected{margin:0;border:1px solid #999;border-bottom-width:0;background-color:#f9f9f9;list-style:none;font-weight:normal;color:#000}.xwup_common .xwup-tab-list ul li.tabnav-selected{margin:0;border:1px solid #6c9cda;border-bottom-width:0;background-color:#6c9cda;color:#fff;list-style:none}.xwup_common .xwup-tab-list ul li.tabnav-selected a{color:#fff}.xwup_common .tabcontent-unselected{display:none}.xwup_common .tabcontent-selected{display:inline-block;*display:inline;text-align:center;*zoom:1}.xwup_common .tabcontent-selected .xwup-tableview{height:300px;margin:10px 0 18px}.xwup_common .xwup-td-style-case1{height:30px;padding:0;border-bottom:1px solid #e3e3e3;border-right:1px solid #e3e3e3;border-top-color:transparent;word-wrap:normal}.xwup_common .xwup-td-style-case2{padding:0;border-bottom:1px solid #e3e3e3;border-right:1px solid #e3e3e3;border-top-color:transparent;word-wrap:normal}.xwup_common .xwup-td-style-case3{padding:0;border-bottom:1px solid #e3e3e3;border-top-color:transparent;word-wrap:normal}.xwup_common .context-menu-item-focused{background-color:#6c9cda;color:#fff}.xwup_common .context-menu-item-unfocused{background-color:transparent;color:#000}.xwup_common .context-menu-layout{position:absolute;*display:block;min-width:190px;background:#fff;font-size:16px;cursor:default;box-shadow:10px 12px 35px gray;-moz-box-shadow:10px 12px 35px gray;-webkit-box-shadow:10px 12px 35px gray}.xwup_common .ul-list-type1{margin:0;padding:3px;list-style:none}.xwup_common .ul-list-type1 li{display:block;padding:3px 10px;font-weight:bold;font-size:16px;text-decoration:none;white-space:nowrap}.xwup_common .info-type1{display:block;margin:7px 0 0;font-weight:bold;font-size:11px}.xwup_common .frame-type1{width:401px;height:160px;padding:4px;border:1px solid gray;background:#fff}.xwup_common .xwup_btn_ok{background:url(../img/btn_ok_blue_eng.png) no-repeat}.xwup_common .xwup_btn_cancel{background:url(../img/btn_cancel_blue_eng.png) no-repeat}.xwup_common .certselect_input_type1{height:18px;padding:5px 0 0 5px}.xwup_common .xwup-td-style-case1 .xwup-tableview-cell,.xwup_common .xwup-td-style-case2 .xwup-tableview-cell,.xwup_common .xwup-td-style-case3 .xwup-tableview-cell{text-align:center}.xwup_common .xwup-td-style-case3 .xwup-tableview-cell button{width:74px;height:25px;margin:0 0 0 5px;color:#000;border:1px solid gray;border-radius:4px;-moz-border-radius:2px;font-size:12px;text-align:center}.xwup_common .xwup-td-style-case3 .xwup-tableview-cell button:hover{color:#0078d4}.xwup_common .xwup-td-style-case3 .xwup-tableview-cell button:first-child{margin:0}.xwup_common .xwup_expire_alert{position:absolute;top:0;left:0;z-index:200;padding:10px;background:#fff;border:1px solid gray}.xwup_common .xwup-table-mini{overflow-y:auto;width:auto;height:140px;margin:10px 0 15px;border:1px solid #949494}.xwup_common .xwup-table-mini table{width:100%;margin:0;border:0;table-layout:fixed}.xwup_common .xwup-table-mini table thead{border-bottom:1px solid #c7c7c7;background:#f5f5f5 url(../img/btn_bg.png)}.xwup_common .xwup-table-mini table th.xwup-mcert,.xwup_common .xwup-table-mini table th.xwup-mcert2,.xwup_common .xwup-table-mini table th.xwup-mcert3,.xwup_common .xwup-table-mini table th.xwup-mcert4{position:static;width:82px;padding:5px 0;background:#f5f5f5;font-weight:bold;text-align:center;white-space:nowrap;text-overflow:eliipsis;cursor:default}.xwup_common .xwup-table-mini table th.xwup-mcert2{width:164px}.xwup_common .xwup-table-mini table td .xwup-tableview-cell{text-align:center!Important}.xwup_common div.xwup-complete-page{position:relative}.xwup_common p.xwup-txt-notice{position:absolute;top:100px;left:150px;width:215px}.xwup_common iframe.not{position:absolute;top:0;left:0;background:transparent;z-index:-1;width:900px;height:900px;filter:alpha(opacity=0);opacity:0}.xwup_common button[disabled="disabled"]{background:none;color:gray;cursor:default}.xwup_common .xwup-group-btn-layout button.xwup-size180[disabled="disabled"] span{color:gray;cursor:default}.xwup_common .title,.xwup_common .xwup-title{top:0;left:0;width:100%;height:45px;border-radius:0;background:url(../img/btn_background.gif) repeat-x;cursor:move}.xwup_common .title h3,.xwup_common .xwup-title h3{color:#777}.xwup_common #xwup_header .banner{width:410px;height:66px}.xwup_common .xwup-cert-position span,.xwup_common .xwup-cert-position2 span{height:32px}.xwup_common .xwup-ico-localstorage{width:32px;background-image:url(../img/icon_localstorage.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_localstorage.png',sizingMethod='crop')}.xwup_common .xwup-ico-memorystorage{width:32px;background-image:url(../img/icon_memorystorage.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_memorystorage.png',sizingMethod='crop')}.xwup_common .xwup-ico-hdd{width:32px;background-image:url(../img/icon_hdd.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_hdd.png',sizingMethod='crop')}.xwup_common .xwup-ico-removable{width:32px;background-image:url(../img/icon_removable.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_removable.png',sizingMethod='crop')}.xwup_common .xwup-ico-savetoken{width:32px;background-image:url(../img/icon_savetoken.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_savetoken.png',sizingMethod='crop')}.xwup_common .xwup-ico-securedisk{width:32px;background-image:url(../img/icon_securedisk.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_securedisk.png',sizingMethod='crop')}.xwup_common .xwup-ico-xfs{width:32px;background-image:url(../img/icon_cloud.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_cloud.png',sizingMethod='crop')}.xwup_common .xwup-ico-nfciccard{width:32px;background-image:url(../img/icon_nfciccard.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_nfciccard.png',sizingMethod='crop')}.xwup_common .xwup-ico-smartcert{width:32px;background-image:url(../img/icon_smartcert.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_smartcert.png',sizingMethod='crop')}.xwup_common .xwup-ico-pkcs11{width:32px;background-image:url(../img/icon_pkcs11.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_pkcs11.png',sizingMethod='crop')}.xwup_common .xwup-ico-mobile{width:32px;background-image:url(../img/icon_mobile.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_mobile.png',sizingMethod='crop')}.xwup_common .xwup-ico-arrow-left{width:6px;background-image:url(../img/icon_arrow_left.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_localstorage.png',sizingMethod='crop')}.xwup_common .xwup-ico-arrow-right{width:6px;background-image:url(../img/icon_arrow_right.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_localstorage.png',sizingMethod='crop')}.xwup_common .xwup-ico-localstorage-disabled{width:32px;background-image:url(../img/icon_localstorage_disabled.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_localstorage_disabled.png',sizingMethod='crop')}.xwup_common .xwup-ico-memorystorage-disabled{width:32px;background-image:url(../img/icon_memorystorage_disabled.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_memorystorage_disabled.png',sizingMethod='crop')}.xwup_common .xwup-ico-hdd-disabled{width:32px;background-image:url(../img/icon_hdd_disabled.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_hdd_disabled.png',sizingMethod='crop')}.xwup_common .xwup-ico-removable-disabled{width:32px;background-image:url(../img/icon_removable_disabled.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_removable_disabled.png',sizingMethod='crop')}.xwup_common .xwup-ico-savetoken-disabled{width:32px;background-image:url(../img/icon_savetoken_disabled.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_savetoken_disabled.png',sizingMethod='crop')}.xwup_common .xwup-ico-securedisk-disabled{width:32px;background-image:url(../img/icon_securedisk_disabled.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_securedisk_disabled.png',sizingMethod='crop')}.xwup_common .xwup-ico-xfs-disabled{width:32px;background-image:url(../img/icon_cloud_disabled.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_cloud_disabled.png',sizingMethod='crop')}.xwup_common .xwup-ico-nfciccard-disabled{width:32px;background-image:url(../img/icon_nfciccard_disabled.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_nfciccard_disabled.png',sizingMethod='crop')}.xwup_common .xwup-ico-smartcert-disabled{width:32px;background-image:url(../img/icon_smartcert_disabled.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_smartcert_disabled.png',sizingMethod='crop')}.xwup_common .xwup-ico-pkcs11-disabled{width:32px;background-image:url(../img/icon_pkcs11_disabled.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_pkcs11_disabled.png',sizingMethod='crop')}.xwup_common .xwup-ico-mobile-disabled{width:32px;background-image:url(../img/icon_mobile_disabled.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_mobile_disabled.png',sizingMethod='crop')}.xwup_common .xwup-ico-arrow-left-disabled{width:6px;background-image:url(../img/icon_arrow_left_disabled.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_localstorage.png',sizingMethod='crop')}.xwup_common .xwup-ico-arrow-right-disabled{width:6px;background-image:url(../img/icon_arrow_right_disabled.png);_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../AnySign4PC/img/icon_localstorage.png',sizingMethod='crop')}.xwup_cert_pop{border-width:1px 1px 5px 1px;border-color:#777;box-shadow:10px 12px 45px gray;-webkit-box-shadow:10px 12px 45px gray}.xwup_cert_wide{border-width:0 0 5px 0;border-color:#777}.xwup_common .context-menu-layout{border-width:3px 3px 3px 3px;border-style:solid;border-color:#20509f}.xwup_common .xwup-drag-zone{position:absolute;border-radius:4px;background-color:#000;opacity:0.1;display:none}.xwup_common .xwup-loader-img{display:block;margin-left:192px;margin-top:30px}.xwup_common .xwup-information-close{position:absolute;margin-left:-24px;margin-top:9px;cursor:pointer}.xwup_common .xwup-information-link{text-decoration:underline;vertical-align:bottom;font-weight:bold}.xwup_common .xwup-information-box{position:absolute;margin-top:-30px;width:100%;text-align:center} \ No newline at end of file diff --git a/src/main/webapp/AnySign4PC/AnySign4PC/download/browserCertificate_user_guide.pdf b/src/main/webapp/AnySign4PC/AnySign4PC/download/browserCertificate_user_guide.pdf new file mode 100644 index 00000000..bcd52f3f Binary files /dev/null and b/src/main/webapp/AnySign4PC/AnySign4PC/download/browserCertificate_user_guide.pdf differ diff --git a/src/main/webapp/AnySign4PC/AnySign4PC/download/hConvert2pfx.exe b/src/main/webapp/AnySign4PC/AnySign4PC/download/hConvert2pfx.exe new file mode 100644 index 00000000..e22308fe Binary files /dev/null and b/src/main/webapp/AnySign4PC/AnySign4PC/download/hConvert2pfx.exe differ diff --git a/src/main/webapp/AnySign4PC/AnySign4PC/ext/AnySign.js b/src/main/webapp/AnySign4PC/AnySign4PC/ext/AnySign.js new file mode 100644 index 00000000..47467469 --- /dev/null +++ b/src/main/webapp/AnySign4PC/AnySign4PC/ext/AnySign.js @@ -0,0 +1,11 @@ +/*! +* AnySign, v1.0.1.21. +* +* For more information on this product, please see +* https://www.hsecure.co.kr/ +* +* Copyright (c) Hancom Secure Inc. All Rights Reserved. +* +* Date: 2019-08-21 +*/ +if(typeof AnySignForPCExtension=="undefined"){AnySignForPCExtension={};}AnySignForPCExtension.AnySign=function(){var cK;var webSocket;var callback=null;var ae={code:0,bA:""};var fT=[];var dZ=[];var xR=[];var pb="general";var eo=null;var lQ=false;var yF=false;var un=AnySign.mAnySignSID;var bw;var eD;var UW;var fh;var oY=0;var pk;var qU=AnySign.mBrowser.aName;var gS=false;var Az=0;var zB=false;var kw=0;var lc=true;var IQ=0;var lO=0;var pr=0;var abl=false;eStrASP(GetSafeResponse(loadSecurePro("anySignjQuery-1.11.1.js")));function reRun(){console.log("[AnySign for PC][AnySign_reRun_02000]");if(webSocket!=null){abl=true;webSocket.close();}webSocket=null;lQ=false;callback=null;AnySign.mAnySignLoad=false;var protocol=cK.substring(0,cK.length-5);cK=protocol+bw;gU();};function HY(){if(lQ){console.log("[AnySign for PC][AnySign_error_10000]");try{var hY=document.getElementById("xwup_title_guidewindow");if(hY!=null){AnySign.mExtensionSetting.mDialog.oncancel();alert("[AnySign for PC] 보안 프로그램이 비정상적으로 동작하였습니다. 다시 실행하겠습니다.");}}catch(e){console.log("[try catch] "+e.message);}reRun();}else if(gS==true){console.log("[AnySign for PC][AnySign_error_10001]");var time=new Date().getTime();if((time-kw)>120000)eY(AnySign.mPlatform.aInstallPage);else setTimeout(reRun,2000);}else if(pk=="FAILED"){console.log("[AnySign for PC][AnySign_error_10002]");return;}else if(fh==true){if(AnySign.mExtensionSetting.EV==1){console.log("[AnySign for PC][AnySign_error_10007]");AnySign.mExtensionSetting.mInstallCheck_State="ANYSIGN4PC_NEED_INSTALL";if(AnySign.mExtensionSetting.mInstallCheck_CB!=null){setTimeout(function(){AnySign.mExtensionSetting.mInstallCheck_CB("ANYSIGN4PC_NEED_INSTALL");AnySign.mExtensionSetting.mInstallCheck_CB=null;},100);}else if(AnySign.mExtensionSetting.mIgnoreInstallPage!=true){AnySign.mExtensionSetting.mIgnoreInstallPage=true;var fw=confirm("[AnySign for PC] 공인인증 보안 프로그램 설치가 필요합니다.\n[확인]을 선택하시면 설치페이지로 연결됩니다.");if(fw)eY(AnySign.mPlatform.aInstallPage);AnySign.mExtensionSetting.mImgIntervalError=true;}}else{var il;if(webSocket.url)il=webSocket.url;else il=webSocket.URL;if(window.location.protocol=="http:"&&il.indexOf("wss:")==0){bw=AnySign.mExtensionSetting.mDirectPort;eD=bw;cK="ws://127.0.0.1:"+eD;console.log("[AnySign for PC][AnySign_error_10003]");gU();}else{console.log("[AnySign for PC][AnySign_error_10004]");fh=false;Cz();}}}else{var il=null;if(UW3){if(AnySign.mExtensionSetting.mInstallCheck_CB!=null){AnySign.mExtensionSetting.mInstallCheck_CB("ANYSIGN4PC_NEED_INSTALL");AnySign.mExtensionSetting.mInstallCheck_CB=null;return;}AnySign.mExtensionSetting.mInstallCheck_State="ANYSIGN4PC_NEED_INSTALL";var fw=confirm("AnySign for PC 공인인증 보안 프로그램 설치가 필요합니다.\n[확인]을 선택하시면 설치페이지로 연결됩니다.");if(fw)eY(AnySign.mPlatform.aInstallPage);AnySign.mExtensionSetting.mImgIntervalError=true;return;}if(ae.code=="30002"&&AnySign.mPlatform.aName.indexOf("windows")==0){lc=false;fh=true;bw=Number(AnySign.mExtensionSetting.mDirectPort)+1;eD=bw;reRun();}else{AnySign.mExtensionSetting.mImgIntervalError=true;var awM;if(ae.code==30000)awM="AnySign4PC.exe 실행을 실패하였습니다.";else if(ae.code==30001)awM="버전 업그레이드가 필요합니다.";else if(ae.code==30002)awM="AnySign4PC.exe 실행에 필요한 정보를 획득하는데 실패하였습니다.";else if(ae.code==30003)awM="AnySign4PC.exe 에서 사용 가능한 통신 포트가 모두 사용중입니다.";else if(ae.code==30004)awM="AnySign4PC.exe 실행 후 소켓 연결 확인에 실패하였습니다.";else if(ae.code==30005)awM="AnySign4PC.exe 실행 후 소켓 연결 확인된 뒤 프로세스가 종료되었습니다.";var bA="[AnySign for PC] 서비스를 통한 AnySign4PC.exe 프로그램 실행에 실패하였습니다. 다시 실행하겠습니다.\n"+"["+ae.code+"] ["+awM+"]";reRun();alert(bA);}}else if(ae.code=="30001"){console.log("[AnySign for PC][AnySign_onmessage_01001]");if(AnySign.mExtensionSetting.mInstallCheck_CB!=null){abl=true;webSocket.close();setTimeout(function(){AnySign.mExtensionSetting.mInstallCheck_CB("ANYSIGN4PC_NEED_UPDATE");AnySign.mExtensionSetting.mInstallCheck_CB=null;},100);return;}if(AnySign.mAnySignLiveUpdate){if(gS){var time=new Date().getTime();if((time-kw)>120000)eY(AnySign.mPlatform.aInstallPage);else setTimeout(_setDemonInfo,2000);}else{kw=new Date().getTime();console.log("send message: updateready");_setUpdateState("updateready");}}else{AnySign.mExtensionSetting.mInstallCheck_State="ANYSIGN4PC_NEED_INSTALL";if(AnySign.mExtensionSetting.mIgnoreInstallPage!=true){AnySign.mExtensionSetting.mIgnoreInstallPage=true;var fw=confirm("[AnySign for PC] 공인인증 보안 프로그램 설치가 필요합니다.\n[확인]을 선택하시면 설치페이지로 연결됩니다.");if(fw)eY(AnySign.mPlatform.aInstallPage);AnySign.mExtensionSetting.mImgIntervalError=true;}}}else if(ae.code==0){var iy=cW.split(",");var protocol=cK.substring(0,cK.length-5);if(protocol.indexOf("wss:")==0){eD=iy[1];cK=protocol+iy[1];}else{eD=iy[0];cK=protocol+iy[0];}console.log("[AnySign for PC][AnySign_onmessage_01002]["+eD+"]");webSocket=null;if(gS&&AnySign.mPlatform.aName.indexOf("windows")==0){if(IQ<30){if(protocol.indexOf("wss:")==0){eD=Number(AnySign.mExtensionSetting.mDirectPort)+1;}else{eD=AnySign.mExtensionSetting.mDirectPort;}cK=protocol+eD;IQ++;}setTimeout(gU,2000);}else{gU();}}else{if(AnySign.mPlatform.aName.indexOf("windows")==0&&ae.code==20005)return;AnySign.mExtensionSetting.mInstallCheck_State="ANYSIGN4PC_NEED_INSTALL";var fw=confirm("[AnySign for PC] 공인인증 보안 프로그램 설치가 필요합니다.\n[확인]을 선택하시면 설치페이지로 연결됩니다.");if(fw)eY(AnySign.mPlatform.aInstallPage);AnySign.mExtensionSetting.mImgIntervalError=true;}break;case "setAttributeInfo":if(ae.code==30006||ae.code==30001){abl=true;webSocket.close();console.log("[AnySign for PC][AnySign_onmessage_01003]["+ae.code+"]");fh=false;yF=false;Cz();return;}AnySign.mAnySignLoad=true;console.log("[AnySign for PC][AnySign_onmessage_01004]");if(ae.code==20015){AnySign.mAnySignLoad=false;alert("[AnySign for PC] AnySign4PC.exe 프로그램 초기화에 실패하였습니다.\n"+"[실패 명령어] : "+ae.bA);return;}if(cW.length==0)cW=null;if(onSendToServer(cW)!=0){AnySign.mAnySignLoad=false;lQ=false;pk="FAILED";abl=true;webSocket.close();webSocket=null;console.log("[AnySign for PC][AnySign_onmessage_01005]");return;}if(gS){console.log("LiveUpdate success");gS=false;if(qU=="safari"&&AnySign.mPlatform.aName.indexOf("gP")==0){zB=true;}}AnySign.mExtensionSetting.mInstallCheck_State="ANYSIGN4PC_NORMAL";setTimeout(function(){if(document.getElementById("EncryptionAreaID_0")==null){AnySign.mPageBlockDecDone=true;ma();}},1000);while(fT[0]){var result=eo(fT[0]);fT.shift();_doSend(result);}if(AnySign.mExtensionSetting.mEncCallback){var rY=AnySign.mExtensionSetting.mEncCallback;AnySign.mExtensionSetting.mEncCallback="";rY();}if(AnySign.mExtensionSetting.mLoadCallback.func){var rX=AnySign.mExtensionSetting.mLoadCallback.func;var sT=AnySign.mExtensionSetting.mLoadCallback.param;AnySign.mExtensionSetting.mLoadCallback.func=null;AnySign.mExtensionSetting.mLoadCallback.param=null;rX(sT);}if(AnySign.mExtensionSetting.mInstallCheck_CB!=null){AnySign.mExtensionSetting.mInstallCheck_CB("ANYSIGN4PC_NORMAL");AnySign.mExtensionSetting.mInstallCheck_CB=null;}break;case "blockDecEx":for(var index=0;index0&&AnySign.mPageBlockDecDone==true){ma();}dZ.splice(index,1);for(var eh in fT){if(fT[eh].MessageUID==fJ){fT.splice(eh,1);}}}}break;case "blockEnc":case "blockEnc2":case "blockEncConvert2":if(callback&&dZ.length==0){callback(cW);}else{for(var index=0;indexAd){if(uu){if(oR!=null){if(oR!=Ja||zs!=AH){clearInterval(ps);zs=null;oR=null;AH=null;gU();}}if(uu)AH=_sendPingInfo(Ja,RS);}}};function reRun(){console.log("[AnySign for PC][AnySignAjax_reRun_02000]");webSocket=null;lQ=false;xg=false;AnySign.mAnySignLoad=false;var protocol=cK.substring(0,cK.length-5);cK=protocol+bw;gU();};function gU(){lT=new XDomainRequest();if(!xg&&fh==false){var message=_setDemonInfo();setTimeout(function(){_doSend(message);},300);}else{if(cK.indexOf("https:")==0){_setAttributeInfo(Jh);}else if(cK.indexOf("http:")==0){Secure.start("envelope",_doAjaxSend);}}lT.onload=function(){var fA,kI,fo,rJ,hw,cW,fJ,CN;var Sm=false;sf=new Date().getTime();uu=true;fA=lT.responseText;try{kI=JSON.parse(fA);xr=kI.protocolType;fo=kI.message;}catch(e){fh=false;var port=Number(AnySign.mExtensionSetting.mPort);if(window.location.protocol.indexOf("https:")==0){bw=port+1;cK="https://127.0.0.1:"+bw;}else{bw=port;cK="http://127.0.0.1:"+bw;}eD=bw;reRun();return;}if(xr=="secure"){AnySign.mExtensionSetting.mImgIntervalError=true;alert("[AnySign for PC] Internet Explorer 9 이하 버전에서는 Secure 보안프로토콜이 동작하지 않습니다.");return;}if(xr=="envelope"){try{CX=fo.messageType;switch(CX){case "application":fo=JSON.parse(Secure.receiveApplication(kI));break;case "server_hello":if(Secure.handShake(_doAjaxSend,kI)){pb="envelope";Hh=eo;eo=function(message){var Ab=JSON.stringify(message);return Secure.sendApplication(Ab);};_setAttributeInfo(Un);}else{alert("[AnySign for PC] Envelope 보안프로토콜 암호세션 생성이 실패하였습니다.\n\n보안프로토콜 인증서가 유효하지 않습니다. 다시 암호세션 생성을 시도하겠습니다.");gU();}return;default:alert("[AnySign for PC] Envelope 보안프로토콜이 정상적으로 동작하지 않았습니다.\n[메시지 코드] : "+fo.code);return;}}catch(aP){alert("[AnySign for PC] Envelope 보안프로토콜에 예외동작이 발생하였습니다.\n[예외처리 메시지] : "+aP);}}rJ=fo.InterfaceName;hw=fo.ReturnType;fJ=fo.MessageUID;CN=fo.SessionID;if(hw=="number")cW=Number(fo.ReturnValue);else cW=fo.ReturnValue;ae.code=fo.InterfaceErrorCode;ae.bA=fo.InterfaceErrorMessage;if(ae.code=="21000"){if(AnySign.mExtensionSetting.mInstallCheck_CB!=null){AnySign.mExtensionSetting.mInstallCheck_CB("ANYSIGN4PC_INTEGRITY_FAIL");}else{alert("[AnySign for PC] 공인인증 보안 프로그램의 동작을 중지합니다.\n악의적 공격에 의해 수정되었을 가능성이 있습니다.\n재설치 하시기 바랍니다.");eY(AnySign.mPlatform.aInstallPage);}return;}switch(rJ){case "launcher":if(ae.code=="30000"||ae.code=="30002"||ae.code=="30003"||ae.code=="30004"||ae.code=="30005"){console.log("[AnySign for PC][AnySignAjax_onload_01000]["+ae.code+"]");oY++;if(oY>3){if(AnySign.mExtensionSetting.mInstallCheck_CB!=null){AnySign.mExtensionSetting.mInstallCheck_CB("ANYSIGN4PC_NEED_INSTALL");AnySign.mExtensionSetting.mInstallCheck_CB=null;return;}AnySign.mExtensionSetting.mInstallCheck_State="ANYSIGN4PC_NEED_INSTALL";var fw=confirm("[AnySign for PC] 공인인증 보안 프로그램 설치가 필요합니다.\n[확인]을 선택하시면 설치페이지로 연결됩니다.");if(fw)eY(AnySign.mPlatform.aInstallPage);AnySign.mExtensionSetting.mImgIntervalError=true;return;}if(ae.code=="30002"&&AnySign.mPlatform.aName.indexOf("windows")==0){lc=false;fh=true;bw=Number(AnySign.mExtensionSetting.mDirectPort)+1;eD=bw;reRun();}else{AnySign.mExtensionSetting.mImgIntervalError=true;var awM;if(ae.code==30000)awM="AnySign4PC.exe 실행을 실패하였습니다.";else if(ae.code==30001)awM="버전 업그레이드가 필요합니다.";else if(ae.code==30002)awM="AnySign4PC.exe 실행에 필요한 정보를 획득하는데 실패하였습니다.";else if(ae.code==30003)awM="AnySign4PC.exe 에서 사용 가능한 통신 포트가 모두 사용중입니다.";else if(ae.code==30004)awM="AnySign4PC.exe 실행 후 소켓 연결 확인에 실패하였습니다.";else if(ae.code==30005)awM="AnySign4PC.exe 실행 후 소켓 연결 확인된 뒤 프로세스가 종료되었습니다.";var bA="[AnySign for PC] 서비스를 통한 AnySign4PC.exe 프로그램 실행에 실패하였습니다. 다시 실행하겠습니다.\n"+"["+ae.code+"] ["+awM+"]";alert(bA);}return;}else if(ae.code=="30001"){console.log("[AnySign for PC][AnySignAjax_onload_01001]");if(AnySign.mExtensionSetting.mInstallCheck_CB!=null){AnySign.mExtensionSetting.mInstallCheck_CB("ANYSIGN4PC_NEED_UPDATE");AnySign.mExtensionSetting.mInstallCheck_CB=null;return;}if(AnySign.mAnySignLiveUpdate){if(gS){var time=new Date().getTime();if((time-kw)>120000)eY(AnySign.mPlatform.aInstallPage);else setTimeout(function(){reRun();},2000);}else{var kg=document.getElementById("AnySign4PCLoadingImg");if(kg!=null){if(typeof AnySign.mLanguage==='string'&&AnySign.mLanguage.toLowerCase()=="ko-kr")kg.src=AnySign.mBasePath+"/img/loading_update.gif";else kg.src=AnySign.mBasePath+"/img/loading_update_en.gif";}else{try{if(AnySign.CU.Fj){AnySign.mExtensionSetting.EZ=setInterval(function(){showAnySignLoadingImg("update");},50);}}catch(aP){console.log("[try catch] "+aP.message);}}kw=new Date().getTime();gS=true;console.log("[AnySign4PC] send message: updateready");_setUpdateState("updateready");}}else{AnySign.mExtensionSetting.mInstallCheck_State="ANYSIGN4PC_NEED_INSTALL";if(AnySign.mExtensionSetting.mIgnoreInstallPage!=true){var fw=confirm("[AnySign for PC] 공인인증 보안 프로그램 설치가 필요합니다.\n[확인]을 선택하시면 설치페이지로 연결됩니다.");if(fw)eY(AnySign.mPlatform.aInstallPage);AnySign.mExtensionSetting.mImgIntervalError=true;}}}else if(ae.code==0){if(gS){gS=false;}lQ=true;xg=true;var iy=cW.split(",");var protocol=cK.substring(0,cK.length-5);if(protocol.indexOf("https:")==0){eD=iy[1];cK=protocol+iy[1];}else{eD=iy[0];cK=protocol+iy[0];}console.log("[AnySign for PC][AnySignAjax_onload_01002]["+eD+"]");gU();}else{AnySign.mExtensionSetting.mInstallCheck_State="ANYSIGN4PC_NEED_INSTALL";var fw=confirm("[AnySign for PC] 공인인증 보안 프로그램 설치가 필요합니다.\n[확인]을 선택하시면 설치페이지로 연결됩니다.");if(fw)eY(AnySign.mPlatform.aInstallPage);AnySign.mExtensionSetting.mImgIntervalError=true;}break;case "setAttributeInfo":if(ae.code==30006||ae.code==30001){console.log("[AnySign for PC][AnySignAjax_onload_01003]["+ae.code+"]");fh=false;port=Number(AnySign.mExtensionSetting.mPort);if(window.location.protocol.indexOf("https:")==0){bw=port+1;cK="https://127.0.0.1:"+bw;}else{if(ae.code==30001)eo=Hh;bw=port;cK="http://127.0.0.1:"+bw;}reRun();return;}AnySign.mAnySignLoad=true;console.log("[AnySign for PC][AnySignAjax_onload_01004]");if(ae.code==20015){AnySign.mAnySignLoad=false;alert("[AnySign for PC] AnySign4PC.exe 프로그램 초기화에 실패하였습니다.\n"+"[실패 명령어] : "+ae.bA);return;}if(cW.length==0)cW=null;if(onSendToServer(cW)!=0){AnySign.mAnySignLoad=false;lQ=false;pk="FAILED";console.log("[AnySign for PC][AnySignAjax_onload_01005]");return;}AnySign.mExtensionSetting.mInstallCheck_State="ANYSIGN4PC_NORMAL";if(document.getElementById("EncryptionAreaID_0")==null){AnySign.mPageBlockDecDone=true;ma();}if(AnySign.mExtensionSetting.mEncCallback){var rY=AnySign.mExtensionSetting.mEncCallback;AnySign.mExtensionSetting.mEncCallback="";rY();}if(AnySign.mExtensionSetting.mLoadCallback.func){var rX=AnySign.mExtensionSetting.mLoadCallback.func;var sT=AnySign.mExtensionSetting.mLoadCallback.param;AnySign.mExtensionSetting.mLoadCallback.func=null;AnySign.mExtensionSetting.mLoadCallback.param=null;rX(sT);}if(AnySign.mExtensionSetting.mInstallCheck_CB!=null){AnySign.mExtensionSetting.mInstallCheck_CB("ANYSIGN4PC_NORMAL");AnySign.mExtensionSetting.mInstallCheck_CB=null;}ps=setInterval(_checkPingPong,Vg);us=true;break;case "pong":zs=fJ;oR=cW;break;case "blockDecEx":aqR.push(fo);us=true;break;case "blockEnc":case "blockEnc2":case "blockEncConvert2":if(callback){var oD=callback;callback=null;oD(cW);}else{aqR.push(fo);us=true;}break;case "updateready":console.log("[AnySign4PC] receive message: updateready");if(ae.code==0){console.log("[AnySign4PC] send message: updatestart");_setUpdateState("updatestart");}else{alert("[AnySign for PC] 보안 프로그램의 업데이트 설치에 실패하였습니다. 설치페이지로 이동합니다.\n"+"[오류코드] : "+ae.code);eY(AnySign.mPlatform.aInstallPage);}break;case "updatestart":console.log("[AnySign4PC] receive message: updatestart");setTimeout(reRun,Kd);break;default:if(callback){var oD=callback;callback=null;oD(cW);}}};lT.onerror=function(){if(lQ){console.log("[AnySign for PC][AnySignAjax_error_10000]");if(ps)clearInterval(ps);if(vh>3){AnySign.mExtensionSetting.mInstallCheck_State="ANYSIGN4PC_NEED_INSTALL";var fw=confirm("안정적인 동작을 위해 AnySign for PC 공인인증 보안 프로그램의 재설치가 필요합니다.\n[확인]을 선택하시면 설치페이지로 연결됩니다.");if(fw)eY(AnySign.mPlatform.aInstallPage);AnySign.mExtensionSetting.mImgIntervalError=true;return;}try{var hY=document.getElementById("xwup_title_guidewindow");if(hY!=null){AnySign.mExtensionSetting.mDialog.oncancel();}}catch(e){console.log("[try catch] "+e.message);}vh++;reRun();}else if(gS==true){console.log("[AnySign for PC][AnySignAjax_error_10001]");var time=new Date().getTime();if((time-kw)>120000)eY(AnySign.mPlatform.aInstallPage);else reRun();}else if(pk=="FAILED"){console.log("[AnySign for PC][AnySignAjax_error_10002]");return;}else if(fh){if(AnySign.mExtensionSetting.EV==1){console.log("[AnySign for PC][AnySignAjax_error_10007]");AnySign.mExtensionSetting.mInstallCheck_State="ANYSIGN4PC_NEED_INSTALL";if(AnySign.mExtensionSetting.mInstallCheck_CB!=null){AnySign.mExtensionSetting.mInstallCheck_CB("ANYSIGN4PC_NEED_INSTALL");AnySign.mExtensionSetting.mInstallCheck_CB=null;}else if(AnySign.mExtensionSetting.mIgnoreInstallPage!=true){var fw=confirm("[AnySign for PC] 공인인증 보안 프로그램 설치가 필요합니다.\n[확인]을 선택하시면 설치페이지로 연결됩니다.");if(fw)eY(AnySign.mPlatform.aInstallPage);AnySign.mExtensionSetting.mImgIntervalError=true;}}else{fh=false;UW=0;port=Number(AnySign.mExtensionSetting.mPort);if(window.location.protocol.indexOf("https:")==0){bw=port+1;cK="https://127.0.0.1:"+bw;}else{bw=port;cK="http://127.0.0.1:"+bw;}console.log("[AnySign for PC][AnySignAjax_error_10004]");reRun();}}else{if(UW0&&AnySign.mPageBlockDecDone==true){ma();}dZ.Do(j);aqR.Do(i);break;}}}},10);dZ.push(nM);},setcallbackFunc:function(func){callback=func;},getLastErrCode:function(){return rC();},getLastErrMsg:function(){return pz();},resetErrAndMsg:function(){rQ();},resetcallbackFunc:function(){callback=null;}};}; \ No newline at end of file diff --git a/src/main/webapp/AnySign4PC/AnySign4PC/ext/AnySignJSONP.js b/src/main/webapp/AnySign4PC/AnySign4PC/ext/AnySignJSONP.js new file mode 100644 index 00000000..f0b57178 --- /dev/null +++ b/src/main/webapp/AnySign4PC/AnySign4PC/ext/AnySignJSONP.js @@ -0,0 +1,11 @@ +/*! +* AnySign, v1.0.1.21. +* +* For more information on this product, please see +* https://www.hsecure.co.kr/ +* +* Copyright (c) Hancom Secure Inc. All Rights Reserved. +* +* Date: 2019-08-21 +*/ +if(typeof AnySignForPCExtension=="undefined"){AnySignForPCExtension={};}AnySignForPCExtension.AnySignJSONP=function(){var eG=null,zJ,fT,yr=0,nz=[],nP=[],cK,eD,pk,UW,fh,aql=0,vh=0,oY=0,oA=new Date().getTime()+Math.floor(Math.random()*1000);tN=800,un=AnySign.mAnySignSID,pb="general",mE=null,gS=false,kw=0,Ad=20000,sf=null,ps=null,oR="",Kw=false,abk=false,adD=false,Es=5000,hb=null,iY=null,ae={code:0,bA:""};var lc=true;var lO=0,pr=0;eStrASP(GetSafeResponse(loadSecurePro("json2.js")));eStrASP(GetSafeResponse(loadSecurePro("anySignjQuery-1.11.1.js")));try{if(AnySign.mExtensionSetting.mIsIE7==false){tN=2048;}}catch(e){console.log("[try catch] "+e.message);}zJ=function(){this.map=new Object();};zJ.prototype={put:function(key,value){this.map[key]=value;},get:function(key){return this.map[key];},remove:function(key){delete this.map[key];},size:function(){var count=0;for(var BU in this.map){count++;}return count;},shift:function(key){this.map[key].shift();}};fT=new zJ();function vx(){this.isConnected=false;this.YH=false;abk=true;adD=true;this.send=function(Mc){SofoAnySignJQuery.ajax({url:cK,type:'GET',scriptCharset:"utf-8",data:{'senddata':Mc},dataType:'jsonp',jsonp:'callback',timeout:Es,success:function(vg){sf=new Date().getTime();if(typeof vg.message=="undefined"){nz.push(vg);}else if(vg.message.InterfaceName=="pong"){oR=vg.message.ReturnValue;eG.isConnected=true;}else{nz.push(vg.message);}abk=true;},error:function(){if(gS==true){console.log("[AnySign for PC][AnySignJSONP_error_10001]");var time=new Date().getTime();if((time-kw)>120000)eY(AnySign.mPlatform.aInstallPage);else setTimeout(reRun,2000);}else if(fh==true){if(AnySign.mExtensionSetting.EV==1){console.log("[AnySign for PC][AnySignJSONP_error_10007]");AnySign.mExtensionSetting.mInstallCheck_State="ANYSIGN4PC_NEED_INSTALL";if(AnySign.mExtensionSetting.mInstallCheck_CB!=null){if(hb){clearInterval(hb);hb=null;}if(iY){clearInterval(iY);iY=null;}AnySign.mExtensionSetting.mInstallCheck_CB("ANYSIGN4PC_NEED_INSTALL");AnySign.mExtensionSetting.mInstallCheck_CB=null;}else{var fw=confirm("AnySign for PC 공인인증 보안 프로그램 설치가 필요합니다.\n[확인]을 선택하시면 설치페이지로 연결됩니다.");if(fw)eY(AnySign.mPlatform.aInstallPage);AnySign.mExtensionSetting.mImgIntervalError=true;}}else{aql++;if(aql>=5){clearInterval(hb);hb=null;aql=0;fh=false;bw=Number(AnySign.mExtensionSetting.mPort)+1;UW=0;console.log("[AnySign for PC][AnySignJSONP_error_10004]");reRun();}else{console.log("[AnySign for PC][AnySignJSONP_error_10007]["+aql+"]");eG=null;setTimeout(gU,1000);}}}else if(eG.isConnected==true){console.log("[AnySign for PC][AnySignJSONP_error_10000]");if(vh>3){AnySign.mExtensionSetting.mInstallCheck_State="ANYSIGN4PC_NEED_INSTALL";var fw=confirm("안정적인 동작을 위해 AnySign for PC 공인인증 보안 프로그램의 재설치가 필요합니다.\n[확인]을 선택하시면 설치페이지로 연결됩니다.");if(fw)eY(AnySign.mPlatform.aInstallPage);AnySign.mExtensionSetting.mImgIntervalError=true;return;}try{var hY=document.getElementById("xwup_title_guidewindow");if(hY!=null){AnySign.mExtensionSetting.mDialog.oncancel();}}catch(e){console.log("[try catch] "+e.message);}vh++;reRun();}else if(pk=="FAILED"){console.log("[AnySign for PC][AnySignJSONP_error_10002]");return;}else{if(UW5){yr=0;AnySign.mExtensionSetting.mImgIntervalError=true;alert("[AnySign for PC] 공인인증 보안 프로그램 통신과정에서 오류가 발생하였습니다.\n[오류메세지] bad parameter");return;}var Lk=fT.get(fJ);if(typeof Lk=="undefined"){AnySign.mExtensionSetting.mImgIntervalError=true;console.log("[AnySign for PC][AnySignJSONP_onmessage_01011]["+fJ+"]");}else{yr++;_doSend("",fJ,0,Lk.length,gB,true,xS,DX);}return;}else{yr=0;fT.remove(fJ);}switch(Lq){case "launcher":if(ae.code=="30000"||ae.code=="30002"||ae.code=="30003"||ae.code=="30004"||ae.code=="30005"){console.log("[AnySign for PC][AnySignJSONP_onmessage_01000]["+ae.code+"]");oY++;if(oY>3){if(AnySign.mExtensionSetting.mInstallCheck_CB!=null){AnySign.mExtensionSetting.mInstallCheck_CB("ANYSIGN4PC_NEED_INSTALL");AnySign.mExtensionSetting.mInstallCheck_CB=null;return;}AnySign.mExtensionSetting.mInstallCheck_State="ANYSIGN4PC_NEED_INSTALL";var fw=confirm("AnySign for PC 공인인증 보안 프로그램 설치가 필요합니다.\n[확인]을 선택하시면 설치페이지로 연결됩니다.");if(fw)eY(AnySign.mPlatform.aInstallPage);AnySign.mExtensionSetting.mImgIntervalError=true;return;}if(ae.code=="30002"&&AnySign.mPlatform.aName.indexOf("windows")==0){lc=false;fh=true;bw=Number(AnySign.mExtensionSetting.mDirectPort)+1;eD=bw;cK="https://127.0.0.1:"+bw;if(eG==null){eG=new vx();}_setAttributeInfo();}else{AnySign.mExtensionSetting.mImgIntervalError=true;var awM;if(ae.code==30000)awM="AnySign4PC.exe 실행을 실패하였습니다.";else if(ae.code==30001)awM="버전 업그레이드가 필요합니다.";else if(ae.code==30002)awM="AnySign4PC.exe 실행에 필요한 정보를 획득하는데 실패하였습니다.";else if(ae.code==30003)awM="AnySign4PC.exe 에서 사용 가능한 통신 포트가 모두 사용중입니다.";else if(ae.code==30004)awM="AnySign4PC.exe 실행 후 소켓 연결 확인에 실패하였습니다.";else if(ae.code==30005)awM="AnySign4PC.exe 실행 후 소켓 연결 확인된 뒤 프로세스가 종료되었습니다.";var bA="[AnySign for PC] 서비스를 통한 AnySign4PC.exe 프로그램 실행에 실패하였습니다. 다시 실행하겠습니다.\n"+"["+ae.code+"] ["+awM+"]";reRun();alert(bA);}}else if(ae.code=="30001"){console.log("[AnySign for PC][AnySignJSONP_onmessage_01001]");if(AnySign.mExtensionSetting.mInstallCheck_CB!=null){AnySign.mExtensionSetting.mInstallCheck_CB("ANYSIGN4PC_NEED_UPDATE");AnySign.mExtensionSetting.mInstallCheck_CB=null;return;}if(AnySign.mAnySignLiveUpdate){if(gS){console.log("update continue");var time=new Date().getTime();if((time-kw)>120000)eY(AnySign.mPlatform.aInstallPage);else setTimeout(_setDemonInfo,2000);}else{kw=new Date().getTime();Es=120000;setTimeout(function(){var kg=document.getElementById("AnySign4PCLoadingImg");if(kg!=null){if(typeof AnySign.mLanguage==='string'&&AnySign.mLanguage.toLowerCase()=="ko-kr")kg.src=AnySign.mBasePath+"/img/loading_update.gif";else kg.src=AnySign.mBasePath+"/img/loading_update_en.gif";}else{try{if(AnySign.CU.Fj){AnySign.mExtensionSetting.EZ=setInterval(function(){showAnySignLoadingImg("update");},50);}}catch(aP){console.log("[try catch] "+aP.message);}}},2000);_setUpdateState("updateready");}}else{AnySign.mExtensionSetting.mInstallCheck_State="ANYSIGN4PC_NEED_INSTALL";var fw=confirm("[AnySign for PC] 공인인증 보안 프로그램 설치가 필요합니다.\n[확인]을 선택하시면 설치페이지로 연결됩니다.");if(fw){if(AnySign.mExtensionSetting.mIgnoreInstallPage!=true)eY(AnySign.mPlatform.aInstallPage);}AnySign.mExtensionSetting.mImgIntervalError=true;}}else if(ae.code==0){var iy=cW.split(",");var protocol=cK.substring(0,cK.length-5);cK=protocol+iy[1];eD=iy[1];console.log("[AnySign for PC][AnySignJSONP_onmessage_01002]["+eD+"]");if(gS){gS=false;setTimeout(function(){eG=new vx();_sendPingInfo();_setAttributeInfo();},2000);}else{_setAttributeInfo();}}else{eY(AnySign.mPlatform.aInstallPage);}break;case "setAttributeInfo":if(ae.code==30006||ae.code==30001){console.log("[AnySign for PC][AnySignJSONP_onmessage_01003]["+ae.code+"]");bw=Number(AnySign.mExtensionSetting.mPort)+1;fh=false;reRun();return;}AnySign.mAnySignLoad=true;console.log("[AnySign for PC][AnySignJSONP_onmessage_01004]");Es=120000;if(ae.code==20015){AnySign.mAnySignLoad=false;alert("[AnySign for PC] AnySign4PC.exe 프로그램 초기화에 실패하였습니다.\n"+"[실패 명령어] : "+ae.bA);return;}if(cW.length==0)cW=null;if(onSendToServer(cW)!=0){AnySign.mAnySignLoad=false;pk="FAILED";eG.isConnected=false;console.log("[AnySign for PC][AnySignJSONP_onmessage_01005]");return;}AnySign.mExtensionSetting.mInstallCheck_State="ANYSIGN4PC_NORMAL";if(document.getElementById("EncryptionAreaID_0")==null){AnySign.mPageBlockDecDone=true;ma();}{var i=0;function send(){if(i0&&AnySign.mPageBlockDecDone==true){ma();}break;case "blockEnc":case "blockEnc2":case "blockEncConvert2":if(mE){var oD=mE;mE=null;oD(cW);}else{xS(cW,DX);}break;case "updateready":if(ae.code==0){gS=true;_setUpdateState("updatestart");}else{alert("[AnySign for PC] 보안 프로그램의 업데이트 설치에 실패하였습니다. 설치페이지로 이동합니다.\n"+"[오류코드] : "+ae.code);eY(AnySign.mPlatform.aInstallPage);}break;case "updatestart":setTimeout(reRun,0);break;default:if(mE){var oD=mE;mE=null;oD(cW);}}};function reRun(){cK="https://127.0.0.1:"+bw;eG=null;eG=new vx();_sendPingInfo();_setDemonInfo();};_doSend=function(fC,fJ,xY,BX,gB,Tq,pW,qT){if(eG.isConnected==false)return;sf=new Date().getTime();if(Tq==false){NU(fC,fJ,gB,pW,qT);return;}adD=false;var iE=new Oi(fJ,xY,BX,gB,pW,qT);var Hk=setInterval(function(){if(iE==null||typeof iE=="undefined"){clearInterval(Hk);return;}if(iE.sendOK==true&&eG.isConnected==true&&abk==true){var data;abk=false;data=fT.get(iE.fK);data=data[xY];if(typeof data=="undefined"){data="";}data=fi(data,iE,true);eG.send(data);data=null;iE.sendOK=false;}for(var i=0;i0)Ew++;for(var i=0;iAd){if(abk==true){abk=false;if(oR!="heartbeat"&&Kw==true){clearInterval(ps);reRun();}else{_sendPingInfo();}}}};eo=function(hW){var sb={protocolType:pb,message:hW,hash:""};if(typeof JSON!=='object'||typeof JSON.stringify=="undefined"){console.log("[AnySign for PC][json2.js reload]");eStrASP(GetSafeResponse(loadSecurePro("json2.js")));}return JSON.stringify(sb);};function Oi(fJ,xY,BX,gB,pW,qT){this.fK=fJ;this.hx=pW;this.ju=qT;this.tp=xY;this.sj=BX;this.Eh=gB;this.sendOK=true;};function fi(cL,AW,apQ){var interfaceName,oP,fK,data=[];if(apQ)interfaceName="JSONP";else interfaceName=cL[0];if(apQ){data[0]=AW.tp.toString();data[1]=AW.sj.toString();data[2]=cL;fK=AW.fK.toString();oP="3";}else{fK=cL[cL.length-1];fK=fK.toString();for(i=0;i= 0 && j < len ? [ this[j] ] : [] ); + }, + + end: function() { + return this.prevObject || this.constructor(null); + }, + + // For internal use only. + // Behaves like an Array's method, not like a SofoAnySignJQuery method. + push: push, + sort: deletedIds.sort, + splice: deletedIds.splice +}; + +SofoAnySignJQuery.extend = SofoAnySignJQuery.fn.extend = function() { + var src, copyIsArray, copy, name, options, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + + // skip the boolean and the target + target = arguments[ i ] || {}; + i++; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !SofoAnySignJQuery.isFunction(target) ) { + target = {}; + } + + // extend SofoAnySignJQuery itself if only one argument is passed + if ( i === length ) { + target = this; + i--; + } + + for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) { + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( SofoAnySignJQuery.isPlainObject(copy) || (copyIsArray = SofoAnySignJQuery.isArray(copy)) ) ) { + if ( copyIsArray ) { + copyIsArray = false; + clone = src && SofoAnySignJQuery.isArray(src) ? src : []; + + } else { + clone = src && SofoAnySignJQuery.isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = SofoAnySignJQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + // Return the modified object + return target; +}; + +SofoAnySignJQuery.extend({ + // Unique for each copy of SofoAnySignJQuery on the page + expando: "SofoAnySignJQuery" + ( version + Math.random() ).replace( /\D/g, "" ), + + // Assume SofoAnySignJQuery is ready without the ready module + isReady: true, + + error: function( msg ) { + throw new Error( msg ); + }, + + noop: function() {}, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return SofoAnySignJQuery.type(obj) === "function"; + }, + + isArray: Array.isArray || function( obj ) { + return SofoAnySignJQuery.type(obj) === "array"; + }, + + isWindow: function( obj ) { + /* jshint eqeqeq: false */ + return obj != null && obj == obj.window; + }, + + isNumeric: function( obj ) { + // parseFloat NaNs numeric-cast false positives (null|true|false|"") + // ...but misinterprets leading-number strings, particularly hex literals ("0x...") + // subtraction forces infinities to NaN + return !SofoAnySignJQuery.isArray( obj ) && obj - parseFloat( obj ) >= 0; + }, + + isEmptyObject: function( obj ) { + var name; + for ( name in obj ) { + return false; + } + return true; + }, + + isPlainObject: function( obj ) { + var key; + + // Must be an Object. + // Because of IE, we also have to check the presence of the constructor property. + // Make sure that DOM nodes and window objects don't pass through, as well + if ( !obj || SofoAnySignJQuery.type(obj) !== "object" || obj.nodeType || SofoAnySignJQuery.isWindow( obj ) ) { + return false; + } + + try { + // Not own constructor property must be Object + if ( obj.constructor && + !hasOwn.call(obj, "constructor") && + !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { + return false; + } + } catch ( e ) { + // IE8,9 Will throw exceptions on certain host objects #9897 + return false; + } + + // Support: IE<9 + // Handle iteration over inherited properties before own properties. + if ( support.ownLast ) { + for ( key in obj ) { + return hasOwn.call( obj, key ); + } + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + for ( key in obj ) {} + + return key === undefined || hasOwn.call( obj, key ); + }, + + type: function( obj ) { + if ( obj == null ) { + return obj + ""; + } + return typeof obj === "object" || typeof obj === "function" ? + class2type[ toString.call(obj) ] || "object" : + typeof obj; + }, + + // Evaluates a script in a global context + // Workarounds based on findings by Jim Driscoll + // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context + globalEval: function( data ) { + if ( data && SofoAnySignJQuery.trim( data ) ) { + // We use execScript on Internet Explorer + // We use an anonymous function so that context is window + // rather than SofoAnySignJQuery in Firefox + //data = data.replace (//gi, ""); + ( window.execScript || function( data ) { + window[ "eval" ].call( window, data ); + } )( data ); + } + }, + + // Convert dashed to camelCase; used by the css and data modules + // Microsoft forgot to hump their vendor prefix (#9572) + camelCase: function( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + }, + + // args is for internal usage only + each: function( obj, callback, args ) { + var value, + i = 0, + length = obj.length, + isArray = isArraylike( obj ); + + if ( args ) { + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback.apply( obj[ i ], args ); + + if ( value === false ) { + break; + } + } + } else { + for ( i in obj ) { + value = callback.apply( obj[ i ], args ); + + if ( value === false ) { + break; + } + } + } + + // A special, fast, case for the most common use of each + } else { + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback.call( obj[ i ], i, obj[ i ] ); + + if ( value === false ) { + break; + } + } + } else { + for ( i in obj ) { + value = callback.call( obj[ i ], i, obj[ i ] ); + + if ( value === false ) { + break; + } + } + } + } + + return obj; + }, + + // Support: Android<4.1, IE<9 + trim: function( text ) { + return text == null ? + "" : + ( text + "" ).replace( rtrim, "" ); + }, + + // results is for internal usage only + makeArray: function( arr, results ) { + var ret = results || []; + + if ( arr != null ) { + if ( isArraylike( Object(arr) ) ) { + SofoAnySignJQuery.merge( ret, + typeof arr === "string" ? + [ arr ] : arr + ); + } else { + push.call( ret, arr ); + } + } + + return ret; + }, + + inArray: function( elem, arr, i ) { + var len; + + if ( arr ) { + if ( indexOf ) { + return indexOf.call( arr, elem, i ); + } + + len = arr.length; + i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; + + for ( ; i < len; i++ ) { + // Skip accessing in sparse arrays + if ( i in arr && arr[ i ] === elem ) { + return i; + } + } + } + + return -1; + }, + + merge: function( first, second ) { + var len = +second.length, + j = 0, + i = first.length; + + while ( j < len ) { + first[ i++ ] = second[ j++ ]; + } + + // Support: IE<9 + // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists) + if ( len !== len ) { + while ( second[j] !== undefined ) { + first[ i++ ] = second[ j++ ]; + } + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, invert ) { + var callbackInverse, + matches = [], + i = 0, + length = elems.length, + callbackExpect = !invert; + + // Go through the array, only saving the items + // that pass the validator function + for ( ; i < length; i++ ) { + callbackInverse = !callback( elems[ i ], i ); + if ( callbackInverse !== callbackExpect ) { + matches.push( elems[ i ] ); + } + } + + return matches; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var value, + i = 0, + length = elems.length, + isArray = isArraylike( elems ), + ret = []; + + // Go through the array, translating each of the items to their new values + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + + // Go through every key on the object, + } else { + for ( i in elems ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + } + + // Flatten any nested arrays + return concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // Bind a function to a context, optionally partially applying any + // arguments. + proxy: function( fn, context ) { + var args, proxy, tmp; + + if ( typeof context === "string" ) { + tmp = fn[ context ]; + context = fn; + fn = tmp; + } + + // Quick check to determine if target is callable, in the spec + // this throws a TypeError, but we will just return undefined. + if ( !SofoAnySignJQuery.isFunction( fn ) ) { + return undefined; + } + + // Simulated bind + args = slice.call( arguments, 2 ); + proxy = function() { + return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); + }; + + // Set the guid of unique handler to the same of original handler, so it can be removed + proxy.guid = fn.guid = fn.guid || SofoAnySignJQuery.guid++; + + return proxy; + }, + + now: function() { + return +( new Date() ); + }, + + // SofoAnySignJQuery.support is not used in Core but other projects attach their + // properties to it so it needs to exist. + support: support +}); + +// Populate the class2type map +SofoAnySignJQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +}); + +function isArraylike( obj ) { + var length = obj.length, + type = SofoAnySignJQuery.type( obj ); + + if ( type === "function" || SofoAnySignJQuery.isWindow( obj ) ) { + return false; + } + + if ( obj.nodeType === 1 && length ) { + return true; + } + + return type === "array" || length === 0 || + typeof length === "number" && length > 0 && ( length - 1 ) in obj; +} +var Sizzle = +/*! + * Sizzle CSS Selector Engine v1.10.19 + * http://sizzlejs.com/ + * + * Copyright 2013 SofoAnySignJQuery Foundation, Inc. and other contributors + * Released under the MIT license + * http://SofoAnySignJQuery.org/license + * + * Date: 2014-04-18 + */ +(function( window ) { + +var i, + support, + Expr, + getText, + isXML, + tokenize, + compile, + select, + outermostContext, + sortInput, + hasDuplicate, + + // Local document vars + setDocument, + document, + docElem, + documentIsHTML, + rbuggyQSA, + rbuggyMatches, + matches, + contains, + + // Instance-specific data + expando = "sizzle" + -(new Date()), + preferredDoc = window.document, + dirruns = 0, + done = 0, + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + } + return 0; + }, + + // General-purpose constants + strundefined = typeof undefined, + MAX_NEGATIVE = 1 << 31, + + // Instance methods + hasOwn = ({}).hasOwnProperty, + arr = [], + pop = arr.pop, + push_native = arr.push, + push = arr.push, + slice = arr.slice, + // Use a stripped-down indexOf if we can't use a native one + indexOf = arr.indexOf || function( elem ) { + var i = 0, + len = this.length; + for ( ; i < len; i++ ) { + if ( this[i] === elem ) { + return i; + } + } + return -1; + }, + + booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", + + // Regular expressions + + // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + // http://www.w3.org/TR/css3-syntax/#characters + characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", + + // Loosely modeled on CSS identifier characters + // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors + // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier + identifier = characterEncoding.replace( "w", "w#" ), + + // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors + attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace + + // Operator (capture 2) + "*([*^$|!~]?=)" + whitespace + + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + + "*\\]", + + pseudos = ":(" + characterEncoding + ")(?:\\((" + + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: + // 1. quoted (capture 3; capture 4 or capture 5) + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + + // 2. simple (capture 6) + "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + + // 3. anything else (capture 2) + ".*" + + ")\\)|)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), + + rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), + + rpseudo = new RegExp( pseudos ), + ridentifier = new RegExp( "^" + identifier + "$" ), + + matchExpr = { + "ID": new RegExp( "^#(" + characterEncoding + ")" ), + "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), + "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), + // For use in libraries implementing .is() + // We use this for POS matching in `select` + "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) + }, + + rinputs = /^(?:input|select|textarea|button)$/i, + rheader = /^h\d$/i, + + rnative = /^[^{]+\{\s*\[native \w/, + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + + rsibling = /[+~]/, + rescape = /'|\\/g, + + // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), + funescape = function( _, escaped, escapedWhitespace ) { + var high = "0x" + escaped - 0x10000; + // NaN means non-codepoint + // Support: Firefox<24 + // Workaround erroneous numeric interpretation of +"0x" + return high !== high || escapedWhitespace ? + escaped : + high < 0 ? + // BMP codepoint + String.fromCharCode( high + 0x10000 ) : + // Supplemental Plane codepoint (surrogate pair) + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + }; + +// Optimize for push.apply( _, NodeList ) +try { + push.apply( + (arr = slice.call( preferredDoc.childNodes )), + preferredDoc.childNodes + ); + // Support: Android<4.0 + // Detect silently failing push.apply + arr[ preferredDoc.childNodes.length ].nodeType; +} catch ( e ) { + push = { apply: arr.length ? + + // Leverage slice if possible + function( target, els ) { + push_native.apply( target, slice.call(els) ); + } : + + // Support: IE<9 + // Otherwise append directly + function( target, els ) { + var j = target.length, + i = 0; + // Can't trust NodeList.length + while ( (target[j++] = els[i++]) ) {} + target.length = j - 1; + } + }; +} + +function Sizzle( selector, context, results, seed ) { + var match, elem, m, nodeType, + // QSA vars + i, groups, old, nid, newContext, newSelector; + + if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { + setDocument( context ); + } + + context = context || document; + results = results || []; + + if ( !selector || typeof selector !== "string" ) { + return results; + } + + if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { + return []; + } + + if ( documentIsHTML && !seed ) { + + // Shortcuts + if ( (match = rquickExpr.exec( selector )) ) { + // Speed-up: Sizzle("#ID") + if ( (m = match[1]) ) { + if ( nodeType === 9 ) { + elem = context.getElementById( m ); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document (SofoAnySignJQuery #6963) + if ( elem && elem.parentNode ) { + // Handle the case where IE, Opera, and Webkit return items + // by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + } else { + // Context is not a document + if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && + contains( context, elem ) && elem.id === m ) { + results.push( elem ); + return results; + } + } + + // Speed-up: Sizzle("TAG") + } else if ( match[2] ) { + push.apply( results, context.getElementsByTagName( selector ) ); + return results; + + // Speed-up: Sizzle(".CLASS") + } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { + push.apply( results, context.getElementsByClassName( m ) ); + return results; + } + } + + // QSA path + if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { + nid = old = expando; + newContext = context; + newSelector = nodeType === 9 && selector; + + // qSA works strangely on Element-rooted queries + // We can work around this by specifying an extra ID on the root + // and working up from there (Thanks to Andrew Dupont for the technique) + // IE 8 doesn't work on object elements + if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { + groups = tokenize( selector ); + + if ( (old = context.getAttribute("id")) ) { + nid = old.replace( rescape, "\\$&" ); + } else { + context.setAttribute( "id", nid ); + } + nid = "[id='" + nid + "'] "; + + i = groups.length; + while ( i-- ) { + groups[i] = nid + toSelector( groups[i] ); + } + newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; + newSelector = groups.join(","); + } + + if ( newSelector ) { + try { + push.apply( results, + newContext.querySelectorAll( newSelector ) + ); + return results; + } catch(qsaError) { + } finally { + if ( !old ) { + context.removeAttribute("id"); + } + } + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed ); +} + +/** + * Create key-value caches of limited size + * @returns {Function(string, Object)} Returns the Object data after storing it on itself with + * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) + * deleting the oldest entry + */ +function createCache() { + var keys = []; + + function cache( key, value ) { + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) + if ( keys.push( key + " " ) > Expr.cacheLength ) { + // Only keep the most recent entries + delete cache[ keys.shift() ]; + } + return (cache[ key + " " ] = value); + } + return cache; +} + +/** + * Mark a function for special use by Sizzle + * @param {Function} fn The function to mark + */ +function markFunction( fn ) { + fn[ expando ] = true; + return fn; +} + +/** + * Support testing using an element + * @param {Function} fn Passed the created div and expects a boolean result + */ +function assert( fn ) { + var div = document.createElement("div"); + + try { + return !!fn( div ); + } catch (e) { + return false; + } finally { + // Remove from its parent by default + if ( div.parentNode ) { + div.parentNode.removeChild( div ); + } + // release memory in IE + if ( div.parentNode ) { + div.parentNode.removeChild( div ); + } + // release memory in IE + div = null; + } +} + +/** + * Adds the same handler for all of the specified attrs + * @param {String} attrs Pipe-separated list of attributes + * @param {Function} handler The method that will be applied + */ +function addHandle( attrs, handler ) { + var arr = attrs.split("|"), + i = attrs.length; + + while ( i-- ) { + Expr.attrHandle[ arr[i] ] = handler; + } +} + +/** + * Checks document order of two siblings + * @param {Element} a + * @param {Element} b + * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b + */ +function siblingCheck( a, b ) { + var cur = b && a, + diff = cur && a.nodeType === 1 && b.nodeType === 1 && + ( ~b.sourceIndex || MAX_NEGATIVE ) - + ( ~a.sourceIndex || MAX_NEGATIVE ); + + // Use IE sourceIndex if available on both nodes + if ( diff ) { + return diff; + } + + // Check if b follows a + if ( cur ) { + while ( (cur = cur.nextSibling) ) { + if ( cur === b ) { + return -1; + } + } + } + + return a ? 1 : -1; +} + +/** + * Returns a function to use in pseudos for input types + * @param {String} type + */ +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for buttons + * @param {String} type + */ +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for positionals + * @param {Function} fn + */ +function createPositionalPseudo( fn ) { + return markFunction(function( argument ) { + argument = +argument; + return markFunction(function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ (j = matchIndexes[i]) ] ) { + seed[j] = !(matches[j] = seed[j]); + } + } + }); + }); +} + +/** + * Checks a node for validity as a Sizzle context + * @param {Element|Object=} context + * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value + */ +function testContext( context ) { + return context && typeof context.getElementsByTagName !== strundefined && context; +} + +// Expose support vars for convenience +support = Sizzle.support = {}; + +/** + * Detects XML nodes + * @param {Element|Object} elem An element or a document + * @returns {Boolean} True iff elem is a non-HTML XML node + */ +isXML = Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = elem && (elem.ownerDocument || elem).documentElement; + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +/** + * Sets document-related variables once based on the current document + * @param {Element|Object} [doc] An element or document object to use to set the document + * @returns {Object} Returns the current document + */ +setDocument = Sizzle.setDocument = function( node ) { + var hasCompare, + doc = node ? node.ownerDocument || node : preferredDoc, + parent = doc.defaultView; + + // If no document and documentElement is available, return + if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { + return document; + } + + // Set our document + document = doc; + docElem = doc.documentElement; + + // Support tests + documentIsHTML = !isXML( doc ); + + // Support: IE>8 + // If iframe document is assigned to "document" variable and if iframe has been reloaded, + // IE will throw "permission denied" error when accessing "document" variable, see SofoAnySignJQuery #13936 + // IE6-8 do not support the defaultView property so parent will be undefined + if ( parent && parent !== parent.top ) { + // IE11 does not have attachEvent, so all must suffer + if ( parent.addEventListener ) { + parent.addEventListener( "unload", function() { + setDocument(); + }, false ); + } else if ( parent.attachEvent ) { + parent.attachEvent( "onunload", function() { + setDocument(); + }); + } + } + + /* Attributes + ---------------------------------------------------------------------- */ + + // Support: IE<8 + // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans) + support.attributes = assert(function( div ) { + div.className = "i"; + return !div.getAttribute("className"); + }); + + /* getElement(s)By* + ---------------------------------------------------------------------- */ + + // Check if getElementsByTagName("*") returns only elements + support.getElementsByTagName = assert(function( div ) { + div.appendChild( doc.createComment("") ); + return !div.getElementsByTagName("*").length; + }); + + // Check if getElementsByClassName can be trusted + support.getElementsByClassName = rnative.test( doc.getElementsByClassName ) && assert(function( div ) { + div.innerHTML = "
"; + + // Support: Safari<4 + // Catch class over-caching + div.firstChild.className = "i"; + // Support: Opera<10 + // Catch gEBCN failure to find non-leading classes + return div.getElementsByClassName("i").length === 2; + }); + + // Support: IE<10 + // Check if getElementById returns elements by name + // The broken getElementById methods don't pick up programatically-set names, + // so use a roundabout getElementsByName test + support.getById = assert(function( div ) { + docElem.appendChild( div ).id = expando; + return !doc.getElementsByName || !doc.getElementsByName( expando ).length; + }); + + // ID find and filter + if ( support.getById ) { + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== strundefined && documentIsHTML ) { + var m = context.getElementById( id ); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + return m && m.parentNode ? [ m ] : []; + } + }; + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + return elem.getAttribute("id") === attrId; + }; + }; + } else { + // Support: IE6/7 + // getElementById is not reliable as a find shortcut + delete Expr.find["ID"]; + + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); + return node && node.value === attrId; + }; + }; + } + + // Tag + Expr.find["TAG"] = support.getElementsByTagName ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== strundefined ) { + return context.getElementsByTagName( tag ); + } + } : + function( tag, context ) { + var elem, + tmp = [], + i = 0, + results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + while ( (elem = results[i++]) ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }; + + // Class + Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { + if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { + return context.getElementsByClassName( className ); + } + }; + + /* QSA/matchesSelector + ---------------------------------------------------------------------- */ + + // QSA and matchesSelector support + + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + rbuggyMatches = []; + + // qSa(:focus) reports false when true (Chrome 21) + // We allow this because of a bug in IE8/9 that throws an error + // whenever `document.activeElement` is accessed on an iframe + // So, we allow :focus to pass through QSA all the time to avoid the IE error + // See http://bugs.SofoAnySignJQuery.com/ticket/13378 + rbuggyQSA = []; + + if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert(function( div ) { + // Select is set to empty string on purpose + // This is to test IE's treatment of not explicitly + // setting a boolean content attribute, + // since its presence should be enough + // http://bugs.SofoAnySignJQuery.com/ticket/12359 + div.innerHTML = ""; + + // Support: IE8, Opera 11-12.16 + // Nothing should be selected when empty strings follow ^= or $= or *= + // The test attribute must be unknown in Opera but "safe" for WinRT + // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section + if ( div.querySelectorAll("[msallowclip^='']").length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); + } + + // Support: IE8 + // Boolean attributes and "value" are not treated correctly + if ( !div.querySelectorAll("[selected]").length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here and will not see later tests + if ( !div.querySelectorAll(":checked").length ) { + rbuggyQSA.push(":checked"); + } + }); + + assert(function( div ) { + // Support: Windows 8 Native Apps + // The type and name attributes are restricted during .innerHTML assignment + var input = doc.createElement("input"); + input.setAttribute( "type", "hidden" ); + div.appendChild( input ).setAttribute( "name", "D" ); + + // Support: IE8 + // Enforce case-sensitivity of name attribute + if ( div.querySelectorAll("[name=d]").length ) { + rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here and will not see later tests + if ( !div.querySelectorAll(":enabled").length ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Opera 10-11 does not throw on post-comma invalid pseudos + div.querySelectorAll("*,:x"); + rbuggyQSA.push(",.*:"); + }); + } + + if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || + docElem.webkitMatchesSelector || + docElem.mozMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector) )) ) { + + assert(function( div ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + support.disconnectedMatch = matches.call( div, "div" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( div, "[s!='']:x" ); + rbuggyMatches.push( "!=", pseudos ); + }); + } + + rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); + rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); + + /* Contains + ---------------------------------------------------------------------- */ + hasCompare = rnative.test( docElem.compareDocumentPosition ); + + // Element contains another + // Purposefully does not implement inclusive descendent + // As in, an element does not contain itself + contains = hasCompare || rnative.test( docElem.contains ) ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && ( + adown.contains ? + adown.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + )); + } : + function( a, b ) { + if ( b ) { + while ( (b = b.parentNode) ) { + if ( b === a ) { + return true; + } + } + } + return false; + }; + + /* Sorting + ---------------------------------------------------------------------- */ + + // Document order sorting + sortOrder = hasCompare ? + function( a, b ) { + + // Flag for duplicate removal + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + // Sort on method existence if only one input has compareDocumentPosition + var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; + if ( compare ) { + return compare; + } + + // Calculate position if both inputs belong to the same document + compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? + a.compareDocumentPosition( b ) : + + // Otherwise we know they are disconnected + 1; + + // Disconnected nodes + if ( compare & 1 || + (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { + + // Choose the first element that is related to our preferred document + if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { + return -1; + } + if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { + return 1; + } + + // Maintain original order + return sortInput ? + ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : + 0; + } + + return compare & 4 ? -1 : 1; + } : + function( a, b ) { + // Exit early if the nodes are identical + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + var cur, + i = 0, + aup = a.parentNode, + bup = b.parentNode, + ap = [ a ], + bp = [ b ]; + + // Parentless nodes are either documents or disconnected + if ( !aup || !bup ) { + return a === doc ? -1 : + b === doc ? 1 : + aup ? -1 : + bup ? 1 : + sortInput ? + ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : + 0; + + // If the nodes are siblings, we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + } + + // Otherwise we need full lists of their ancestors for comparison + cur = a; + while ( (cur = cur.parentNode) ) { + ap.unshift( cur ); + } + cur = b; + while ( (cur = cur.parentNode) ) { + bp.unshift( cur ); + } + + // Walk down the tree looking for a discrepancy + while ( ap[i] === bp[i] ) { + i++; + } + + return i ? + // Do a sibling check if the nodes have a common ancestor + siblingCheck( ap[i], bp[i] ) : + + // Otherwise nodes in our document sort first + ap[i] === preferredDoc ? -1 : + bp[i] === preferredDoc ? 1 : + 0; + }; + + return doc; +}; + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + // Make sure that attribute selectors are quoted + expr = expr.replace( rattributeQuotes, "='$1']" ); + + if ( support.matchesSelector && documentIsHTML && + ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && + ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { + + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || support.disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch(e) {} + } + + return Sizzle( expr, document, null, [ elem ] ).length > 0; +}; + +Sizzle.contains = function( context, elem ) { + // Set document vars if needed + if ( ( context.ownerDocument || context ) !== document ) { + setDocument( context ); + } + return contains( context, elem ); +}; + +Sizzle.attr = function( elem, name ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + var fn = Expr.attrHandle[ name.toLowerCase() ], + // Don't get fooled by Object.prototype properties (SofoAnySignJQuery #13807) + val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? + fn( elem, name, !documentIsHTML ) : + undefined; + + return val !== undefined ? + val : + support.attributes || !documentIsHTML ? + elem.getAttribute( name ) : + (val = elem.getAttributeNode(name)) && val.specified ? + val.value : + null; +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +/** + * Document sorting and removing duplicates + * @param {ArrayLike} results + */ +Sizzle.uniqueSort = function( results ) { + var elem, + duplicates = [], + j = 0, + i = 0; + + // Unless we *know* we can detect duplicates, assume their presence + hasDuplicate = !support.detectDuplicates; + sortInput = !support.sortStable && results.slice( 0 ); + results.sort( sortOrder ); + + if ( hasDuplicate ) { + while ( (elem = results[i++]) ) { + if ( elem === results[ i ] ) { + j = duplicates.push( i ); + } + } + while ( j-- ) { + results.splice( duplicates[ j ], 1 ); + } + } + + // Clear input after sorting to release objects + // See https://github.com/SofoAnySignJQuery/sizzle/pull/225 + sortInput = null; + + return results; +}; + +/** + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( !nodeType ) { + // If no nodeType, this is expected to be an array + while ( (node = elem[i++]) ) { + // Do not traverse comment nodes + ret += getText( node ); + } + } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + // Use textContent for elements + // innerText usage removed for consistency of new lines (SofoAnySignJQuery #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + // Do not include comment or processing instruction nodes + + return ret; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + attrHandle: {}, + + find: {}, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[1] = match[1].replace( runescape, funescape ); + + // Move the given value to match[3] whether quoted or unquoted + match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); + + if ( match[2] === "~=" ) { + match[3] = " " + match[3] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 what (child|of-type) + 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 4 xn-component of xn+y argument ([+-]?\d*n|) + 5 sign of xn-component + 6 x of xn-component + 7 sign of y-component + 8 y of y-component + */ + match[1] = match[1].toLowerCase(); + + if ( match[1].slice( 0, 3 ) === "nth" ) { + // nth-* requires argument + if ( !match[3] ) { + Sizzle.error( match[0] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); + match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); + + // other types prohibit arguments + } else if ( match[3] ) { + Sizzle.error( match[0] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var excess, + unquoted = !match[6] && match[2]; + + if ( matchExpr["CHILD"].test( match[0] ) ) { + return null; + } + + // Accept quoted arguments as-is + if ( match[3] ) { + match[2] = match[4] || match[5] || ""; + + // Strip excess characters from unquoted arguments + } else if ( unquoted && rpseudo.test( unquoted ) && + // Get excess from tokenize (recursively) + (excess = tokenize( unquoted, true )) && + // advance to the next closing parenthesis + (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { + + // excess is a negative index + match[0] = match[0].slice( 0, excess ); + match[2] = unquoted.slice( 0, excess ); + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + + "TAG": function( nodeNameSelector ) { + var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); + return nodeNameSelector === "*" ? + function() { return true; } : + function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ className + " " ]; + + return pattern || + (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && + classCache( className, function( elem ) { + return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" ); + }); + }, + + "ATTR": function( name, operator, check ) { + return function( elem ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.slice( -check.length ) === check : + operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : + false; + }; + }, + + "CHILD": function( type, what, argument, first, last ) { + var simple = type.slice( 0, 3 ) !== "nth", + forward = type.slice( -4 ) !== "last", + ofType = what === "of-type"; + + return first === 1 && last === 0 ? + + // Shortcut for :nth-*(n) + function( elem ) { + return !!elem.parentNode; + } : + + function( elem, context, xml ) { + var cache, outerCache, node, diff, nodeIndex, start, + dir = simple !== forward ? "nextSibling" : "previousSibling", + parent = elem.parentNode, + name = ofType && elem.nodeName.toLowerCase(), + useCache = !xml && !ofType; + + if ( parent ) { + + // :(first|last|only)-(child|of-type) + if ( simple ) { + while ( dir ) { + node = elem; + while ( (node = node[ dir ]) ) { + if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { + return false; + } + } + // Reverse direction for :only-* (if we haven't yet done so) + start = dir = type === "only" && !start && "nextSibling"; + } + return true; + } + + start = [ forward ? parent.firstChild : parent.lastChild ]; + + // non-xml :nth-child(...) stores cache data on `parent` + if ( forward && useCache ) { + // Seek `elem` from a previously-cached index + outerCache = parent[ expando ] || (parent[ expando ] = {}); + cache = outerCache[ type ] || []; + nodeIndex = cache[0] === dirruns && cache[1]; + diff = cache[0] === dirruns && cache[2]; + node = nodeIndex && parent.childNodes[ nodeIndex ]; + + while ( (node = ++nodeIndex && node && node[ dir ] || + + // Fallback to seeking `elem` from the start + (diff = nodeIndex = 0) || start.pop()) ) { + + // When found, cache indexes on `parent` and break + if ( node.nodeType === 1 && ++diff && node === elem ) { + outerCache[ type ] = [ dirruns, nodeIndex, diff ]; + break; + } + } + + // Use previously-cached element index if available + } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { + diff = cache[1]; + + // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) + } else { + // Use the same loop as above to seek `elem` from the start + while ( (node = ++nodeIndex && node && node[ dir ] || + (diff = nodeIndex = 0) || start.pop()) ) { + + if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { + // Cache the index of each encountered element + if ( useCache ) { + (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } + } + } + } + + // Incorporate the offset, then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction(function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf.call( seed, matched[i] ); + seed[ idx ] = !( matches[ idx ] = matched[i] ); + } + }) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + // Potentially complex pseudos + "not": markFunction(function( selector ) { + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction(function( seed, matches, context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( (elem = unmatched[i]) ) { + seed[i] = !(matches[i] = elem); + } + } + }) : + function( elem, context, xml ) { + input[0] = elem; + matcher( input, null, xml, results ); + return !results.pop(); + }; + }), + + "has": markFunction(function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + }), + + "contains": markFunction(function( text ) { + return function( elem ) { + return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; + }; + }), + + // "Whether an element is represented by a :lang() selector + // is based solely on the element's language value + // being equal to the identifier C, + // or beginning with the identifier C immediately followed by "-". + // The matching of C against the element's language value is performed case-insensitively. + // The identifier C does not have to be a valid language name." + // http://www.w3.org/TR/selectors/#lang-pseudo + "lang": markFunction( function( lang ) { + // lang value must be a valid identifier + if ( !ridentifier.test(lang || "") ) { + Sizzle.error( "unsupported lang: " + lang ); + } + lang = lang.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + var elemLang; + do { + if ( (elemLang = documentIsHTML ? + elem.lang : + elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { + + elemLang = elemLang.toLowerCase(); + return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; + } + } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); + return false; + }; + }), + + // Miscellaneous + "target": function( elem ) { + var hash = window.location && window.location.hash; + return hash && hash.slice( 1 ) === elem.id; + }, + + "root": function( elem ) { + return elem === docElem; + }, + + "focus": function( elem ) { + return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); + }, + + // Boolean properties + "enabled": function( elem ) { + return elem.disabled === false; + }, + + "disabled": function( elem ) { + return elem.disabled === true; + }, + + "checked": function( elem ) { + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); + }, + + "selected": function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + // Contents + "empty": function( elem ) { + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), + // but not by others (comment: 8; processing instruction: 7; etc.) + // nodeType < 6 works because attributes (2) do not appear as children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + if ( elem.nodeType < 6 ) { + return false; + } + } + return true; + }, + + "parent": function( elem ) { + return !Expr.pseudos["empty"]( elem ); + }, + + // Element/input types + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "text": function( elem ) { + var attr; + return elem.nodeName.toLowerCase() === "input" && + elem.type === "text" && + + // Support: IE<8 + // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" + ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); + }, + + // Position-in-collection + "first": createPositionalPseudo(function() { + return [ 0 ]; + }), + + "last": createPositionalPseudo(function( matchIndexes, length ) { + return [ length - 1 ]; + }), + + "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + }), + + "even": createPositionalPseudo(function( matchIndexes, length ) { + var i = 0; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "odd": createPositionalPseudo(function( matchIndexes, length ) { + var i = 1; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }) + } +}; + +Expr.pseudos["nth"] = Expr.pseudos["eq"]; + +// Add button/input type pseudos +for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { + Expr.pseudos[ i ] = createInputPseudo( i ); +} +for ( i in { submit: true, reset: true } ) { + Expr.pseudos[ i ] = createButtonPseudo( i ); +} + +// Easy API for creating new setFilters +function setFilters() {} +setFilters.prototype = Expr.filters = Expr.pseudos; +Expr.setFilters = new setFilters(); + +tokenize = Sizzle.tokenize = function( selector, parseOnly ) { + var matched, match, tokens, type, + soFar, groups, preFilters, + cached = tokenCache[ selector + " " ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || (match = rcomma.exec( soFar )) ) { + if ( match ) { + // Don't consume trailing commas as valid + soFar = soFar.slice( match[0].length ) || soFar; + } + groups.push( (tokens = []) ); + } + + matched = false; + + // Combinators + if ( (match = rcombinators.exec( soFar )) ) { + matched = match.shift(); + tokens.push({ + value: matched, + // Cast descendant combinators to space + type: match[0].replace( rtrim, " " ) + }); + soFar = soFar.slice( matched.length ); + } + + // Filters + for ( type in Expr.filter ) { + if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || + (match = preFilters[ type ]( match ))) ) { + matched = match.shift(); + tokens.push({ + value: matched, + type: type, + matches: match + }); + soFar = soFar.slice( matched.length ); + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +}; + +function toSelector( tokens ) { + var i = 0, + len = tokens.length, + selector = ""; + for ( ; i < len; i++ ) { + selector += tokens[i].value; + } + return selector; +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + checkNonElements = base && dir === "parentNode", + doneName = done++; + + return combinator.first ? + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + return matcher( elem, context, xml ); + } + } + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + var oldCache, outerCache, + newCache = [ dirruns, doneName ]; + + // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching + if ( xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + if ( matcher( elem, context, xml ) ) { + return true; + } + } + } + } else { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + outerCache = elem[ expando ] || (elem[ expando ] = {}); + if ( (oldCache = outerCache[ dir ]) && + oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { + + // Assign to newCache so results back-propagate to previous elements + return (newCache[ 2 ] = oldCache[ 2 ]); + } else { + // Reuse newcache so results back-propagate to previous elements + outerCache[ dir ] = newCache; + + // A match means we're done; a fail means we have to keep checking + if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { + return true; + } + } + } + } + } + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[i]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[0]; +} + +function multipleContexts( selector, contexts, results ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[i], results ); + } + return results; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( (elem = unmatched[i]) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction(function( seed, results, context, xml ) { + var temp, i, elem, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + temp = condense( matcherOut, postMap ); + postFilter( temp, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = temp.length; + while ( i-- ) { + if ( (elem = temp[i]) ) { + matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); + } + } + } + + if ( seed ) { + if ( postFinder || preFilter ) { + if ( postFinder ) { + // Get the final matcherOut by condensing this intermediate into postFinder contexts + temp = []; + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) ) { + // Restore matcherIn since elem is not yet a final match + temp.push( (matcherIn[i] = elem) ); + } + } + postFinder( null, (matcherOut = []), temp, xml ); + } + + // Move matched elements from seed to results to keep them synchronized + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) && + (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { + + seed[temp] = !(results[temp] = elem); + } + } + } + + // Add elements to results, through postFinder if defined + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + }); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[0].type ], + implicitRelative = leadingRelative || Expr.relative[" "], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf.call( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + (checkContext = context).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + } ]; + + for ( ; i < len; i++ ) { + if ( (matcher = Expr.relative[ tokens[i].type ]) ) { + matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; + } else { + matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[j].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && toSelector( + // If the preceding token was a descendant combinator, insert an implicit any-element `*` + tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) + ).replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), + j < len && toSelector( tokens ) + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + var bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, outermost ) { + var elem, j, matcher, + matchedCount = 0, + i = "0", + unmatched = seed && [], + setMatched = [], + contextBackup = outermostContext, + // We must always have either seed elements or outermost context + elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), + // Use integer dirruns iff this is the outermost matcher + dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), + len = elems.length; + + if ( outermost ) { + outermostContext = context !== document && context; + } + + // Add elements passing elementMatchers directly to results + // Keep `i` a string if there are no elements so `matchedCount` will be "00" below + // Support: IE<9, Safari + // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id + for ( ; i !== len && (elem = elems[i]) != null; i++ ) { + if ( byElement && elem ) { + j = 0; + while ( (matcher = elementMatchers[j++]) ) { + if ( matcher( elem, context, xml ) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + // They will have gone through all possible matchers + if ( (elem = !matcher && elem) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // Apply set filters to unmatched elements + matchedCount += i; + if ( bySet && i !== matchedCount ) { + j = 0; + while ( (matcher = setMatchers[j++]) ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !(unmatched[i] || setMatched[i]) ) { + setMatched[i] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ selector + " " ]; + + if ( !cached ) { + // Generate a function of recursive functions that can be used to check each element + if ( !match ) { + match = tokenize( selector ); + } + i = match.length; + while ( i-- ) { + cached = matcherFromTokens( match[i] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); + + // Save selector and tokenization + cached.selector = selector; + } + return cached; +}; + +/** + * A low-level selection function that works with Sizzle's compiled + * selector functions + * @param {String|Function} selector A selector or a pre-compiled + * selector function built with Sizzle.compile + * @param {Element} context + * @param {Array} [results] + * @param {Array} [seed] A set of elements to match against + */ +select = Sizzle.select = function( selector, context, results, seed ) { + var i, tokens, token, type, find, + compiled = typeof selector === "function" && selector, + match = !seed && tokenize( (selector = compiled.selector || selector) ); + + results = results || []; + + // Try to minimize operations if there is no seed and only one group + if ( match.length === 1 ) { + + // Take a shortcut and set the context if the root selector is an ID + tokens = match[0] = match[0].slice( 0 ); + if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && + support.getById && context.nodeType === 9 && documentIsHTML && + Expr.relative[ tokens[1].type ] ) { + + context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; + if ( !context ) { + return results; + + // Precompiled matchers will still verify ancestry, so step up a level + } else if ( compiled ) { + context = context.parentNode; + } + + selector = selector.slice( tokens.shift().value.length ); + } + + // Fetch a seed set for right-to-left matching + i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; + while ( i-- ) { + token = tokens[i]; + + // Abort if we hit a combinator + if ( Expr.relative[ (type = token.type) ] ) { + break; + } + if ( (find = Expr.find[ type ]) ) { + // Search, expanding context for leading sibling combinators + if ( (seed = find( + token.matches[0].replace( runescape, funescape ), + rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context + )) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && toSelector( tokens ); + if ( !selector ) { + push.apply( results, seed ); + return results; + } + + break; + } + } + } + } + + // Compile and execute a filtering function if one is not provided + // Provide `match` to avoid retokenization if we modified the selector above + ( compiled || compile( selector, match ) )( + seed, + context, + !documentIsHTML, + results, + rsibling.test( selector ) && testContext( context.parentNode ) || context + ); + return results; +}; + +// One-time assignments + +// Sort stability +support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; + +// Support: Chrome<14 +// Always assume duplicates if they aren't passed to the comparison function +support.detectDuplicates = !!hasDuplicate; + +// Initialize against the default document +setDocument(); + +// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) +// Detached nodes confoundingly follow *each other* +support.sortDetached = assert(function( div1 ) { + // Should return 1, but returns 4 (following) + return div1.compareDocumentPosition( document.createElement("div") ) & 1; +}); + +// Support: IE<8 +// Prevent attribute/property "interpolation" +// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +if ( !assert(function( div ) { + div.innerHTML = ""; + return div.firstChild.getAttribute("href") === "#" ; +}) ) { + addHandle( "type|href|height|width", function( elem, name, isXML ) { + if ( !isXML ) { + return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); + } + }); +} + +// Support: IE<9 +// Use defaultValue in place of getAttribute("value") +if ( !support.attributes || !assert(function( div ) { + div.innerHTML = ""; + div.firstChild.setAttribute( "value", "" ); + return div.firstChild.getAttribute( "value" ) === ""; +}) ) { + addHandle( "value", function( elem, name, isXML ) { + if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { + return elem.defaultValue; + } + }); +} + +// Support: IE<9 +// Use getAttributeNode to fetch booleans when getAttribute lies +if ( !assert(function( div ) { + return div.getAttribute("disabled") == null; +}) ) { + addHandle( booleans, function( elem, name, isXML ) { + var val; + if ( !isXML ) { + return elem[ name ] === true ? name.toLowerCase() : + (val = elem.getAttributeNode( name )) && val.specified ? + val.value : + null; + } + }); +} + +return Sizzle; + +})( window ); + + + +SofoAnySignJQuery.find = Sizzle; +SofoAnySignJQuery.expr = Sizzle.selectors; +SofoAnySignJQuery.expr[":"] = SofoAnySignJQuery.expr.pseudos; +SofoAnySignJQuery.unique = Sizzle.uniqueSort; +SofoAnySignJQuery.text = Sizzle.getText; +SofoAnySignJQuery.isXMLDoc = Sizzle.isXML; +SofoAnySignJQuery.contains = Sizzle.contains; + + + +var rneedsContext = SofoAnySignJQuery.expr.match.needsContext; + +var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); + + + +var risSimple = /^.[^:#\[\.,]*$/; + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, not ) { + if ( SofoAnySignJQuery.isFunction( qualifier ) ) { + return SofoAnySignJQuery.grep( elements, function( elem, i ) { + /* jshint -W018 */ + return !!qualifier.call( elem, i, elem ) !== not; + }); + + } + + if ( qualifier.nodeType ) { + return SofoAnySignJQuery.grep( elements, function( elem ) { + return ( elem === qualifier ) !== not; + }); + + } + + if ( typeof qualifier === "string" ) { + if ( risSimple.test( qualifier ) ) { + return SofoAnySignJQuery.filter( qualifier, elements, not ); + } + + qualifier = SofoAnySignJQuery.filter( qualifier, elements ); + } + + return SofoAnySignJQuery.grep( elements, function( elem ) { + return ( SofoAnySignJQuery.inArray( elem, qualifier ) >= 0 ) !== not; + }); +} + +SofoAnySignJQuery.filter = function( expr, elems, not ) { + var elem = elems[ 0 ]; + + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return elems.length === 1 && elem.nodeType === 1 ? + SofoAnySignJQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : + SofoAnySignJQuery.find.matches( expr, SofoAnySignJQuery.grep( elems, function( elem ) { + return elem.nodeType === 1; + })); +}; + +SofoAnySignJQuery.fn.extend({ + find: function( selector ) { + var i, + ret = [], + self = this, + len = self.length; + + if ( typeof selector !== "string" ) { + return this.pushStack( SofoAnySignJQuery( selector ).filter(function() { + for ( i = 0; i < len; i++ ) { + if ( SofoAnySignJQuery.contains( self[ i ], this ) ) { + return true; + } + } + }) ); + } + + for ( i = 0; i < len; i++ ) { + SofoAnySignJQuery.find( selector, self[ i ], ret ); + } + + // Needed because $( selector, context ) becomes $( context ).find( selector ) + ret = this.pushStack( len > 1 ? SofoAnySignJQuery.unique( ret ) : ret ); + ret.selector = this.selector ? this.selector + " " + selector : selector; + return ret; + }, + filter: function( selector ) { + return this.pushStack( winnow(this, selector || [], false) ); + }, + not: function( selector ) { + return this.pushStack( winnow(this, selector || [], true) ); + }, + is: function( selector ) { + return !!winnow( + this, + + // If this is a positional/relative selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + typeof selector === "string" && rneedsContext.test( selector ) ? + SofoAnySignJQuery( selector ) : + selector || [], + false + ).length; + } +}); + + +// Initialize a SofoAnySignJQuery object + + +// A central reference to the root SofoAnySignJQuery(document) +var rootSofoAnySignJQuery, + + // Use the correct document accordingly with window argument (sandbox) + document = window.document, + + // A simple way to check for HTML strings + // Prioritize #id over to avoid XSS via location.hash (#9521) + // Strict HTML recognition (#11290: must start with <) + rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, + + init = SofoAnySignJQuery.fn.init = function( selector, context ) { + var match, elem; + + // HANDLE: $(""), $(null), $(undefined), $(false) + if ( !selector ) { + return this; + } + + // Handle HTML strings + if ( typeof selector === "string" ) { + if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = rquickExpr.exec( selector ); + } + + // Match html or make sure no context is specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) { + context = context instanceof SofoAnySignJQuery ? context[0] : context; + + // scripts is true for back-compat + // Intentionally let the error be thrown if parseHTML is not present + SofoAnySignJQuery.merge( this, SofoAnySignJQuery.parseHTML( + match[1], + context && context.nodeType ? context.ownerDocument || context : document, + true + ) ); + + // HANDLE: $(html, props) + if ( rsingleTag.test( match[1] ) && SofoAnySignJQuery.isPlainObject( context ) ) { + for ( match in context ) { + // Properties of context are called as methods if possible + if ( SofoAnySignJQuery.isFunction( this[ match ] ) ) { + this[ match ]( context[ match ] ); + + // ...and otherwise set as attributes + } else { + this.attr( match, context[ match ] ); + } + } + } + + return this; + + // HANDLE: $(#id) + } else { + elem = document.getElementById( match[2] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id !== match[2] ) { + return rootSofoAnySignJQuery.find( selector ); + } + + // Otherwise, we inject the element directly into the SofoAnySignJQuery object + this.length = 1; + this[0] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.sofoanysignjquery ) { + return ( context || rootSofoAnySignJQuery ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(DOMElement) + } else if ( selector.nodeType ) { + this.context = this[0] = selector; + this.length = 1; + return this; + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( SofoAnySignJQuery.isFunction( selector ) ) { + return typeof rootSofoAnySignJQuery.ready !== "undefined" ? + rootSofoAnySignJQuery.ready( selector ) : + // Execute immediately if ready is not present + selector( SofoAnySignJQuery ); + } + + if ( selector.selector !== undefined ) { + this.selector = selector.selector; + this.context = selector.context; + } + + return SofoAnySignJQuery.makeArray( selector, this ); + }; + +// Give the init function the SofoAnySignJQuery prototype for later instantiation +init.prototype = SofoAnySignJQuery.fn; + +// Initialize central reference +rootSofoAnySignJQuery = SofoAnySignJQuery( document ); + + +var rparentsprev = /^(?:parents|prev(?:Until|All))/, + // methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +SofoAnySignJQuery.extend({ + dir: function( elem, dir, until ) { + var matched = [], + cur = elem[ dir ]; + + while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !SofoAnySignJQuery( cur ).is( until )) ) { + if ( cur.nodeType === 1 ) { + matched.push( cur ); + } + cur = cur[dir]; + } + return matched; + }, + + sibling: function( n, elem ) { + var r = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + r.push( n ); + } + } + + return r; + } +}); + +SofoAnySignJQuery.fn.extend({ + has: function( target ) { + var i, + targets = SofoAnySignJQuery( target, this ), + len = targets.length; + + return this.filter(function() { + for ( i = 0; i < len; i++ ) { + if ( SofoAnySignJQuery.contains( this, targets[i] ) ) { + return true; + } + } + }); + }, + + closest: function( selectors, context ) { + var cur, + i = 0, + l = this.length, + matched = [], + pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? + SofoAnySignJQuery( selectors, context || this.context ) : + 0; + + for ( ; i < l; i++ ) { + for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { + // Always skip document fragments + if ( cur.nodeType < 11 && (pos ? + pos.index(cur) > -1 : + + // Don't pass non-elements to Sizzle + cur.nodeType === 1 && + SofoAnySignJQuery.find.matchesSelector(cur, selectors)) ) { + + matched.push( cur ); + break; + } + } + } + + return this.pushStack( matched.length > 1 ? SofoAnySignJQuery.unique( matched ) : matched ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; + } + + // index in selector + if ( typeof elem === "string" ) { + return SofoAnySignJQuery.inArray( this[0], SofoAnySignJQuery( elem ) ); + } + + // Locate the position of the desired element + return SofoAnySignJQuery.inArray( + // If it receives a SofoAnySignJQuery object, the first element is used + elem.sofoanysignjquery ? elem[0] : elem, this ); + }, + + add: function( selector, context ) { + return this.pushStack( + SofoAnySignJQuery.unique( + SofoAnySignJQuery.merge( this.get(), SofoAnySignJQuery( selector, context ) ) + ) + ); + }, + + addBack: function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter(selector) + ); + } +}); + +function sibling( cur, dir ) { + do { + cur = cur[ dir ]; + } while ( cur && cur.nodeType !== 1 ); + + return cur; +} + +SofoAnySignJQuery.each({ + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return SofoAnySignJQuery.dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return SofoAnySignJQuery.dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return sibling( elem, "nextSibling" ); + }, + prev: function( elem ) { + return sibling( elem, "previousSibling" ); + }, + nextAll: function( elem ) { + return SofoAnySignJQuery.dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return SofoAnySignJQuery.dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return SofoAnySignJQuery.dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return SofoAnySignJQuery.dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return SofoAnySignJQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); + }, + children: function( elem ) { + return SofoAnySignJQuery.sibling( elem.firstChild ); + }, + contents: function( elem ) { + return SofoAnySignJQuery.nodeName( elem, "iframe" ) ? + elem.contentDocument || elem.contentWindow.document : + SofoAnySignJQuery.merge( [], elem.childNodes ); + } +}, function( name, fn ) { + SofoAnySignJQuery.fn[ name ] = function( until, selector ) { + var ret = SofoAnySignJQuery.map( this, fn, until ); + + if ( name.slice( -5 ) !== "Until" ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + ret = SofoAnySignJQuery.filter( selector, ret ); + } + + if ( this.length > 1 ) { + // Remove duplicates + if ( !guaranteedUnique[ name ] ) { + ret = SofoAnySignJQuery.unique( ret ); + } + + // Reverse order for parents* and prev-derivatives + if ( rparentsprev.test( name ) ) { + ret = ret.reverse(); + } + } + + return this.pushStack( ret ); + }; +}); +var rnotwhite = (/\S+/g); + + + +// String to Object options format cache +var optionsCache = {}; + +// Convert String-formatted options into Object-formatted ones and store in cache +function createOptions( options ) { + var object = optionsCache[ options ] = {}; + SofoAnySignJQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { + object[ flag ] = true; + }); + return object; +} + +/* + * Create a callback list using the following parameters: + * + * options: an optional list of space-separated options that will change how + * the callback list behaves or a more traditional option object + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible options: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +SofoAnySignJQuery.Callbacks = function( options ) { + + // Convert options from String-formatted to Object-formatted if needed + // (we check in cache first) + options = typeof options === "string" ? + ( optionsCache[ options ] || createOptions( options ) ) : + SofoAnySignJQuery.extend( {}, options ); + + var // Flag to know if list is currently firing + firing, + // Last fire value (for non-forgettable lists) + memory, + // Flag to know if list was already fired + fired, + // End of the loop when firing + firingLength, + // Index of currently firing callback (modified by remove if needed) + firingIndex, + // First callback to fire (used internally by add and fireWith) + firingStart, + // Actual callback list + list = [], + // Stack of fire calls for repeatable lists + stack = !options.once && [], + // Fire callbacks + fire = function( data ) { + memory = options.memory && data; + fired = true; + firingIndex = firingStart || 0; + firingStart = 0; + firingLength = list.length; + firing = true; + for ( ; list && firingIndex < firingLength; firingIndex++ ) { + if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { + memory = false; // To prevent further calls using add + break; + } + } + firing = false; + if ( list ) { + if ( stack ) { + if ( stack.length ) { + fire( stack.shift() ); + } + } else if ( memory ) { + list = []; + } else { + self.disable(); + } + } + }, + // Actual Callbacks object + self = { + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + // First, we save the current length + var start = list.length; + (function add( args ) { + SofoAnySignJQuery.each( args, function( _, arg ) { + var type = SofoAnySignJQuery.type( arg ); + if ( type === "function" ) { + if ( !options.unique || !self.has( arg ) ) { + list.push( arg ); + } + } else if ( arg && arg.length && type !== "string" ) { + // Inspect recursively + add( arg ); + } + }); + })( arguments ); + // Do we need to add the callbacks to the + // current firing batch? + if ( firing ) { + firingLength = list.length; + // With memory, if we're not firing then + // we should call right away + } else if ( memory ) { + firingStart = start; + fire( memory ); + } + } + return this; + }, + // Remove a callback from the list + remove: function() { + if ( list ) { + SofoAnySignJQuery.each( arguments, function( _, arg ) { + var index; + while ( ( index = SofoAnySignJQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + // Handle firing indexes + if ( firing ) { + if ( index <= firingLength ) { + firingLength--; + } + if ( index <= firingIndex ) { + firingIndex--; + } + } + } + }); + } + return this; + }, + // Check if a given callback is in the list. + // If no argument is given, return whether or not list has callbacks attached. + has: function( fn ) { + return fn ? SofoAnySignJQuery.inArray( fn, list ) > -1 : !!( list && list.length ); + }, + // Remove all callbacks from the list + empty: function() { + list = []; + firingLength = 0; + return this; + }, + // Have the list do nothing anymore + disable: function() { + list = stack = memory = undefined; + return this; + }, + // Is it disabled? + disabled: function() { + return !list; + }, + // Lock the list in its current state + lock: function() { + stack = undefined; + if ( !memory ) { + self.disable(); + } + return this; + }, + // Is it locked? + locked: function() { + return !stack; + }, + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + if ( list && ( !fired || stack ) ) { + args = args || []; + args = [ context, args.slice ? args.slice() : args ]; + if ( firing ) { + stack.push( args ); + } else { + fire( args ); + } + } + return this; + }, + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + // To know if the callbacks have already been called at least once + fired: function() { + return !!fired; + } + }; + + return self; +}; + + +SofoAnySignJQuery.extend({ + + Deferred: function( func ) { + var tuples = [ + // action, add listener, listener list, final state + [ "resolve", "done", SofoAnySignJQuery.Callbacks("once memory"), "resolved" ], + [ "reject", "fail", SofoAnySignJQuery.Callbacks("once memory"), "rejected" ], + [ "notify", "progress", SofoAnySignJQuery.Callbacks("memory") ] + ], + state = "pending", + promise = { + state: function() { + return state; + }, + always: function() { + deferred.done( arguments ).fail( arguments ); + return this; + }, + then: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + return SofoAnySignJQuery.Deferred(function( newDefer ) { + SofoAnySignJQuery.each( tuples, function( i, tuple ) { + var fn = SofoAnySignJQuery.isFunction( fns[ i ] ) && fns[ i ]; + // deferred[ done | fail | progress ] for forwarding actions to newDefer + deferred[ tuple[1] ](function() { + var returned = fn && fn.apply( this, arguments ); + if ( returned && SofoAnySignJQuery.isFunction( returned.promise ) ) { + returned.promise() + .done( newDefer.resolve ) + .fail( newDefer.reject ) + .progress( newDefer.notify ); + } else { + newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); + } + }); + }); + fns = null; + }).promise(); + }, + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + return obj != null ? SofoAnySignJQuery.extend( obj, promise ) : promise; + } + }, + deferred = {}; + + // Keep pipe for back-compat + promise.pipe = promise.then; + + // Add list-specific methods + SofoAnySignJQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 3 ]; + + // promise[ done | fail | progress ] = list.add + promise[ tuple[1] ] = list.add; + + // Handle state + if ( stateString ) { + list.add(function() { + // state = [ resolved | rejected ] + state = stateString; + + // [ reject_list | resolve_list ].disable; progress_list.lock + }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); + } + + // deferred[ resolve | reject | notify ] + deferred[ tuple[0] ] = function() { + deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); + return this; + }; + deferred[ tuple[0] + "With" ] = list.fireWith; + }); + + // Make the deferred a promise + promise.promise( deferred ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( subordinate /* , ..., subordinateN */ ) { + var i = 0, + resolveValues = slice.call( arguments ), + length = resolveValues.length, + + // the count of uncompleted subordinates + remaining = length !== 1 || ( subordinate && SofoAnySignJQuery.isFunction( subordinate.promise ) ) ? length : 0, + + // the master Deferred. If resolveValues consist of only a single Deferred, just use that. + deferred = remaining === 1 ? subordinate : SofoAnySignJQuery.Deferred(), + + // Update function for both resolve and progress values + updateFunc = function( i, contexts, values ) { + return function( value ) { + contexts[ i ] = this; + values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; + if ( values === progressValues ) { + deferred.notifyWith( contexts, values ); + + } else if ( !(--remaining) ) { + deferred.resolveWith( contexts, values ); + } + }; + }, + + progressValues, progressContexts, resolveContexts; + + // add listeners to Deferred subordinates; treat others as resolved + if ( length > 1 ) { + progressValues = new Array( length ); + progressContexts = new Array( length ); + resolveContexts = new Array( length ); + for ( ; i < length; i++ ) { + if ( resolveValues[ i ] && SofoAnySignJQuery.isFunction( resolveValues[ i ].promise ) ) { + resolveValues[ i ].promise() + .done( updateFunc( i, resolveContexts, resolveValues ) ) + .fail( deferred.reject ) + .progress( updateFunc( i, progressContexts, progressValues ) ); + } else { + --remaining; + } + } + } + + // if we're not waiting on anything, resolve the master + if ( !remaining ) { + deferred.resolveWith( resolveContexts, resolveValues ); + } + + return deferred.promise(); + } +}); + + +// The deferred used on DOM ready +var readyList; + +SofoAnySignJQuery.fn.ready = function( fn ) { + // Add the callback + SofoAnySignJQuery.ready.promise().done( fn ); + + return this; +}; + +SofoAnySignJQuery.extend({ + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Hold (or release) the ready event + holdReady: function( hold ) { + if ( hold ) { + SofoAnySignJQuery.readyWait++; + } else { + SofoAnySignJQuery.ready( true ); + } + }, + + // Handle when the DOM is ready + ready: function( wait ) { + + // Abort if there are pending holds or we're already ready + if ( wait === true ? --SofoAnySignJQuery.readyWait : SofoAnySignJQuery.isReady ) { + return; + } + + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( !document.body ) { + return setTimeout( SofoAnySignJQuery.ready ); + } + + // Remember that the DOM is ready + SofoAnySignJQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --SofoAnySignJQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ SofoAnySignJQuery ] ); + + // Trigger any bound ready events + if ( SofoAnySignJQuery.fn.triggerHandler ) { + SofoAnySignJQuery( document ).triggerHandler( "ready" ); + SofoAnySignJQuery( document ).off( "ready" ); + } + } +}); + +/** + * Clean-up method for dom ready events + */ +function detach() { + if ( document.addEventListener ) { + document.removeEventListener( "DOMContentLoaded", completed, false ); + window.removeEventListener( "load", completed, false ); + + } else { + document.detachEvent( "onreadystatechange", completed ); + window.detachEvent( "onload", completed ); + } +} + +/** + * The ready event handler and self cleanup method + */ +function completed() { + // readyState === "complete" is good enough for us to call the dom ready in oldIE + if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { + detach(); + SofoAnySignJQuery.ready(); + } +} + +SofoAnySignJQuery.ready.promise = function( obj ) { + if ( !readyList ) { + + readyList = SofoAnySignJQuery.Deferred(); + + // Catch cases where $(document).ready() is called after the browser event has already occurred. + // we once tried to use readyState "interactive" here, but it caused issues like the one + // discovered by ChrisS here: http://bugs.SofoAnySignJQuery.com/ticket/12282#comment:15 + if ( document.readyState === "complete" ) { + // Handle it asynchronously to allow scripts the opportunity to delay ready + setTimeout( SofoAnySignJQuery.ready ); + + // Standards-based browsers support DOMContentLoaded + } else if ( document.addEventListener ) { + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", completed, false ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", completed, false ); + + // If IE event model is used + } else { + // Ensure firing before onload, maybe late but safe also for iframes + document.attachEvent( "onreadystatechange", completed ); + + // A fallback to window.onload, that will always work + window.attachEvent( "onload", completed ); + + // If IE and not a frame + // continually check to see if the document is ready + var top = false; + + try { + top = window.frameElement == null && document.documentElement; + } catch(e) {} + + if ( top && top.doScroll ) { + (function doScrollCheck() { + if ( !SofoAnySignJQuery.isReady ) { + + try { + // Use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + top.doScroll("left"); + } catch(e) { + return setTimeout( doScrollCheck, 50 ); + } + + // detach all dom ready events + detach(); + + // and execute any waiting functions + SofoAnySignJQuery.ready(); + } + })(); + } + } + } + return readyList.promise( obj ); +}; + + +var strundefined = typeof undefined; + + + +// Support: IE<9 +// Iteration over object's inherited properties before its own +var i; +for ( i in SofoAnySignJQuery( support ) ) { + break; +} +support.ownLast = i !== "0"; + +// Note: most support tests are defined in their respective modules. +// false until the test is run +support.inlineBlockNeedsLayout = false; + +// Execute ASAP in case we need to set body.style.zoom +SofoAnySignJQuery(function() { + // Minified: var a,b,c,d + var val, div, body, container; + + body = document.getElementsByTagName( "body" )[ 0 ]; + if ( !body || !body.style ) { + // Return for frameset docs that don't have a body + return; + } + + // Setup + div = document.createElement( "div" ); + container = document.createElement( "div" ); + container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; + body.appendChild( container ).appendChild( div ); + + if ( typeof div.style.zoom !== strundefined ) { + // Support: IE<8 + // Check if natively block-level elements act like inline-block + // elements when setting their display to 'inline' and giving + // them layout + div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1"; + + support.inlineBlockNeedsLayout = val = div.offsetWidth === 3; + if ( val ) { + // Prevent IE 6 from affecting layout for positioned elements #11048 + // Prevent IE from shrinking the body in IE 7 mode #12869 + // Support: IE<8 + body.style.zoom = 1; + } + } + + body.removeChild( container ); + + if ( div.parentNode ) { + div.parentNode.removeChild( div ); + } + // release memory in IE + div = null; + + if ( container.parentNode ) { + container.parentNode.removeChild( container ); + } + // release memory in IE + container = null; +}); + + + + +(function() { + var div = document.createElement( "div" ); + + // Execute the test only if not already executed in another module. + if (support.deleteExpando == null) { + // Support: IE<9 + support.deleteExpando = true; + try { + delete div.test; + } catch( e ) { + support.deleteExpando = false; + } + } + + // Null elements to avoid leaks in IE. + if ( div.parentNode ) { + div.parentNode.removeChild( div ); + } + // release memory in IE + div = null; +})(); + + +/** + * Determines whether an object can have data + */ +SofoAnySignJQuery.acceptData = function( elem ) { + var noData = SofoAnySignJQuery.noData[ (elem.nodeName + " ").toLowerCase() ], + nodeType = +elem.nodeType || 1; + + // Do not set data on non-element DOM nodes because it will not be cleared (#8335). + return nodeType !== 1 && nodeType !== 9 ? + false : + + // Nodes accept data unless otherwise specified; rejection can be conditional + !noData || noData !== true && elem.getAttribute("classid") === noData; +}; + + +var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, + rmultiDash = /([A-Z])/g; + +function dataAttr( elem, key, data ) { + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + + var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); + + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : + // Only convert to a number if it doesn't change the string + +data + "" === data ? +data : + rbrace.test( data ) ? SofoAnySignJQuery.parseJSON( data ) : + data; + } catch( e ) {} + + // Make sure we set the data so it isn't changed later + SofoAnySignJQuery.data( elem, key, data ); + + } else { + data = undefined; + } + } + + return data; +} + +// checks a cache object for emptiness +function isEmptyDataObject( obj ) { + var name; + for ( name in obj ) { + + // if the public data object is empty, the private is still empty + if ( name === "data" && SofoAnySignJQuery.isEmptyObject( obj[name] ) ) { + continue; + } + if ( name !== "toJSON" ) { + return false; + } + } + + return true; +} + +function internalData( elem, name, data, pvt /* Internal Use Only */ ) { + if ( !SofoAnySignJQuery.acceptData( elem ) ) { + return; + } + + var ret, thisCache, + internalKey = SofoAnySignJQuery.expando, + + // We have to handle DOM nodes and JS objects differently because IE6-7 + // can't GC object references properly across the DOM-JS boundary + isNode = elem.nodeType, + + // Only DOM nodes need the global SofoAnySignJQuery cache; JS object data is + // attached directly to the object so GC can occur automatically + cache = isNode ? SofoAnySignJQuery.cache : elem, + + // Only defining an ID for JS objects if its cache already exists allows + // the code to shortcut on the same path as a DOM node with no cache + id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; + + // Avoid doing any more work than we need to when trying to get data on an + // object that has no data at all + if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { + return; + } + + if ( !id ) { + // Only DOM nodes need a new unique ID for each element since their data + // ends up in the global cache + if ( isNode ) { + id = elem[ internalKey ] = deletedIds.pop() || SofoAnySignJQuery.guid++; + } else { + id = internalKey; + } + } + + if ( !cache[ id ] ) { + // Avoid exposing SofoAnySignJQuery metadata on plain JS objects when the object + // is serialized using JSON.stringify + cache[ id ] = isNode ? {} : { toJSON: SofoAnySignJQuery.noop }; + } + + // An object can be passed to SofoAnySignJQuery.data instead of a key/value pair; this gets + // shallow copied over onto the existing cache + if ( typeof name === "object" || typeof name === "function" ) { + if ( pvt ) { + cache[ id ] = SofoAnySignJQuery.extend( cache[ id ], name ); + } else { + cache[ id ].data = SofoAnySignJQuery.extend( cache[ id ].data, name ); + } + } + + thisCache = cache[ id ]; + + // SofoAnySignJQuery data() is stored in a separate object inside the object's internal data + // cache in order to avoid key collisions between internal data and user-defined + // data. + if ( !pvt ) { + if ( !thisCache.data ) { + thisCache.data = {}; + } + + thisCache = thisCache.data; + } + + if ( data !== undefined ) { + thisCache[ SofoAnySignJQuery.camelCase( name ) ] = data; + } + + // Check for both converted-to-camel and non-converted data property names + // If a data property was specified + if ( typeof name === "string" ) { + + // First Try to find as-is property data + ret = thisCache[ name ]; + + // Test for null|undefined property data + if ( ret == null ) { + + // Try to find the camelCased property + ret = thisCache[ SofoAnySignJQuery.camelCase( name ) ]; + } + } else { + ret = thisCache; + } + + return ret; +} + +function internalRemoveData( elem, name, pvt ) { + if ( !SofoAnySignJQuery.acceptData( elem ) ) { + return; + } + + var thisCache, i, + isNode = elem.nodeType, + + // See SofoAnySignJQuery.data for more information + cache = isNode ? SofoAnySignJQuery.cache : elem, + id = isNode ? elem[ SofoAnySignJQuery.expando ] : SofoAnySignJQuery.expando; + + // If there is already no cache entry for this object, there is no + // purpose in continuing + if ( !cache[ id ] ) { + return; + } + + if ( name ) { + + thisCache = pvt ? cache[ id ] : cache[ id ].data; + + if ( thisCache ) { + + // Support array or space separated string names for data keys + if ( !SofoAnySignJQuery.isArray( name ) ) { + + // try the string as a key before any manipulation + if ( name in thisCache ) { + name = [ name ]; + } else { + + // split the camel cased version by spaces unless a key with the spaces exists + name = SofoAnySignJQuery.camelCase( name ); + if ( name in thisCache ) { + name = [ name ]; + } else { + name = name.split(" "); + } + } + } else { + // If "name" is an array of keys... + // When data is initially created, via ("key", "val") signature, + // keys will be converted to camelCase. + // Since there is no way to tell _how_ a key was added, remove + // both plain key and camelCase key. #12786 + // This will only penalize the array argument path. + name = name.concat( SofoAnySignJQuery.map( name, SofoAnySignJQuery.camelCase ) ); + } + + i = name.length; + while ( i-- ) { + delete thisCache[ name[i] ]; + } + + // If there is no data left in the cache, we want to continue + // and let the cache object itself get destroyed + if ( pvt ? !isEmptyDataObject(thisCache) : !SofoAnySignJQuery.isEmptyObject(thisCache) ) { + return; + } + } + } + + // See SofoAnySignJQuery.data for more information + if ( !pvt ) { + delete cache[ id ].data; + + // Don't destroy the parent cache unless the internal data object + // had been the only thing left in it + if ( !isEmptyDataObject( cache[ id ] ) ) { + return; + } + } + + // Destroy the cache + if ( isNode ) { + SofoAnySignJQuery.cleanData( [ elem ], true ); + + // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) + /* jshint eqeqeq: false */ + } else if ( support.deleteExpando || cache != cache.window ) { + /* jshint eqeqeq: true */ + delete cache[ id ]; + + // When all else fails, null + } else { + cache[ id ] = null; + } +} + +SofoAnySignJQuery.extend({ + cache: {}, + + // The following elements (space-suffixed to avoid Object.prototype collisions) + // throw uncatchable exceptions if you attempt to set expando properties + noData: { + "applet ": true, + "embed ": true, + // ...but Flash objects (which have this classid) *can* handle expandos + "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" + }, + + hasData: function( elem ) { + elem = elem.nodeType ? SofoAnySignJQuery.cache[ elem[SofoAnySignJQuery.expando] ] : elem[ SofoAnySignJQuery.expando ]; + return !!elem && !isEmptyDataObject( elem ); + }, + + data: function( elem, name, data ) { + return internalData( elem, name, data ); + }, + + removeData: function( elem, name ) { + return internalRemoveData( elem, name ); + }, + + // For internal use only. + _data: function( elem, name, data ) { + return internalData( elem, name, data, true ); + }, + + _removeData: function( elem, name ) { + return internalRemoveData( elem, name, true ); + } +}); + +SofoAnySignJQuery.fn.extend({ + data: function( key, value ) { + var i, name, data, + elem = this[0], + attrs = elem && elem.attributes; + + // Special expections of .data basically thwart SofoAnySignJQuery.access, + // so implement the relevant behavior ourselves + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = SofoAnySignJQuery.data( elem ); + + if ( elem.nodeType === 1 && !SofoAnySignJQuery._data( elem, "parsedAttrs" ) ) { + i = attrs.length; + while ( i-- ) { + + // Support: IE11+ + // The attrs elements can be null (#14894) + if ( attrs[ i ] ) { + name = attrs[ i ].name; + if ( name.indexOf( "data-" ) === 0 ) { + name = SofoAnySignJQuery.camelCase( name.slice(5) ); + dataAttr( elem, name, data[ name ] ); + } + } + } + SofoAnySignJQuery._data( elem, "parsedAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each(function() { + SofoAnySignJQuery.data( this, key ); + }); + } + + return arguments.length > 1 ? + + // Sets one value + this.each(function() { + SofoAnySignJQuery.data( this, key, value ); + }) : + + // Gets one value + // Try to fetch any internally stored data first + elem ? dataAttr( elem, key, SofoAnySignJQuery.data( elem, key ) ) : undefined; + }, + + removeData: function( key ) { + return this.each(function() { + SofoAnySignJQuery.removeData( this, key ); + }); + } +}); + + +SofoAnySignJQuery.extend({ + queue: function( elem, type, data ) { + var queue; + + if ( elem ) { + type = ( type || "fx" ) + "queue"; + queue = SofoAnySignJQuery._data( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !queue || SofoAnySignJQuery.isArray(data) ) { + queue = SofoAnySignJQuery._data( elem, type, SofoAnySignJQuery.makeArray(data) ); + } else { + queue.push( data ); + } + } + return queue || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = SofoAnySignJQuery.queue( elem, type ), + startLength = queue.length, + fn = queue.shift(), + hooks = SofoAnySignJQuery._queueHooks( elem, type ), + next = function() { + SofoAnySignJQuery.dequeue( elem, type ); + }; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + startLength--; + } + + if ( fn ) { + + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + // clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); + } + + if ( !startLength && hooks ) { + hooks.empty.fire(); + } + }, + + // not intended for public consumption - generates a queueHooks object, or returns the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return SofoAnySignJQuery._data( elem, key ) || SofoAnySignJQuery._data( elem, key, { + empty: SofoAnySignJQuery.Callbacks("once memory").add(function() { + SofoAnySignJQuery._removeData( elem, type + "queue" ); + SofoAnySignJQuery._removeData( elem, key ); + }) + }); + } +}); + +SofoAnySignJQuery.fn.extend({ + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return SofoAnySignJQuery.queue( this[0], type ); + } + + return data === undefined ? + this : + this.each(function() { + var queue = SofoAnySignJQuery.queue( this, type, data ); + + // ensure a hooks for this queue + SofoAnySignJQuery._queueHooks( this, type ); + + if ( type === "fx" && queue[0] !== "inprogress" ) { + SofoAnySignJQuery.dequeue( this, type ); + } + }); + }, + dequeue: function( type ) { + return this.each(function() { + SofoAnySignJQuery.dequeue( this, type ); + }); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, obj ) { + var tmp, + count = 1, + defer = SofoAnySignJQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + + if ( typeof type !== "string" ) { + obj = type; + type = undefined; + } + type = type || "fx"; + + while ( i-- ) { + tmp = SofoAnySignJQuery._data( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { + count++; + tmp.empty.add( resolve ); + } + } + resolve(); + return defer.promise( obj ); + } +}); +var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; + +var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; + +var isHidden = function( elem, el ) { + // isHidden might be called from SofoAnySignJQuery#filter function; + // in that case, element will be second argument + elem = el || elem; + return SofoAnySignJQuery.css( elem, "display" ) === "none" || !SofoAnySignJQuery.contains( elem.ownerDocument, elem ); + }; + + + +// Multifunctional method to get and set values of a collection +// The value/s can optionally be executed if it's a function +var access = SofoAnySignJQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { + var i = 0, + length = elems.length, + bulk = key == null; + + // Sets many values + if ( SofoAnySignJQuery.type( key ) === "object" ) { + chainable = true; + for ( i in key ) { + SofoAnySignJQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); + } + + // Sets one value + } else if ( value !== undefined ) { + chainable = true; + + if ( !SofoAnySignJQuery.isFunction( value ) ) { + raw = true; + } + + if ( bulk ) { + // Bulk operations run against the entire set + if ( raw ) { + fn.call( elems, value ); + fn = null; + + // ...except when executing function values + } else { + bulk = fn; + fn = function( elem, key, value ) { + return bulk.call( SofoAnySignJQuery( elem ), value ); + }; + } + } + + if ( fn ) { + for ( ; i < length; i++ ) { + fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); + } + } + } + + return chainable ? + elems : + + // Gets + bulk ? + fn.call( elems ) : + length ? fn( elems[0], key ) : emptyGet; +}; +var rcheckableType = (/^(?:checkbox|radio)$/i); + + + +(function() { + // Minified: var a,b,c + var input = document.createElement( "input" ), + div = document.createElement( "div" ), + fragment = document.createDocumentFragment(); + + // Setup + div.innerHTML = "
a"; + + // IE strips leading whitespace when .innerHTML is used + support.leadingWhitespace = div.firstChild.nodeType === 3; + + // Make sure that tbody elements aren't automatically inserted + // IE will insert them into empty tables + support.tbody = !div.getElementsByTagName( "tbody" ).length; + + // Make sure that link elements get serialized correctly by innerHTML + // This requires a wrapper element in IE + support.htmlSerialize = !!div.getElementsByTagName( "link" ).length; + + // Makes sure cloning an html5 element does not cause problems + // Where outerHTML is undefined, this still works + support.html5Clone = + document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav>"; + + // Check if a disconnected checkbox will retain its checked + // value of true after appended to the DOM (IE6/7) + input.type = "checkbox"; + input.checked = true; + fragment.appendChild( input ); + support.appendChecked = input.checked; + + // Make sure textarea (and checkbox) defaultValue is properly cloned + // Support: IE6-IE11+ + div.innerHTML = ""; + support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; + + // #11217 - WebKit loses check when the name is after the checked attribute + fragment.appendChild( div ); + div.innerHTML = ""; + + // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 + // old WebKit doesn't clone checked state correctly in fragments + support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Support: IE<9 + // Opera does not clone events (and typeof div.attachEvent === undefined). + // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() + support.noCloneEvent = true; + if ( div.attachEvent ) { + div.attachEvent( "onclick", function() { + support.noCloneEvent = false; + }); + + div.cloneNode( true ).click(); + } + + // Execute the test only if not already executed in another module. + if (support.deleteExpando == null) { + // Support: IE<9 + support.deleteExpando = true; + try { + delete div.test; + } catch( e ) { + support.deleteExpando = false; + } + } + + if ( div.parentNode ) { + div.parentNode.removeChild( div ); + } + // release memory in IE + div = null; + + if ( input.parentNode ) { + input.parentNode.removeChild( input ); + } + // release memory in IE + input = null; +})(); + + +(function() { + var i, eventName, + div = document.createElement( "div" ); + + // Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event) + for ( i in { submit: true, change: true, focusin: true }) { + eventName = "on" + i; + + if ( !(support[ i + "Bubbles" ] = eventName in window) ) { + // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) + div.setAttribute( eventName, "t" ); + support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false; + } + } + + // Null elements to avoid leaks in IE. + if ( div.parentNode ) { + div.parentNode.removeChild( div ); + } + // release memory in IE + div = null; +})(); + + +var rformElems = /^(?:input|select|textarea)$/i, + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/, + rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, + rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; + +function returnTrue() { + return true; +} + +function returnFalse() { + return false; +} + +function safeActiveElement() { + try { + return document.activeElement; + } catch ( err ) { } +} + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +SofoAnySignJQuery.event = { + + global: {}, + + add: function( elem, types, handler, data, selector ) { + var tmp, events, t, handleObjIn, + special, eventHandle, handleObj, + handlers, type, namespaces, origType, + elemData = SofoAnySignJQuery._data( elem ); + + // Don't attach events to noData or text/comment nodes (but allow plain objects) + if ( !elemData ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = SofoAnySignJQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + if ( !(events = elemData.events) ) { + events = elemData.events = {}; + } + if ( !(eventHandle = elemData.handle) ) { + eventHandle = elemData.handle = function( e ) { + // Discard the second event of a SofoAnySignJQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof SofoAnySignJQuery !== strundefined && (!e || SofoAnySignJQuery.event.triggered !== e.type) ? + SofoAnySignJQuery.event.dispatch.apply( eventHandle.elem, arguments ) : + undefined; + }; + // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events + eventHandle.elem = elem; + } + + // Handle multiple events separated by a space + types = ( types || "" ).match( rnotwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[t] ) || []; + type = origType = tmp[1]; + namespaces = ( tmp[2] || "" ).split( "." ).sort(); + + // There *must* be a type, no attaching namespace-only handlers + if ( !type ) { + continue; + } + + // If event changes its type, use the special event handlers for the changed type + special = SofoAnySignJQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = SofoAnySignJQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = SofoAnySignJQuery.extend({ + type: type, + origType: origType, + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + needsContext: selector && SofoAnySignJQuery.expr.match.needsContext.test( selector ), + namespace: namespaces.join(".") + }, handleObjIn ); + + // Init the event handler queue if we're the first + if ( !(handlers = events[ type ]) ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener/attachEvent if the special events handler returns false + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + // Bind the global event handler to the element + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + SofoAnySignJQuery.event.global[ type ] = true; + } + + // Nullify elem to prevent memory leaks in IE + elem = null; + }, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + var j, handleObj, tmp, + origCount, t, events, + special, handlers, type, + namespaces, origType, + elemData = SofoAnySignJQuery.hasData( elem ) && SofoAnySignJQuery._data( elem ); + + if ( !elemData || !(events = elemData.events) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = ( types || "" ).match( rnotwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[t] ) || []; + type = origType = tmp[1]; + namespaces = ( tmp[2] || "" ).split( "." ).sort(); + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + SofoAnySignJQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = SofoAnySignJQuery.event.special[ type ] || {}; + type = ( selector ? special.delegateType : special.bindType ) || type; + handlers = events[ type ] || []; + tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); + + // Remove matching events + origCount = j = handlers.length; + while ( j-- ) { + handleObj = handlers[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !tmp || tmp.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { + handlers.splice( j, 1 ); + + if ( handleObj.selector ) { + handlers.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( origCount && !handlers.length ) { + if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + SofoAnySignJQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( SofoAnySignJQuery.isEmptyObject( events ) ) { + delete elemData.handle; + + // removeData also checks for emptiness and clears the expando if empty + // so use it instead of delete + SofoAnySignJQuery._removeData( elem, "events" ); + } + }, + + trigger: function( event, data, elem, onlyHandlers ) { + var handle, ontype, cur, + bubbleType, special, tmp, i, + eventPath = [ elem || document ], + type = hasOwn.call( event, "type" ) ? event.type : event, + namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; + + cur = tmp = elem = elem || document; + + // Don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // focus/blur morphs to focusin/out; ensure we're not firing them right now + if ( rfocusMorph.test( type + SofoAnySignJQuery.event.triggered ) ) { + return; + } + + if ( type.indexOf(".") >= 0 ) { + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split("."); + type = namespaces.shift(); + namespaces.sort(); + } + ontype = type.indexOf(":") < 0 && "on" + type; + + // Caller can pass in a SofoAnySignJQuery.Event object, Object, or just an event type string + event = event[ SofoAnySignJQuery.expando ] ? + event : + new SofoAnySignJQuery.Event( type, typeof event === "object" && event ); + + // Trigger bitmask: & 1 for native handlers; & 2 for SofoAnySignJQuery (always true) + event.isTrigger = onlyHandlers ? 2 : 3; + event.namespace = namespaces.join("."); + event.namespace_re = event.namespace ? + new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : + null; + + // Clean up the event in case it is being reused + event.result = undefined; + if ( !event.target ) { + event.target = elem; + } + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data == null ? + [ event ] : + SofoAnySignJQuery.makeArray( data, [ event ] ); + + // Allow special events to draw outside the lines + special = SofoAnySignJQuery.event.special[ type ] || {}; + if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { + return; + } + + // Determine event propagation path in advance, per W3C events spec (#9951) + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) + if ( !onlyHandlers && !special.noBubble && !SofoAnySignJQuery.isWindow( elem ) ) { + + bubbleType = special.delegateType || type; + if ( !rfocusMorph.test( bubbleType + type ) ) { + cur = cur.parentNode; + } + for ( ; cur; cur = cur.parentNode ) { + eventPath.push( cur ); + tmp = cur; + } + + // Only add window if we got to document (e.g., not plain obj or detached DOM) + if ( tmp === (elem.ownerDocument || document) ) { + eventPath.push( tmp.defaultView || tmp.parentWindow || window ); + } + } + + // Fire handlers on the event path + i = 0; + while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { + + event.type = i > 1 ? + bubbleType : + special.bindType || type; + + // SofoAnySignJQuery handler + handle = ( SofoAnySignJQuery._data( cur, "events" ) || {} )[ event.type ] && SofoAnySignJQuery._data( cur, "handle" ); + if ( handle ) { + handle.apply( cur, data ); + } + + // Native handler + handle = ontype && cur[ ontype ]; + if ( handle && handle.apply && SofoAnySignJQuery.acceptData( cur ) ) { + event.result = handle.apply( cur, data ); + if ( event.result === false ) { + event.preventDefault(); + } + } + } + event.type = type; + + // If nobody prevented the default action, do it now + if ( !onlyHandlers && !event.isDefaultPrevented() ) { + + if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && + SofoAnySignJQuery.acceptData( elem ) ) { + + // Call a native DOM method on the target with the same name name as the event. + // Can't use an .isFunction() check here because IE6/7 fails that test. + // Don't do default actions on window, that's where global variables be (#6170) + if ( ontype && elem[ type ] && !SofoAnySignJQuery.isWindow( elem ) ) { + + // Don't re-trigger an onFOO event when we call its FOO() method + tmp = elem[ ontype ]; + + if ( tmp ) { + elem[ ontype ] = null; + } + + // Prevent re-triggering of the same event, since we already bubbled it above + SofoAnySignJQuery.event.triggered = type; + try { + elem[ type ](); + } catch ( e ) { + // IE<9 dies on focus/blur to hidden element (#1486,#12518) + // only reproducible on winXP IE8 native, not IE9 in IE8 mode + } + SofoAnySignJQuery.event.triggered = undefined; + + if ( tmp ) { + elem[ ontype ] = tmp; + } + } + } + } + + return event.result; + }, + + dispatch: function( event ) { + + // Make a writable SofoAnySignJQuery.Event from the native event object + event = SofoAnySignJQuery.event.fix( event ); + + var i, ret, handleObj, matched, j, + handlerQueue = [], + args = slice.call( arguments ), + handlers = ( SofoAnySignJQuery._data( this, "events" ) || {} )[ event.type ] || [], + special = SofoAnySignJQuery.event.special[ event.type ] || {}; + + // Use the fix-ed SofoAnySignJQuery.Event rather than the (read-only) native event + args[0] = event; + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers + handlerQueue = SofoAnySignJQuery.event.handlers.call( this, event, handlers ); + + // Run delegates first; they may want to stop propagation beneath us + i = 0; + while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { + event.currentTarget = matched.elem; + + j = 0; + while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { + + // Triggered event must either 1) have no namespace, or + // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). + if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { + + event.handleObj = handleObj; + event.data = handleObj.data; + + ret = ( (SofoAnySignJQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) + .apply( matched.elem, args ); + + if ( ret !== undefined ) { + if ( (event.result = ret) === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + handlers: function( event, handlers ) { + var sel, handleObj, matches, i, + handlerQueue = [], + delegateCount = handlers.delegateCount, + cur = event.target; + + // Find delegate handlers + // Black-hole SVG instance trees (#13180) + // Avoid non-left-click bubbling in Firefox (#3861) + if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { + + /* jshint eqeqeq: false */ + for ( ; cur != this; cur = cur.parentNode || this ) { + /* jshint eqeqeq: true */ + + // Don't check non-elements (#13208) + // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { + matches = []; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + + // Don't conflict with Object.prototype properties (#13203) + sel = handleObj.selector + " "; + + if ( matches[ sel ] === undefined ) { + matches[ sel ] = handleObj.needsContext ? + SofoAnySignJQuery( sel, this ).index( cur ) >= 0 : + SofoAnySignJQuery.find( sel, this, null, [ cur ] ).length; + } + if ( matches[ sel ] ) { + matches.push( handleObj ); + } + } + if ( matches.length ) { + handlerQueue.push({ elem: cur, handlers: matches }); + } + } + } + } + + // Add the remaining (directly-bound) handlers + if ( delegateCount < handlers.length ) { + handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); + } + + return handlerQueue; + }, + + fix: function( event ) { + if ( event[ SofoAnySignJQuery.expando ] ) { + return event; + } + + // Create a writable copy of the event object and normalize some properties + var i, prop, copy, + type = event.type, + originalEvent = event, + fixHook = this.fixHooks[ type ]; + + if ( !fixHook ) { + this.fixHooks[ type ] = fixHook = + rmouseEvent.test( type ) ? this.mouseHooks : + rkeyEvent.test( type ) ? this.keyHooks : + {}; + } + copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; + + event = new SofoAnySignJQuery.Event( originalEvent ); + + i = copy.length; + while ( i-- ) { + prop = copy[ i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Support: IE<9 + // Fix target property (#1925) + if ( !event.target ) { + event.target = originalEvent.srcElement || document; + } + + // Support: Chrome 23+, Safari? + // Target should not be a text node (#504, #13143) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + // Support: IE<9 + // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) + event.metaKey = !!event.metaKey; + + return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; + }, + + // Includes some event props shared by KeyEvent and MouseEvent + props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), + + fixHooks: {}, + + keyHooks: { + props: "char charCode key keyCode".split(" "), + filter: function( event, original ) { + + // Add which for key events + if ( event.which == null ) { + event.which = original.charCode != null ? original.charCode : original.keyCode; + } + + return event; + } + }, + + mouseHooks: { + props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), + filter: function( event, original ) { + var body, eventDoc, doc, + button = original.button, + fromElement = original.fromElement; + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && original.clientX != null ) { + eventDoc = event.target.ownerDocument || document; + doc = eventDoc.documentElement; + body = eventDoc.body; + + event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); + event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); + } + + // Add relatedTarget, if necessary + if ( !event.relatedTarget && fromElement ) { + event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && button !== undefined ) { + event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); + } + + return event; + } + }, + + special: { + load: { + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + focus: { + // Fire native event if possible so blur/focus sequence is correct + trigger: function() { + if ( this !== safeActiveElement() && this.focus ) { + try { + this.focus(); + return false; + } catch ( e ) { + // Support: IE<9 + // If we error on focus to hidden element (#1486, #12518), + // let .trigger() run the handlers + } + } + }, + delegateType: "focusin" + }, + blur: { + trigger: function() { + if ( this === safeActiveElement() && this.blur ) { + this.blur(); + return false; + } + }, + delegateType: "focusout" + }, + click: { + // For checkbox, fire native event so checked state will be right + trigger: function() { + if ( SofoAnySignJQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { + this.click(); + return false; + } + }, + + // For cross-browser consistency, don't fire native .click() on links + _default: function( event ) { + return SofoAnySignJQuery.nodeName( event.target, "a" ); + } + }, + + beforeunload: { + postDispatch: function( event ) { + + // Support: Firefox 20+ + // Firefox doesn't alert if the returnValue field is not set. + if ( event.result !== undefined && event.originalEvent ) { + event.originalEvent.returnValue = event.result; + } + } + } + }, + + simulate: function( type, elem, event, bubble ) { + // Piggyback on a donor event to simulate a different one. + // Fake originalEvent to avoid donor's stopPropagation, but if the + // simulated event prevents default then we do the same on the donor. + var e = SofoAnySignJQuery.extend( + new SofoAnySignJQuery.Event(), + event, + { + type: type, + isSimulated: true, + originalEvent: {} + } + ); + if ( bubble ) { + SofoAnySignJQuery.event.trigger( e, null, elem ); + } else { + SofoAnySignJQuery.event.dispatch.call( elem, e ); + } + if ( e.isDefaultPrevented() ) { + event.preventDefault(); + } + } +}; + +SofoAnySignJQuery.removeEvent = document.removeEventListener ? + function( elem, type, handle ) { + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle, false ); + } + } : + function( elem, type, handle ) { + var name = "on" + type; + + if ( elem.detachEvent ) { + + // #8545, #7054, preventing memory leaks for custom events in IE6-8 + // detachEvent needed property on element, by name of that event, to properly expose it to GC + if ( typeof elem[ name ] === strundefined ) { + elem[ name ] = null; + } + + elem.detachEvent( name, handle ); + } + }; + +SofoAnySignJQuery.Event = function( src, props ) { + // Allow instantiation without the 'new' keyword + if ( !(this instanceof SofoAnySignJQuery.Event) ) { + return new SofoAnySignJQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = src.defaultPrevented || + src.defaultPrevented === undefined && + // Support: IE < 9, Android < 4.0 + src.returnValue === false ? + returnTrue : + returnFalse; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + SofoAnySignJQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || SofoAnySignJQuery.now(); + + // Mark it as fixed + this[ SofoAnySignJQuery.expando ] = true; +}; + +// SofoAnySignJQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +SofoAnySignJQuery.Event.prototype = { + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse, + + preventDefault: function() { + var e = this.originalEvent; + + this.isDefaultPrevented = returnTrue; + if ( !e ) { + return; + } + + // If preventDefault exists, run it on the original event + if ( e.preventDefault ) { + e.preventDefault(); + + // Support: IE + // Otherwise set the returnValue property of the original event to false + } else { + e.returnValue = false; + } + }, + stopPropagation: function() { + var e = this.originalEvent; + + this.isPropagationStopped = returnTrue; + if ( !e ) { + return; + } + // If stopPropagation exists, run it on the original event + if ( e.stopPropagation ) { + e.stopPropagation(); + } + + // Support: IE + // Set the cancelBubble property of the original event to true + e.cancelBubble = true; + }, + stopImmediatePropagation: function() { + var e = this.originalEvent; + + this.isImmediatePropagationStopped = returnTrue; + + if ( e && e.stopImmediatePropagation ) { + e.stopImmediatePropagation(); + } + + this.stopPropagation(); + } +}; + +// Create mouseenter/leave events using mouseover/out and event-time checks +SofoAnySignJQuery.each({ + mouseenter: "mouseover", + mouseleave: "mouseout", + pointerenter: "pointerover", + pointerleave: "pointerout" +}, function( orig, fix ) { + SofoAnySignJQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var ret, + target = this, + related = event.relatedTarget, + handleObj = event.handleObj; + + // For mousenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || (related !== target && !SofoAnySignJQuery.contains( target, related )) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +}); + +// IE submit delegation +if ( !support.submitBubbles ) { + + SofoAnySignJQuery.event.special.submit = { + setup: function() { + // Only need this for delegated form submit events + if ( SofoAnySignJQuery.nodeName( this, "form" ) ) { + return false; + } + + // Lazy-add a submit handler when a descendant form may potentially be submitted + SofoAnySignJQuery.event.add( this, "click._submit keypress._submit", function( e ) { + // Node name check avoids a VML-related crash in IE (#9807) + var elem = e.target, + form = SofoAnySignJQuery.nodeName( elem, "input" ) || SofoAnySignJQuery.nodeName( elem, "button" ) ? elem.form : undefined; + if ( form && !SofoAnySignJQuery._data( form, "submitBubbles" ) ) { + SofoAnySignJQuery.event.add( form, "submit._submit", function( event ) { + event._submit_bubble = true; + }); + SofoAnySignJQuery._data( form, "submitBubbles", true ); + } + }); + // return undefined since we don't need an event listener + }, + + postDispatch: function( event ) { + // If form was submitted by the user, bubble the event up the tree + if ( event._submit_bubble ) { + delete event._submit_bubble; + if ( this.parentNode && !event.isTrigger ) { + SofoAnySignJQuery.event.simulate( "submit", this.parentNode, event, true ); + } + } + }, + + teardown: function() { + // Only need this for delegated form submit events + if ( SofoAnySignJQuery.nodeName( this, "form" ) ) { + return false; + } + + // Remove delegated handlers; cleanData eventually reaps submit handlers attached above + SofoAnySignJQuery.event.remove( this, "._submit" ); + } + }; +} + +// IE change delegation and checkbox/radio fix +if ( !support.changeBubbles ) { + + SofoAnySignJQuery.event.special.change = { + + setup: function() { + + if ( rformElems.test( this.nodeName ) ) { + // IE doesn't fire change on a check/radio until blur; trigger it on click + // after a propertychange. Eat the blur-change in special.change.handle. + // This still fires onchange a second time for check/radio after blur. + if ( this.type === "checkbox" || this.type === "radio" ) { + SofoAnySignJQuery.event.add( this, "propertychange._change", function( event ) { + if ( event.originalEvent.propertyName === "checked" ) { + this._just_changed = true; + } + }); + SofoAnySignJQuery.event.add( this, "click._change", function( event ) { + if ( this._just_changed && !event.isTrigger ) { + this._just_changed = false; + } + // Allow triggered, simulated change events (#11500) + SofoAnySignJQuery.event.simulate( "change", this, event, true ); + }); + } + return false; + } + // Delegated event; lazy-add a change handler on descendant inputs + SofoAnySignJQuery.event.add( this, "beforeactivate._change", function( e ) { + var elem = e.target; + + if ( rformElems.test( elem.nodeName ) && !SofoAnySignJQuery._data( elem, "changeBubbles" ) ) { + SofoAnySignJQuery.event.add( elem, "change._change", function( event ) { + if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { + SofoAnySignJQuery.event.simulate( "change", this.parentNode, event, true ); + } + }); + SofoAnySignJQuery._data( elem, "changeBubbles", true ); + } + }); + }, + + handle: function( event ) { + var elem = event.target; + + // Swallow native change events from checkbox/radio, we already triggered them above + if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { + return event.handleObj.handler.apply( this, arguments ); + } + }, + + teardown: function() { + SofoAnySignJQuery.event.remove( this, "._change" ); + + return !rformElems.test( this.nodeName ); + } + }; +} + +// Create "bubbling" focus and blur events +if ( !support.focusinBubbles ) { + SofoAnySignJQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler on the document while someone wants focusin/focusout + var handler = function( event ) { + SofoAnySignJQuery.event.simulate( fix, event.target, SofoAnySignJQuery.event.fix( event ), true ); + }; + + SofoAnySignJQuery.event.special[ fix ] = { + setup: function() { + var doc = this.ownerDocument || this, + attaches = SofoAnySignJQuery._data( doc, fix ); + + if ( !attaches ) { + doc.addEventListener( orig, handler, true ); + } + SofoAnySignJQuery._data( doc, fix, ( attaches || 0 ) + 1 ); + }, + teardown: function() { + var doc = this.ownerDocument || this, + attaches = SofoAnySignJQuery._data( doc, fix ) - 1; + + if ( !attaches ) { + doc.removeEventListener( orig, handler, true ); + SofoAnySignJQuery._removeData( doc, fix ); + } else { + SofoAnySignJQuery._data( doc, fix, attaches ); + } + } + }; + }); +} + +SofoAnySignJQuery.fn.extend({ + + on: function( types, selector, data, fn, /*INTERNAL*/ one ) { + var type, origFn; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + this.on( type, selector, data, types[ type ], one ); + } + return this; + } + + if ( data == null && fn == null ) { + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return this; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + // Can use an empty set, since event contains the info + SofoAnySignJQuery().off( event ); + return origFn.apply( this, arguments ); + }; + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = SofoAnySignJQuery.guid++ ); + } + return this.each( function() { + SofoAnySignJQuery.event.add( this, types, fn, data, selector ); + }); + }, + one: function( types, selector, data, fn ) { + return this.on( types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + var handleObj, type; + if ( types && types.preventDefault && types.handleObj ) { + // ( event ) dispatched SofoAnySignJQuery.Event + handleObj = types.handleObj; + SofoAnySignJQuery( types.delegateTarget ).off( + handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + // ( types-object [, selector] ) + for ( type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each(function() { + SofoAnySignJQuery.event.remove( this, types, fn, selector ); + }); + }, + + trigger: function( type, data ) { + return this.each(function() { + SofoAnySignJQuery.event.trigger( type, data, this ); + }); + }, + triggerHandler: function( type, data ) { + var elem = this[0]; + if ( elem ) { + return SofoAnySignJQuery.event.trigger( type, data, elem, true ); + } + } +}); + + +function createSafeFragment( document ) { + var list = nodeNames.split( "|" ), + safeFrag = document.createDocumentFragment(); + + if ( safeFrag.createElement ) { + while ( list.length ) { + safeFrag.createElement( + list.pop() + ); + } + } + return safeFrag; +} + +var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", + rinlineSofoAnySignJQuery = / SofoAnySignJQuery\d+="(?:null|\d+)"/g, + rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), + rleadingWhitespace = /^\s+/, + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi, + rtagName = /<([\w:]+)/, + rtbody = /\s*$/g, + + // We have to close these tags to support XHTML (#13200) + wrapMap = { + option: [ 1, "" ], + legend: [ 1, "
", "
" ], + area: [ 1, "", "" ], + param: [ 1, "", "" ], + thead: [ 1, "", "
" ], + tr: [ 2, "", "
" ], + col: [ 2, "", "
" ], + td: [ 3, "", "
" ], + + // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, + // unless wrapped in a div with non-breaking characters in front of it. + _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X
", "
" ] + }, + safeFragment = createSafeFragment( document ), + fragmentDiv = safeFragment.appendChild( document.createElement("div") ); + +wrapMap.optgroup = wrapMap.option; +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +function getAll( context, tag ) { + var elems, elem, + i = 0, + found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) : + typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) : + undefined; + + if ( !found ) { + for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { + if ( !tag || SofoAnySignJQuery.nodeName( elem, tag ) ) { + found.push( elem ); + } else { + SofoAnySignJQuery.merge( found, getAll( elem, tag ) ); + } + } + } + + return tag === undefined || tag && SofoAnySignJQuery.nodeName( context, tag ) ? + SofoAnySignJQuery.merge( [ context ], found ) : + found; +} + +// Used in buildFragment, fixes the defaultChecked property +function fixDefaultChecked( elem ) { + if ( rcheckableType.test( elem.type ) ) { + elem.defaultChecked = elem.checked; + } +} + +// Support: IE<8 +// Manipulating tables requires a tbody +function manipulationTarget( elem, content ) { + return SofoAnySignJQuery.nodeName( elem, "table" ) && + SofoAnySignJQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? + + elem.getElementsByTagName("tbody")[0] || + elem.appendChild( elem.ownerDocument.createElement("tbody") ) : + elem; +} + +// Replace/restore the type attribute of script elements for safe DOM manipulation +function disableScript( elem ) { + elem.type = (SofoAnySignJQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; + return elem; +} +function restoreScript( elem ) { + var match = rscriptTypeMasked.exec( elem.type ); + if ( match ) { + elem.type = match[1]; + } else { + elem.removeAttribute("type"); + } + return elem; +} + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var elem, + i = 0; + for ( ; (elem = elems[i]) != null; i++ ) { + SofoAnySignJQuery._data( elem, "globalEval", !refElements || SofoAnySignJQuery._data( refElements[i], "globalEval" ) ); + } +} + +function cloneCopyEvent( src, dest ) { + + if ( dest.nodeType !== 1 || !SofoAnySignJQuery.hasData( src ) ) { + return; + } + + var type, i, l, + oldData = SofoAnySignJQuery._data( src ), + curData = SofoAnySignJQuery._data( dest, oldData ), + events = oldData.events; + + if ( events ) { + delete curData.handle; + curData.events = {}; + + for ( type in events ) { + for ( i = 0, l = events[ type ].length; i < l; i++ ) { + SofoAnySignJQuery.event.add( dest, type, events[ type ][ i ] ); + } + } + } + + // make the cloned public data object a copy from the original + if ( curData.data ) { + curData.data = SofoAnySignJQuery.extend( {}, curData.data ); + } +} + +function fixCloneNodeIssues( src, dest ) { + var nodeName, e, data; + + // We do not need to do anything for non-Elements + if ( dest.nodeType !== 1 ) { + return; + } + + nodeName = dest.nodeName.toLowerCase(); + + // IE6-8 copies events bound via attachEvent when using cloneNode. + if ( !support.noCloneEvent && dest[ SofoAnySignJQuery.expando ] ) { + data = SofoAnySignJQuery._data( dest ); + + for ( e in data.events ) { + SofoAnySignJQuery.removeEvent( dest, e, data.handle ); + } + + // Event data gets referenced instead of copied if the expando gets copied too + dest.removeAttribute( SofoAnySignJQuery.expando ); + } + + // IE blanks contents when cloning scripts, and tries to evaluate newly-set text + if ( nodeName === "script" && dest.text !== src.text ) { + disableScript( dest ).text = src.text; + restoreScript( dest ); + + // IE6-10 improperly clones children of object elements using classid. + // IE10 throws NoModificationAllowedError if parent is null, #12132. + } else if ( nodeName === "object" ) { + if ( dest.parentNode ) { + dest.outerHTML = src.outerHTML; + } + + // This path appears unavoidable for IE9. When cloning an object + // element in IE9, the outerHTML strategy above is not sufficient. + // If the src has innerHTML and the destination does not, + // copy the src.innerHTML into the dest.innerHTML. #10324 + if ( support.html5Clone && ( src.innerHTML && !SofoAnySignJQuery.trim(dest.innerHTML) ) ) { + dest.innerHTML = src.innerHTML; + } + + } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { + // IE6-8 fails to persist the checked state of a cloned checkbox + // or radio button. Worse, IE6-7 fail to give the cloned element + // a checked appearance if the defaultChecked value isn't also set + + dest.defaultChecked = dest.checked = src.checked; + + // IE6-7 get confused and end up setting the value of a cloned + // checkbox/radio button to an empty string instead of "on" + if ( dest.value !== src.value ) { + dest.value = src.value; + } + + // IE6-8 fails to return the selected option to the default selected + // state when cloning options + } else if ( nodeName === "option" ) { + dest.defaultSelected = dest.selected = src.defaultSelected; + + // IE6-8 fails to set the defaultValue to the correct value when + // cloning other types of input fields + } else if ( nodeName === "input" || nodeName === "textarea" ) { + dest.defaultValue = src.defaultValue; + } +} + +SofoAnySignJQuery.extend({ + clone: function( elem, dataAndEvents, deepDataAndEvents ) { + var destElements, node, clone, i, srcElements, + inPage = SofoAnySignJQuery.contains( elem.ownerDocument, elem ); + + if ( support.html5Clone || SofoAnySignJQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { + clone = elem.cloneNode( true ); + + // IE<=8 does not properly clone detached, unknown element nodes + } else { + fragmentDiv.innerHTML = elem.outerHTML; + fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); + } + + if ( (!support.noCloneEvent || !support.noCloneChecked) && + (elem.nodeType === 1 || elem.nodeType === 11) && !SofoAnySignJQuery.isXMLDoc(elem) ) { + + // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 + destElements = getAll( clone ); + srcElements = getAll( elem ); + + // Fix all IE cloning issues + for ( i = 0; (node = srcElements[i]) != null; ++i ) { + // Ensure that the destination node is not null; Fixes #9587 + if ( destElements[i] ) { + fixCloneNodeIssues( node, destElements[i] ); + } + } + } + + // Copy the events from the original to the clone + if ( dataAndEvents ) { + if ( deepDataAndEvents ) { + srcElements = srcElements || getAll( elem ); + destElements = destElements || getAll( clone ); + + for ( i = 0; (node = srcElements[i]) != null; i++ ) { + cloneCopyEvent( node, destElements[i] ); + } + } else { + cloneCopyEvent( elem, clone ); + } + } + + // Preserve script evaluation history + destElements = getAll( clone, "script" ); + if ( destElements.length > 0 ) { + setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); + } + + destElements = srcElements = node = null; + + // Return the cloned set + return clone; + }, + + buildFragment: function( elems, context, scripts, selection ) { + var j, elem, contains, + tmp, tag, tbody, wrap, + l = elems.length, + + // Ensure a safe fragment + safe = createSafeFragment( context ), + + nodes = [], + i = 0; + + for ( ; i < l; i++ ) { + elem = elems[ i ]; + + if ( elem || elem === 0 ) { + + // Add nodes directly + if ( SofoAnySignJQuery.type( elem ) === "object" ) { + SofoAnySignJQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); + + // Convert non-html into a text node + } else if ( !rhtml.test( elem ) ) { + nodes.push( context.createTextNode( elem ) ); + + // Convert html into DOM nodes + } else { + tmp = tmp || safe.appendChild( context.createElement("div") ); + + // Deserialize a standard representation + tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase(); + wrap = wrapMap[ tag ] || wrapMap._default; + + tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[2]; + + // Descend through wrappers to the right content + j = wrap[0]; + while ( j-- ) { + tmp = tmp.lastChild; + } + + // Manually add leading whitespace removed by IE + if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { + nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); + } + + // Remove IE's autoinserted from table fragments + if ( !support.tbody ) { + + // String was a , *may* have spurious + elem = tag === "table" && !rtbody.test( elem ) ? + tmp.firstChild : + + // String was a bare or + wrap[1] === "
" && !rtbody.test( elem ) ? + tmp : + 0; + + j = elem && elem.childNodes.length; + while ( j-- ) { + if ( SofoAnySignJQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { + elem.removeChild( tbody ); + } + } + } + + SofoAnySignJQuery.merge( nodes, tmp.childNodes ); + + // Fix #12392 for WebKit and IE > 9 + tmp.textContent = ""; + + // Fix #12392 for oldIE + while ( tmp.firstChild ) { + tmp.removeChild( tmp.firstChild ); + } + + // Remember the top-level container for proper cleanup + tmp = safe.lastChild; + } + } + } + + // Fix #11356: Clear elements from fragment + if ( tmp ) { + safe.removeChild( tmp ); + } + + // Reset defaultChecked for any radios and checkboxes + // about to be appended to the DOM in IE 6/7 (#8060) + if ( !support.appendChecked ) { + SofoAnySignJQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); + } + + i = 0; + while ( (elem = nodes[ i++ ]) ) { + + // #4087 - If origin and destination elements are the same, and this is + // that element, do not do anything + if ( selection && SofoAnySignJQuery.inArray( elem, selection ) !== -1 ) { + continue; + } + + contains = SofoAnySignJQuery.contains( elem.ownerDocument, elem ); + + // Append to fragment + tmp = getAll( safe.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( contains ) { + setGlobalEval( tmp ); + } + + // Capture executables + if ( scripts ) { + j = 0; + while ( (elem = tmp[ j++ ]) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } + } + } + + tmp = null; + + return safe; + }, + + cleanData: function( elems, /* internal */ acceptData ) { + var elem, type, id, data, + i = 0, + internalKey = SofoAnySignJQuery.expando, + cache = SofoAnySignJQuery.cache, + deleteExpando = support.deleteExpando, + special = SofoAnySignJQuery.event.special; + + for ( ; (elem = elems[i]) != null; i++ ) { + if ( acceptData || SofoAnySignJQuery.acceptData( elem ) ) { + + id = elem[ internalKey ]; + data = id && cache[ id ]; + + if ( data ) { + if ( data.events ) { + for ( type in data.events ) { + if ( special[ type ] ) { + SofoAnySignJQuery.event.remove( elem, type ); + + // This is a shortcut to avoid SofoAnySignJQuery.event.remove's overhead + } else { + SofoAnySignJQuery.removeEvent( elem, type, data.handle ); + } + } + } + + // Remove cache only if it was not already removed by SofoAnySignJQuery.event.remove + if ( cache[ id ] ) { + + delete cache[ id ]; + + // IE does not allow us to delete expando properties from nodes, + // nor does it have a removeAttribute function on Document nodes; + // we must handle all of these cases + if ( deleteExpando ) { + delete elem[ internalKey ]; + + } else if ( typeof elem.removeAttribute !== strundefined ) { + elem.removeAttribute( internalKey ); + + } else { + elem[ internalKey ] = null; + } + + deletedIds.push( id ); + } + } + } + } + } +}); + +SofoAnySignJQuery.fn.extend({ + text: function( value ) { + return access( this, function( value ) { + return value === undefined ? + SofoAnySignJQuery.text( this ) : + this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); + }, null, value, arguments.length ); + }, + + append: function() { + return this.domManip( arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.appendChild( elem ); + } + }); + }, + + prepend: function() { + return this.domManip( arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.insertBefore( elem, target.firstChild ); + } + }); + }, + + before: function() { + return this.domManip( arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this ); + } + }); + }, + + after: function() { + return this.domManip( arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this.nextSibling ); + } + }); + }, + + remove: function( selector, keepData /* Internal Use Only */ ) { + var elem, + elems = selector ? SofoAnySignJQuery.filter( selector, this ) : this, + i = 0; + + for ( ; (elem = elems[i]) != null; i++ ) { + + if ( !keepData && elem.nodeType === 1 ) { + SofoAnySignJQuery.cleanData( getAll( elem ) ); + } + + if ( elem.parentNode ) { + if ( keepData && SofoAnySignJQuery.contains( elem.ownerDocument, elem ) ) { + setGlobalEval( getAll( elem, "script" ) ); + } + elem.parentNode.removeChild( elem ); + } + } + + return this; + }, + + empty: function() { + var elem, + i = 0; + + for ( ; (elem = this[i]) != null; i++ ) { + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + SofoAnySignJQuery.cleanData( getAll( elem, false ) ); + } + + // Remove any remaining nodes + while ( elem.firstChild ) { + elem.removeChild( elem.firstChild ); + } + + // If this is a select, ensure that it displays empty (#12336) + // Support: IE<9 + if ( elem.options && SofoAnySignJQuery.nodeName( elem, "select" ) ) { + elem.options.length = 0; + } + } + + return this; + }, + + clone: function( dataAndEvents, deepDataAndEvents ) { + dataAndEvents = dataAndEvents == null ? false : dataAndEvents; + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; + + return this.map(function() { + return SofoAnySignJQuery.clone( this, dataAndEvents, deepDataAndEvents ); + }); + }, + + html: function( value ) { + return access( this, function( value ) { + var elem = this[ 0 ] || {}, + i = 0, + l = this.length; + + if ( value === undefined ) { + return elem.nodeType === 1 ? + elem.innerHTML.replace( rinlineSofoAnySignJQuery, "" ) : + undefined; + } + + // See if we can take a shortcut and just use innerHTML + if ( typeof value === "string" && !rnoInnerhtml.test( value ) && + ( support.htmlSerialize || !rnoshimcache.test( value ) ) && + ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && + !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) { + + value = value.replace( rxhtmlTag, "<$1>" ); + + try { + for (; i < l; i++ ) { + // Remove element nodes and prevent memory leaks + elem = this[i] || {}; + if ( elem.nodeType === 1 ) { + SofoAnySignJQuery.cleanData( getAll( elem, false ) ); + elem.innerHTML = value; + } + } + + elem = 0; + + // If using innerHTML throws an exception, use the fallback method + } catch(e) {} + } + + if ( elem ) { + this.empty().append( value ); + } + }, null, value, arguments.length ); + }, + + replaceWith: function() { + var arg = arguments[ 0 ]; + + // Make the changes, replacing each context element with the new content + this.domManip( arguments, function( elem ) { + arg = this.parentNode; + + SofoAnySignJQuery.cleanData( getAll( this ) ); + + if ( arg ) { + arg.replaceChild( elem, this ); + } + }); + + // Force removal if there was no new content (e.g., from empty arguments) + return arg && (arg.length || arg.nodeType) ? this : this.remove(); + }, + + detach: function( selector ) { + return this.remove( selector, true ); + }, + + domManip: function( args, callback ) { + + // Flatten any nested arrays + args = concat.apply( [], args ); + + var first, node, hasScripts, + scripts, doc, fragment, + i = 0, + l = this.length, + set = this, + iNoClone = l - 1, + value = args[0], + isFunction = SofoAnySignJQuery.isFunction( value ); + + // We can't cloneNode fragments that contain checked, in WebKit + if ( isFunction || + ( l > 1 && typeof value === "string" && + !support.checkClone && rchecked.test( value ) ) ) { + return this.each(function( index ) { + var self = set.eq( index ); + if ( isFunction ) { + args[0] = value.call( this, index, self.html() ); + } + self.domManip( args, callback ); + }); + } + + if ( l ) { + fragment = SofoAnySignJQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; + } + + if ( first ) { + scripts = SofoAnySignJQuery.map( getAll( fragment, "script" ), disableScript ); + hasScripts = scripts.length; + + // Use the original fragment for the last item instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + for ( ; i < l; i++ ) { + node = fragment; + + if ( i !== iNoClone ) { + node = SofoAnySignJQuery.clone( node, true, true ); + + // Keep references to cloned scripts for later restoration + if ( hasScripts ) { + SofoAnySignJQuery.merge( scripts, getAll( node, "script" ) ); + } + } + + callback.call( this[i], node, i ); + } + + if ( hasScripts ) { + doc = scripts[ scripts.length - 1 ].ownerDocument; + + // Reenable scripts + SofoAnySignJQuery.map( scripts, restoreScript ); + + // Evaluate executable scripts on first document insertion + for ( i = 0; i < hasScripts; i++ ) { + node = scripts[ i ]; + if ( rscriptType.test( node.type || "" ) && + !SofoAnySignJQuery._data( node, "globalEval" ) && SofoAnySignJQuery.contains( doc, node ) ) { + + if ( node.src ) { + // Optional AJAX dependency, but won't run scripts if not present + if ( SofoAnySignJQuery._evalUrl ) { + SofoAnySignJQuery._evalUrl( node.src ); + } + } else { + SofoAnySignJQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); + } + } + } + } + + // Fix #11809: Avoid leaking memory + fragment = first = null; + } + } + + return this; + } +}); + +SofoAnySignJQuery.each({ + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" +}, function( name, original ) { + SofoAnySignJQuery.fn[ name ] = function( selector ) { + var elems, + i = 0, + ret = [], + insert = SofoAnySignJQuery( selector ), + last = insert.length - 1; + + for ( ; i <= last; i++ ) { + elems = i === last ? this : this.clone(true); + SofoAnySignJQuery( insert[i] )[ original ]( elems ); + + // Modern browsers can apply SofoAnySignJQuery collections as arrays, but oldIE needs a .get() + push.apply( ret, elems.get() ); + } + + return this.pushStack( ret ); + }; +}); + + +var iframe, + elemdisplay = {}; + +/** + * Retrieve the actual display of a element + * @param {String} name nodeName of the element + * @param {Object} doc Document object + */ +// Called only from within defaultDisplay +function actualDisplay( name, doc ) { + var style, + elem = SofoAnySignJQuery( doc.createElement( name ) ).appendTo( doc.body ), + + // getDefaultComputedStyle might be reliably used only on attached element + display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? + + // Use of this method is a temporary fix (more like optmization) until something better comes along, + // since it was removed from specification and supported only in FF + style.display : SofoAnySignJQuery.css( elem[ 0 ], "display" ); + + // We don't have any data stored on the element, + // so use "detach" method as fast way to get rid of the element + elem.detach(); + + return display; +} + +/** + * Try to determine the default display value of an element + * @param {String} nodeName + */ +function defaultDisplay( nodeName ) { + var doc = document, + display = elemdisplay[ nodeName ]; + + if ( !display ) { + display = actualDisplay( nodeName, doc ); + + // If the simple way fails, read from inside an iframe + if ( display === "none" || !display ) { + + // Use the already-created iframe if possible + iframe = (iframe || SofoAnySignJQuery( "