Esempio n. 1
0
        protected virtual bool CalcMacByPinkeySign(byte[] macBytes, byte[] MAC)
        {
            bool ret = false;

            ret = CalcMac_CBC_X99(this, macBytes, KeyManager.GetEnPinKey(mSectionName), KeyManager.GetDePinKey(mSectionName), AlgorithmType.X99, MAC);
            return(ret);
        }
Esempio n. 2
0
        protected virtual bool CalcMacByPinkey(byte[] macBytes, byte[] MAC)
        {
            bool ret = false;

            switch (AlType)
            {
            case AlgorithmType.ECB:
                ret = CalcMac_ECB(this, macBytes, KeyManager.GetEnPinKey(mSectionName), KeyManager.GetDePinKey(mSectionName), MAC);
                break;

            case AlgorithmType.CBC:
            case AlgorithmType.X99:
                ret = CalcMac_CBC_X99(this, macBytes, KeyManager.GetEnPinKey(mSectionName), KeyManager.GetDePinKey(mSectionName), AlType, MAC);
                break;
            }
            return(ret);
        }
Esempio n. 3
0
        protected override void OnEnter()
        {
            mCount   = 0;
            Password = "";
            if (Esam.IsUse)
            {
                mPinKey = KeyManager.GetEnPinKey(mSectionName);
            }
            else
            {
                mPinKey = KeyManager.GetDePinKey(mSectionName);
            }

            if (Esam.IsUse)
            {
                Esam.SetWorkmode(Esam.WorkMode.Encrypt);
                Esam.SetKeyLen(mKeyLength);
                Esam.SetMasterkeyNo(mKeyIndex);
                SendMessage(INPUT_PASS);
            }
        }