Interface ISecureJsonSerializer
- Namespace
- Stratara.Abstractions.Security
- Assembly
- Stratara.Abstractions.dll
JSON serializer that automatically encrypts properties marked with
EncryptDataAttribute using a key resolved from IKeyStore for
the supplied tenant + user scope.
public interface ISecureJsonSerializer
- Extension Methods
Methods
DeserializeAsync(string, Type, Guid?, Guid?, CancellationToken)
Reflection-based variant of DeserializeAsync<T>(string, Guid?, Guid?, CancellationToken).
Task<object?> DeserializeAsync(string json, Type returnType, Guid? tenantId = null, Guid? userId = null, CancellationToken cancellationToken = default)
Parameters
jsonstringreturnTypeTypetenantIdGuid?userIdGuid?cancellationTokenCancellationToken
Returns
DeserializeAsync<T>(string, Guid?, Guid?, CancellationToken)
Deserialise json, decrypting any encrypted properties for the given scope.
Task<T?> DeserializeAsync<T>(string json, Guid? tenantId = null, Guid? userId = null, CancellationToken cancellationToken = default)
Parameters
jsonstringtenantIdGuid?userIdGuid?cancellationTokenCancellationToken
Returns
- Task<T>
Type Parameters
T
SerializeAsync(object, Guid?, Guid?, CancellationToken)
Reflection-based variant of SerializeAsync<T>(T, Guid?, Guid?, CancellationToken).
Task<string> SerializeAsync(object obj, Guid? tenantId = null, Guid? userId = null, CancellationToken cancellationToken = default)
Parameters
objobjecttenantIdGuid?userIdGuid?cancellationTokenCancellationToken
Returns
SerializeAsync<T>(T, Guid?, Guid?, CancellationToken)
Serialise obj to JSON, encrypting properties marked for the given scope.
Task<string> SerializeAsync<T>(T obj, Guid? tenantId = null, Guid? userId = null, CancellationToken cancellationToken = default)
Parameters
objTtenantIdGuid?userIdGuid?cancellationTokenCancellationToken
Returns
Type Parameters
T