public T FromCipherText(string cipherText, JsonSerializer serializer = null)
        {
            var protectedBytes   = Convert.FromBase64String(cipherText);
            var unprotectedBytes = _dataProtector.Unprotect(protectedBytes);

            return(_byteConverter.FromBytes(unprotectedBytes));
        }
Esempio n. 2
0
        public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
        {
            var bytes = ReadToBytes(ref reader, typeToConvert, options);

            return(_byteConverter.FromBytes(bytes));
        }