Changing the iES Password

This page explains how to change the iES password.

  1. Request authentication and open the pinpad
  2. Wait until the push is received
  3. Proceed with decryption when the push is received
  4. Have the password entered
  5. Proceed with the authentication process
  6. Have the password entered
  7. Have the password confirmed
  8. Proceed with password change
  9. Check if authentication is successful

Password change request

Refer to the reqPush method in the MainActivity.java included in the sample app.

    private void reqPush(final String used_type, String signData) {
        String cus_id = mEtCusId.getText().toString();
        //String cert_no = mEtCertNo.getText().toString();
        String add_cus_id = mEtAddCusId.getText().toString();

        SPinManager.getInstance().reqPush(this, used_type, cus_id,  add_cus_id, signData);
    }

The signData parameter is a value added during the electronic signature process. Add the content to the electronic signature in the string format. The used_type parameter refers to the type used. Set the type as specified in the table below.

Used Type Code
Log In 2
Change Password 4
Deregistration 5
Push Token Update 6
Registration for Bio Authentication 8
Bio Authentication 9
Deregistration for Bio Authentication 10
public void reqPush(final Context ctx, final String used_type, final String cus_id, final String add_cus_id, final String signData) {
        OneShotPadListener<DataResponse> l = new OneShotPadListener<DataResponse>() {
            @Override
            public void onResult(DataResponse res) {
                BaseResponse.printLog(res);
                showToast(ctx, res);
                // 결과 값 반환
                if (res.code.equals(BaseResponse.CD_OK)) {
                    startPushTimeout(ctx, cus_id); // 푸시 타임아웃 시작
                    if (used_type == OneShotPadManager.USED_TYPE_BIO_AUTH) {
                        showBioAuthPinpadDialog(ctx, add_cus_id, cus_id, signData);
                    } else {
                        showAuthPinpadDialog(ctx, add_cus_id, cus_id, signData);
                    }
                } else if (res.code.equals(BaseResponse.CD_PUSH_TOKEN)) {
                    initGcm(ctx, true);
                }
            }
        };
        OneShotPadManager.getInstance().reqPushEx(ctx, used_type, cus_id, add_cus_id, l);
    }

The reqPush method in the SPinManager now requests push, displays the pinpad, and waits until the push is received.

Password change

Authentication completion check

When the push is received and input is made in the pinpad, complete the authentication using the reqAuthPinPad method in the SPinManager.

private void reqAuthPinPad(final Context ctx, String pwd, String add_cus_id, final String cus_id, final String signData) {
        OneShotPadListener<DataResponse> l = new OneShotPadListener<DataResponse>() {
            @Override
            public void onResult(final DataResponse res) {
                BaseResponse.printLog(res);
                showToast(ctx, res);
                if (res.code.equals(BaseResponse.CD_OK)) {
                    if (!OneShotPadManager.USED_TYPE_CLOSE.equals(mPushInfo.used_type)) { // 해지 요청이 아닌 경우
                        if (true/*certSign(res.cert, res.cert_pwd)*/) { // Sign..
                            Log.d(TAG, "Sign 성공!!");
                            if (OneShotPadManager.USED_TYPE_CHANGE_PWD.equals(mPushInfo.used_type)) { // 비밀번호 변경
                                try {
                                    showChangePwdPinpadDialog(ctx, new String(res.cert_pwd.getData()), cus_id, mPushInfo, res.sign, res.sign_text);
                                } catch (KSException e) {
                                    e.printStackTrace();
                                }
                            } else {
                                SpVerifyListener<SpVerifyResponse> l = new SpVerifyListener<SpVerifyResponse>() {
                                    @Override
                                    public void onResult(SpVerifyResponse sres) {
                                        if (sres.resultData.getCode().equals(BaseResponse.CD_OK)) {
                                            //검증 성공
                                            //Toast.makeText(ctx,"검증 성공",Toast.LENGTH_LONG).show();
                                            // 비밀번호 변경
                                            if (OneShotPadManager.USED_TYPE_CHANGE_PWD.equals(mPushInfo.used_type)) { // 비밀번호 변경
                                                try {
                                                    showChangePwdPinpadDialog(ctx, new String(res.cert_pwd.getData()), cus_id, mPushInfo, res.sign, res.sign_text);
                                                } catch (KSException e) {
                                                    e.printStackTrace();
                                                }
                                            } else {

                                            }
                                        }

                                        mPushInfo = null;
                                        mTempPwd = null;
                                        mTempAddCusId = null;
                                        mSignData = null;
                                        mCus_id = null;
                                    }
                                };
                                SpVerify.getInstance(ctx).reqVerify("", res.cus_id, res.sign, res.sign_text, mPushInfo.auth_token, l);
                            }

                        } else {
                            Log.e(TAG, "Sign 실패..");
                        }
                    }
                }

            }
        };
        if (mPushInfo == null) { // 푸시가 아직 도착하지 않음
            if (mIsPushTimeout) { // 푸시 타임아웃이 종료되기 전..
                showPushProgressDialog(ctx, pwd, add_cus_id, cus_id, signData);
            } else {
                Toast.makeText(ctx, "간편인증 응답 실패.", Toast.LENGTH_SHORT).show();
            }
        } else {
            OneShotPadManager.getInstance().reqAuthPinPadEx(ctx, pwd, mPushInfo, add_cus_id, cus_id, signData, l);
        }
    }

When the used type is Change Password, the pinpad is displayed using the showChangePwdPinpadDialog method in the SPinManager to receive the input of the new password.

Saving the new password

Once the user’s input of the new password is complete, save the password using the reqChangePwd method in the SPinManager.

private void reqChangePwd(final Context ctx, String pwd, String cus_id, final PushInfo push_info, String sign, String sign_text) {
        OneShotPadListener<DataResponse> l = new OneShotPadListener<DataResponse>() {
            @Override
            public void onResult(DataResponse res) {
                // 암호 확인 (테스트)
                checkCertPwd(res.cert, res.cert_pwd);
                // 결과 값 반환
                BaseResponse.printLog(res);
                showToast(ctx, res);
                if (res.sign != null) {
                    SpVerifyListener<SpVerifyResponse> l = new SpVerifyListener<SpVerifyResponse>() {
                        @Override
                        public void onResult(SpVerifyResponse sres) {
                            if (sres.resultData.getCode().equals(BaseResponse.CD_OK)) {
                                //검증 성공
                                Toast.makeText(ctx, "검증 성공", Toast.LENGTH_LONG).show();
                            }
                        }
                    };
                    SpVerify.getInstance(ctx).reqVerify("", res.cus_id, res.sign, res.sign_text, push_info.auth_token, l);
                }

            }
        };
        OneShotPadManager.getInstance().reqChangePwdEx(ctx, pwd,  cus_id, push_info, sign, sign_text, l);
    }
Previous
Next