Ejemplo n.º 1
0
        private string CreateVerificationCode(EncryptionTypeItem encryptionType, EncryptionModeItem modeItem, bool isEncrypt)
        {
            int intType    = encryptionType.Value;
            int intMode    = modeItem.Value;
            int intVersion = 0;

            switch (intMode)
            {
            case (int)EncryptionMode.AES256V01Hex:
            case (int)EncryptionMode.SHA256V01Hex:
            case (int)EncryptionMode.SHA512V01Hex:
                intVersion = 1;
                break;

            case (int)EncryptionMode.AES256V02Hex:
            case (int)EncryptionMode.SHA256V02Hex:
            case (int)EncryptionMode.SHA512V02Hex:
                intVersion = 2;
                break;

            case (int)EncryptionMode.AES256V04Hex:
            case (int)EncryptionMode.SHA256V04Hex:
            case (int)EncryptionMode.SHA512V04Hex:
                intVersion = 4;
                break;

            case (int)EncryptionMode.AES256V25Hex:
                intVersion = 25;
                break;
            }
            return(CreateVerificationCode(intVersion, intType, isEncrypt));
        }
Ejemplo n.º 2
0
        private void InitEncryptionTypeItems()
        {
            mListEncrytionTypes.Clear();
            EncryptionTypeItem item = new EncryptionTypeItem();

            item.Name       = "Server";
            item.Value      = 0;
            item.IsSelected = false;
            mListEncrytionTypes.Add(item);
            item            = new EncryptionTypeItem();
            item.Name       = "Client";
            item.Value      = 1;
            item.IsSelected = false;
            mListEncrytionTypes.Add(item);
        }