signFile method

  1. @override
Future<SuccessSign> signFile({
  1. required File file,
  2. required Certificate certificate,
  3. required String password,
  4. required CAdESFormat format,
  5. bool isDetached = true,
  6. bool disableOnlineValidation = false,
  7. String? tsaUrl,
  8. String? storageName,
})
override

Подписать файл

Implementation

@override
Future<SuccessSign> signFile({
  required File file,
  required Certificate certificate,
  required String password,
  required CAdESFormat format,
  bool isDetached = true,
  bool disableOnlineValidation = false,
  String? tsaUrl,
  String? storageName,
}) async {
  return callWithHandler(() async {
    String response = await methodChannel.invokeMethod(
      "signFile",
      {
        "path": file.path,
        "alias": certificate.alias,
        "password": password,
        "isDetached": isDetached,
        "disableOnlineValidation": disableOnlineValidation,
        "format": format.name,
        "tsaUrl": tsaUrl,
        "storageName": storageName,
      },
    );
    Map<String, dynamic> map = json.decode(response);
    return SuccessSign.fromMap(map);
  });
}