public static CryptoKeyType Create(CryptoKeyTypeEnum v)
 {
     return(new CryptoKeyType
     {
         InnerValue = v
     });
 }
 public static CryptoKeyType Create(CryptoKeyTypeEnum v)
 {
     return new CryptoKeyType {
       InnerValue = v
     };
 }
Beispiel #3
0
        private static string EncryptHelper(string plainTextData, CryptoKeyTypeEnum keyType, long userId)
        {
            //fetch the CryptoKeys
            string encryptedCryptoKey = string.Empty; //retrieve from stored location

            switch (keyType)
            {
                case CryptoKeyTypeEnum.CRYPTO_KEY_FOR_CC:
                    encryptedCryptoKey = string.Empty; //retrieve from stored location
                    break;
                case CryptoKeyTypeEnum.CRYPTO_KEY_FOR_CUSTOMER_DATA:
                    encryptedCryptoKey = string.Empty; //retrieve from stored location
                    break;
                case CryptoKeyTypeEnum.CRYPTO_KEY_FOR_AUTH_CREDENTIALS:
                    encryptedCryptoKey = string.Empty; //retrieve from stored location
                    break;
                default:
                    throw new ArgumentException("Unknown Key Type : " + keyType.ToString());
            }

            string masterKey = string.Empty; //retrieve from stored location
            return EncryptUsingMasterKey(plainTextData, encryptedCryptoKey, masterKey, userId);
        }