internal static T DecryptJson <T>(string encryptedJsonBase64, KeyMac key) { try { var json = Opdata01.Decrypt(encryptedJsonBase64, key).ToUtf8(); return(JsonConvert.DeserializeObject <T>(json)); } catch (JsonException e) { throw FormatError($"JSON: Invalid JSON schema for {typeof(T).Name}", e); } }
internal static KeyMac DecryptBase64Key(string encryptedKeyBase64, KeyMac kek) { var raw = Opdata01.Decrypt(encryptedKeyBase64, kek); return(new KeyMac(Crypto.Sha512(raw))); }