account work

This commit is contained in:
Christien Rioux 2023-07-16 21:41:40 -04:00
parent f44fdb8eeb
commit 90fc2e5f85
9 changed files with 422 additions and 25 deletions

View file

@ -25,6 +25,9 @@ mixin _$LocalAccount {
throw _privateConstructorUsedError; // The encrypted identity secret that goes with the identityPublicKey
@Uint8ListJsonConverter()
Uint8List get identitySecretKeyBytes =>
throw _privateConstructorUsedError; // The salt for the identity secret key encryption
@Uint8ListJsonConverter()
Uint8List get identitySecretSaltBytes =>
throw _privateConstructorUsedError; // The kind of encryption input used on the account
EncryptionKeyType get encryptionKeyType =>
throw _privateConstructorUsedError; // If account is not hidden, password can be retrieved via
@ -48,6 +51,7 @@ abstract class $LocalAccountCopyWith<$Res> {
$Res call(
{IdentityMaster identityMaster,
@Uint8ListJsonConverter() Uint8List identitySecretKeyBytes,
@Uint8ListJsonConverter() Uint8List identitySecretSaltBytes,
EncryptionKeyType encryptionKeyType,
bool biometricsEnabled,
bool hiddenAccount});
@ -70,6 +74,7 @@ class _$LocalAccountCopyWithImpl<$Res, $Val extends LocalAccount>
$Res call({
Object? identityMaster = null,
Object? identitySecretKeyBytes = null,
Object? identitySecretSaltBytes = null,
Object? encryptionKeyType = null,
Object? biometricsEnabled = null,
Object? hiddenAccount = null,
@ -83,6 +88,10 @@ class _$LocalAccountCopyWithImpl<$Res, $Val extends LocalAccount>
? _value.identitySecretKeyBytes
: identitySecretKeyBytes // ignore: cast_nullable_to_non_nullable
as Uint8List,
identitySecretSaltBytes: null == identitySecretSaltBytes
? _value.identitySecretSaltBytes
: identitySecretSaltBytes // ignore: cast_nullable_to_non_nullable
as Uint8List,
encryptionKeyType: null == encryptionKeyType
? _value.encryptionKeyType
: encryptionKeyType // ignore: cast_nullable_to_non_nullable
@ -118,6 +127,7 @@ abstract class _$$_LocalAccountCopyWith<$Res>
$Res call(
{IdentityMaster identityMaster,
@Uint8ListJsonConverter() Uint8List identitySecretKeyBytes,
@Uint8ListJsonConverter() Uint8List identitySecretSaltBytes,
EncryptionKeyType encryptionKeyType,
bool biometricsEnabled,
bool hiddenAccount});
@ -139,6 +149,7 @@ class __$$_LocalAccountCopyWithImpl<$Res>
$Res call({
Object? identityMaster = null,
Object? identitySecretKeyBytes = null,
Object? identitySecretSaltBytes = null,
Object? encryptionKeyType = null,
Object? biometricsEnabled = null,
Object? hiddenAccount = null,
@ -152,6 +163,10 @@ class __$$_LocalAccountCopyWithImpl<$Res>
? _value.identitySecretKeyBytes
: identitySecretKeyBytes // ignore: cast_nullable_to_non_nullable
as Uint8List,
identitySecretSaltBytes: null == identitySecretSaltBytes
? _value.identitySecretSaltBytes
: identitySecretSaltBytes // ignore: cast_nullable_to_non_nullable
as Uint8List,
encryptionKeyType: null == encryptionKeyType
? _value.encryptionKeyType
: encryptionKeyType // ignore: cast_nullable_to_non_nullable
@ -174,6 +189,7 @@ class _$_LocalAccount implements _LocalAccount {
const _$_LocalAccount(
{required this.identityMaster,
@Uint8ListJsonConverter() required this.identitySecretKeyBytes,
@Uint8ListJsonConverter() required this.identitySecretSaltBytes,
required this.encryptionKeyType,
required this.biometricsEnabled,
required this.hiddenAccount});
@ -188,6 +204,10 @@ class _$_LocalAccount implements _LocalAccount {
@override
@Uint8ListJsonConverter()
final Uint8List identitySecretKeyBytes;
// The salt for the identity secret key encryption
@override
@Uint8ListJsonConverter()
final Uint8List identitySecretSaltBytes;
// The kind of encryption input used on the account
@override
final EncryptionKeyType encryptionKeyType;
@ -201,7 +221,7 @@ class _$_LocalAccount implements _LocalAccount {
@override
String toString() {
return 'LocalAccount(identityMaster: $identityMaster, identitySecretKeyBytes: $identitySecretKeyBytes, encryptionKeyType: $encryptionKeyType, biometricsEnabled: $biometricsEnabled, hiddenAccount: $hiddenAccount)';
return 'LocalAccount(identityMaster: $identityMaster, identitySecretKeyBytes: $identitySecretKeyBytes, identitySecretSaltBytes: $identitySecretSaltBytes, encryptionKeyType: $encryptionKeyType, biometricsEnabled: $biometricsEnabled, hiddenAccount: $hiddenAccount)';
}
@override
@ -213,6 +233,8 @@ class _$_LocalAccount implements _LocalAccount {
other.identityMaster == identityMaster) &&
const DeepCollectionEquality()
.equals(other.identitySecretKeyBytes, identitySecretKeyBytes) &&
const DeepCollectionEquality().equals(
other.identitySecretSaltBytes, identitySecretSaltBytes) &&
(identical(other.encryptionKeyType, encryptionKeyType) ||
other.encryptionKeyType == encryptionKeyType) &&
(identical(other.biometricsEnabled, biometricsEnabled) ||
@ -227,6 +249,7 @@ class _$_LocalAccount implements _LocalAccount {
runtimeType,
identityMaster,
const DeepCollectionEquality().hash(identitySecretKeyBytes),
const DeepCollectionEquality().hash(identitySecretSaltBytes),
encryptionKeyType,
biometricsEnabled,
hiddenAccount);
@ -249,6 +272,8 @@ abstract class _LocalAccount implements LocalAccount {
const factory _LocalAccount(
{required final IdentityMaster identityMaster,
@Uint8ListJsonConverter() required final Uint8List identitySecretKeyBytes,
@Uint8ListJsonConverter()
required final Uint8List identitySecretSaltBytes,
required final EncryptionKeyType encryptionKeyType,
required final bool biometricsEnabled,
required final bool hiddenAccount}) = _$_LocalAccount;
@ -261,6 +286,9 @@ abstract class _LocalAccount implements LocalAccount {
@override // The encrypted identity secret that goes with the identityPublicKey
@Uint8ListJsonConverter()
Uint8List get identitySecretKeyBytes;
@override // The salt for the identity secret key encryption
@Uint8ListJsonConverter()
Uint8List get identitySecretSaltBytes;
@override // The kind of encryption input used on the account
EncryptionKeyType get encryptionKeyType;
@override // If account is not hidden, password can be retrieved via