deserializeAnonymousEncryptionSession method
Deserialize a serialized session. For advanced use.
serializedSession
- The serialized encryption session to deserialize.
Returns the deserialized SealdAnonymousEncryptionSession instance.
Implementation
SealdAnonymousEncryptionSession deserializeAnonymousEncryptionSession(
String serializedSession) {
if (_closed) {
throw SealdException(
code: "INSTANCE_CLOSED",
id: "FLUTTER_INSTANCE_CLOSED",
description: "Instance already closed.");
}
final Pointer<Utf8> nativeSerializedSession =
serializedSession.toNativeUtf8();
final Pointer<Pointer<NativeSealdAnonymousEncryptionSession>> nativeResult =
calloc<Pointer<NativeSealdAnonymousEncryptionSession>>();
final Pointer<Pointer<NativeSealdError>> err =
calloc<Pointer<NativeSealdError>>();
final int resultCode =
_bindings.SealdAnonymousSdk_DeserializeAnonymousEncryptionSession(
_ptr.pointer(), nativeSerializedSession, nativeResult, err);
calloc.free(nativeSerializedSession);
if (resultCode != 0) {
calloc.free(nativeResult);
throw SealdException._fromCPtr(err);
} else {
SealdAnonymousEncryptionSession result =
SealdAnonymousEncryptionSession._fromC(nativeResult.value);
calloc.free(nativeResult);
calloc.free(err);
return result;
}
}