set_recovery_key_request.dart 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // @dart=2.9
  2. import 'dart:convert';
  3. class SetRecoveryKeyRequest {
  4. final String masterKeyEncryptedWithRecoveryKey;
  5. final String masterKeyDecryptionNonce;
  6. final String recoveryKeyEncryptedWithMasterKey;
  7. final String recoveryKeyDecryptionNonce;
  8. SetRecoveryKeyRequest(
  9. this.masterKeyEncryptedWithRecoveryKey,
  10. this.masterKeyDecryptionNonce,
  11. this.recoveryKeyEncryptedWithMasterKey,
  12. this.recoveryKeyDecryptionNonce,
  13. );
  14. Map<String, dynamic> toMap() {
  15. return {
  16. 'masterKeyEncryptedWithRecoveryKey': masterKeyEncryptedWithRecoveryKey,
  17. 'masterKeyDecryptionNonce': masterKeyDecryptionNonce,
  18. 'recoveryKeyEncryptedWithMasterKey': recoveryKeyEncryptedWithMasterKey,
  19. 'recoveryKeyDecryptionNonce': recoveryKeyDecryptionNonce,
  20. };
  21. }
  22. factory SetRecoveryKeyRequest.fromMap(Map<String, dynamic> map) {
  23. return SetRecoveryKeyRequest(
  24. map['masterKeyEncryptedWithRecoveryKey'],
  25. map['masterKeyDecryptionNonce'],
  26. map['recoveryKeyEncryptedWithMasterKey'],
  27. map['recoveryKeyDecryptionNonce'],
  28. );
  29. }
  30. String toJson() => json.encode(toMap());
  31. factory SetRecoveryKeyRequest.fromJson(String source) =>
  32. SetRecoveryKeyRequest.fromMap(json.decode(source));
  33. }