├── .editorconfig ├── .gitattributes ├── .github ├── dependabot.yml └── workflows │ ├── ci-build.yml │ └── release.yml ├── .gitignore ├── LICENSE ├── README.md ├── src ├── ApiGeneratorGlobalSuppressions.cs ├── Directory.Build.props ├── Directory.build.targets ├── GITSMimeSign.Tests │ ├── GitSMimeSign.Tests.csproj │ └── SignVerifyTests.cs ├── GITSMimeSign.sln ├── GITSMimeSign │ ├── Actions │ │ ├── ListKeysAction.cs │ │ ├── SignAction.cs │ │ └── VerifyAction.cs │ ├── Config │ │ └── SignConfig.cs │ ├── GitSMimeSign.csproj │ ├── Helpers │ │ ├── CertificateHelper.cs │ │ ├── FileSystemStreamHelper.cs │ │ ├── GpgOutputHelper.cs │ │ ├── InfoOutputHelper.cs │ │ ├── KeyOutputHelper.cs │ │ └── PemHelper.cs │ ├── Options.cs │ ├── Program.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ └── Resources.resx │ ├── SignClientException.cs │ └── Timestamper │ │ ├── HttpTimeStamper.cs │ │ └── ITimeStamper.cs └── stylecop.json └── version.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Default settings: 7 | # A newline ending every file 8 | # Use 4 spaces as indentation 9 | [*] 10 | insert_final_newline = true 11 | indent_style = space 12 | indent_size = 4 13 | dotnet_diagnostic.CA1027.severity=error 14 | dotnet_diagnostic.CA1062.severity=error 15 | dotnet_diagnostic.CA1064.severity=error 16 | dotnet_diagnostic.CA1066.severity=error 17 | dotnet_diagnostic.CA1067.severity=error 18 | dotnet_diagnostic.CA1068.severity=error 19 | dotnet_diagnostic.CA1069.severity=warning 20 | dotnet_diagnostic.CA2013.severity=error 21 | dotnet_diagnostic.CA1802.severity=error 22 | dotnet_diagnostic.CA1813.severity=error 23 | dotnet_diagnostic.CA1814.severity=error 24 | dotnet_diagnostic.CA1815.severity=error 25 | dotnet_diagnostic.CA1822.severity=error 26 | dotnet_diagnostic.CA1827.severity=error 27 | dotnet_diagnostic.CA1828.severity=error 28 | dotnet_diagnostic.CA1826.severity=error 29 | dotnet_diagnostic.CA1829.severity=error 30 | dotnet_diagnostic.CA1830.severity=error 31 | dotnet_diagnostic.CA1831.severity=error 32 | dotnet_diagnostic.CA1832.severity=error 33 | dotnet_diagnostic.CA1833.severity=error 34 | dotnet_diagnostic.CA1834.severity=error 35 | dotnet_diagnostic.CA1835.severity=error 36 | dotnet_diagnostic.CA1836.severity=error 37 | dotnet_diagnostic.CA1837.severity=error 38 | dotnet_diagnostic.CA1838.severity=error 39 | dotnet_diagnostic.CA2015.severity=error 40 | dotnet_diagnostic.CA2012.severity=error 41 | dotnet_diagnostic.CA2011.severity=error 42 | dotnet_diagnostic.CA2009.severity=error 43 | dotnet_diagnostic.CA2008.severity=error 44 | dotnet_diagnostic.CA2007.severity=warning 45 | dotnet_diagnostic.CA2000.severity=suggestion 46 | 47 | [project.json] 48 | indent_size = 2 49 | 50 | # C# files 51 | [*.cs] 52 | # New line preferences 53 | csharp_new_line_before_open_brace = all 54 | csharp_new_line_before_else = true 55 | csharp_new_line_before_catch = true 56 | csharp_new_line_before_finally = true 57 | csharp_new_line_before_members_in_object_initializers = true 58 | csharp_new_line_before_members_in_anonymous_types = true 59 | csharp_new_line_between_query_expression_clauses = true 60 | 61 | # Indentation preferences 62 | csharp_indent_block_contents = true 63 | csharp_indent_braces = false 64 | csharp_indent_case_contents = true 65 | csharp_indent_case_contents_when_block = true 66 | csharp_indent_switch_labels = true 67 | csharp_indent_labels = one_less_than_current 68 | 69 | # Modifier preferences 70 | csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion 71 | 72 | # avoid this. unless absolutely necessary 73 | dotnet_style_qualification_for_field = false:suggestion 74 | dotnet_style_qualification_for_property = false:suggestion 75 | dotnet_style_qualification_for_method = false:suggestion 76 | dotnet_style_qualification_for_event = false:suggestion 77 | 78 | # only use var when it's obvious what the variable type is 79 | csharp_style_var_for_built_in_types = true:suggestion 80 | csharp_style_var_when_type_is_apparent = true:suggestion 81 | csharp_style_var_elsewhere = true:suggestion 82 | 83 | # prefer C# premade types. 84 | dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion 85 | dotnet_style_predefined_type_for_member_access = true:suggestion 86 | 87 | # name all constant fields using PascalCase 88 | dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion 89 | dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields 90 | dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style 91 | dotnet_naming_symbols.constant_fields.applicable_kinds = field 92 | dotnet_naming_symbols.constant_fields.required_modifiers = const 93 | dotnet_naming_style.pascal_case_style.capitalization = pascal_case 94 | 95 | # static fields should have s_ prefix 96 | dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion 97 | dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields 98 | dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style 99 | dotnet_naming_symbols.static_fields.applicable_kinds = field 100 | dotnet_naming_symbols.static_fields.required_modifiers = static 101 | dotnet_naming_symbols.static_fields.applicable_accessibilities = private, internal, private_protected 102 | dotnet_naming_style.static_prefix_style.required_prefix = s_ 103 | dotnet_naming_style.static_prefix_style.capitalization = camel_case 104 | 105 | # internal and private fields should be _camelCase 106 | dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion 107 | dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields 108 | dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style 109 | dotnet_naming_symbols.private_internal_fields.applicable_kinds = field 110 | dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal 111 | dotnet_naming_style.camel_case_underscore_style.required_prefix = _ 112 | dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case 113 | 114 | # Code style defaults 115 | csharp_using_directive_placement = outside_namespace:suggestion 116 | dotnet_sort_system_directives_first = true 117 | csharp_prefer_braces = true:silent 118 | csharp_preserve_single_line_blocks = true:none 119 | csharp_preserve_single_line_statements = false:none 120 | csharp_prefer_static_local_function = true:suggestion 121 | csharp_prefer_simple_using_statement = false:none 122 | csharp_style_prefer_switch_expression = true:suggestion 123 | 124 | # Code quality 125 | dotnet_style_readonly_field = true:suggestion 126 | dotnet_code_quality_unused_parameters = non_public:suggestion 127 | 128 | # Expression-level preferences 129 | dotnet_style_object_initializer = true:suggestion 130 | dotnet_style_collection_initializer = true:suggestion 131 | dotnet_style_explicit_tuple_names = true:suggestion 132 | dotnet_style_coalesce_expression = true:suggestion 133 | dotnet_style_null_propagation = true:suggestion 134 | dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion 135 | dotnet_style_prefer_inferred_tuple_names = true:suggestion 136 | dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion 137 | dotnet_style_prefer_auto_properties = true:suggestion 138 | dotnet_style_prefer_conditional_expression_over_assignment = true:silent 139 | dotnet_style_prefer_conditional_expression_over_return = true:silent 140 | csharp_prefer_simple_default_expression = true:suggestion 141 | 142 | # Expression-bodied members 143 | csharp_style_expression_bodied_methods = true:suggestion 144 | csharp_style_expression_bodied_constructors = true:suggestion 145 | csharp_style_expression_bodied_operators = true:suggestion 146 | csharp_style_expression_bodied_properties = true:suggestion 147 | csharp_style_expression_bodied_indexers = true:suggestion 148 | csharp_style_expression_bodied_accessors = true:suggestion 149 | csharp_style_expression_bodied_lambdas = true:suggestion 150 | csharp_style_expression_bodied_local_functions = true:suggestion 151 | 152 | # Pattern matching 153 | csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion 154 | csharp_style_pattern_matching_over_as_with_null_check = true:suggestion 155 | csharp_style_inlined_variable_declaration = true:suggestion 156 | 157 | # Null checking preferences 158 | csharp_style_throw_expression = true:suggestion 159 | csharp_style_conditional_delegate_call = true:suggestion 160 | 161 | # Other features 162 | csharp_style_prefer_index_operator = false:none 163 | csharp_style_prefer_range_operator = false:none 164 | csharp_style_pattern_local_over_anonymous_function = false:none 165 | 166 | # Space preferences 167 | csharp_space_after_cast = false 168 | csharp_space_after_colon_in_inheritance_clause = true 169 | csharp_space_after_comma = true 170 | csharp_space_after_dot = false 171 | csharp_space_after_keywords_in_control_flow_statements = true 172 | csharp_space_after_semicolon_in_for_statement = true 173 | csharp_space_around_binary_operators = before_and_after 174 | csharp_space_around_declaration_statements = do_not_ignore 175 | csharp_space_before_colon_in_inheritance_clause = true 176 | csharp_space_before_comma = false 177 | csharp_space_before_dot = false 178 | csharp_space_before_open_square_brackets = false 179 | csharp_space_before_semicolon_in_for_statement = false 180 | csharp_space_between_empty_square_brackets = false 181 | csharp_space_between_method_call_empty_parameter_list_parentheses = false 182 | csharp_space_between_method_call_name_and_opening_parenthesis = false 183 | csharp_space_between_method_call_parameter_list_parentheses = false 184 | csharp_space_between_method_declaration_empty_parameter_list_parentheses = false 185 | csharp_space_between_method_declaration_name_and_open_parenthesis = false 186 | csharp_space_between_method_declaration_parameter_list_parentheses = false 187 | csharp_space_between_parentheses = false 188 | csharp_space_between_square_brackets = false 189 | 190 | # analyzers 191 | dotnet_diagnostic.AvoidAsyncVoid.severity = suggestion 192 | 193 | dotnet_diagnostic.CA1000.severity = none 194 | dotnet_diagnostic.CA1001.severity = error 195 | dotnet_diagnostic.CA1009.severity = error 196 | dotnet_diagnostic.CA1016.severity = error 197 | dotnet_diagnostic.CA1030.severity = none 198 | dotnet_diagnostic.CA1031.severity = none 199 | dotnet_diagnostic.CA1033.severity = none 200 | dotnet_diagnostic.CA1036.severity = none 201 | dotnet_diagnostic.CA1049.severity = error 202 | dotnet_diagnostic.CA1056.severity = suggestion 203 | dotnet_diagnostic.CA1060.severity = error 204 | dotnet_diagnostic.CA1061.severity = error 205 | dotnet_diagnostic.CA1063.severity = error 206 | dotnet_diagnostic.CA1065.severity = error 207 | dotnet_diagnostic.CA1301.severity = error 208 | dotnet_diagnostic.CA1303.severity = none 209 | dotnet_diagnostic.CA1308.severity = none 210 | dotnet_diagnostic.CA1400.severity = error 211 | dotnet_diagnostic.CA1401.severity = error 212 | dotnet_diagnostic.CA1403.severity = error 213 | dotnet_diagnostic.CA1404.severity = error 214 | dotnet_diagnostic.CA1405.severity = error 215 | dotnet_diagnostic.CA1410.severity = error 216 | dotnet_diagnostic.CA1415.severity = error 217 | dotnet_diagnostic.CA1507.severity = error 218 | dotnet_diagnostic.CA1710.severity = suggestion 219 | dotnet_diagnostic.CA1724.severity = none 220 | dotnet_diagnostic.CA1810.severity = none 221 | dotnet_diagnostic.CA1821.severity = error 222 | dotnet_diagnostic.CA1900.severity = error 223 | dotnet_diagnostic.CA1901.severity = error 224 | dotnet_diagnostic.CA2000.severity = none 225 | dotnet_diagnostic.CA2002.severity = error 226 | dotnet_diagnostic.CA2007.severity = none 227 | dotnet_diagnostic.CA2100.severity = error 228 | dotnet_diagnostic.CA2101.severity = error 229 | dotnet_diagnostic.CA2108.severity = error 230 | dotnet_diagnostic.CA2111.severity = error 231 | dotnet_diagnostic.CA2112.severity = error 232 | dotnet_diagnostic.CA2114.severity = error 233 | dotnet_diagnostic.CA2116.severity = error 234 | dotnet_diagnostic.CA2117.severity = error 235 | dotnet_diagnostic.CA2122.severity = error 236 | dotnet_diagnostic.CA2123.severity = error 237 | dotnet_diagnostic.CA2124.severity = error 238 | dotnet_diagnostic.CA2126.severity = error 239 | dotnet_diagnostic.CA2131.severity = error 240 | dotnet_diagnostic.CA2132.severity = error 241 | dotnet_diagnostic.CA2133.severity = error 242 | dotnet_diagnostic.CA2134.severity = error 243 | dotnet_diagnostic.CA2137.severity = error 244 | dotnet_diagnostic.CA2138.severity = error 245 | dotnet_diagnostic.CA2140.severity = error 246 | dotnet_diagnostic.CA2141.severity = error 247 | dotnet_diagnostic.CA2146.severity = error 248 | dotnet_diagnostic.CA2147.severity = error 249 | dotnet_diagnostic.CA2149.severity = error 250 | dotnet_diagnostic.CA2200.severity = error 251 | dotnet_diagnostic.CA2202.severity = error 252 | dotnet_diagnostic.CA2207.severity = error 253 | dotnet_diagnostic.CA2212.severity = error 254 | dotnet_diagnostic.CA2213.severity = error 255 | dotnet_diagnostic.CA2214.severity = error 256 | dotnet_diagnostic.CA2216.severity = error 257 | dotnet_diagnostic.CA2220.severity = error 258 | dotnet_diagnostic.CA2229.severity = error 259 | dotnet_diagnostic.CA2231.severity = error 260 | dotnet_diagnostic.CA2232.severity = error 261 | dotnet_diagnostic.CA2235.severity = error 262 | dotnet_diagnostic.CA2236.severity = error 263 | dotnet_diagnostic.CA2237.severity = error 264 | dotnet_diagnostic.CA2238.severity = error 265 | dotnet_diagnostic.CA2240.severity = error 266 | dotnet_diagnostic.CA2241.severity = error 267 | dotnet_diagnostic.CA2242.severity = error 268 | 269 | dotnet_diagnostic.RCS1001.severity = error 270 | dotnet_diagnostic.RCS1018.severity = error 271 | dotnet_diagnostic.RCS1037.severity = error 272 | dotnet_diagnostic.RCS1055.severity = error 273 | dotnet_diagnostic.RCS1062.severity = error 274 | dotnet_diagnostic.RCS1066.severity = error 275 | dotnet_diagnostic.RCS1069.severity = error 276 | dotnet_diagnostic.RCS1071.severity = error 277 | dotnet_diagnostic.RCS1074.severity = error 278 | dotnet_diagnostic.RCS1090.severity = error 279 | dotnet_diagnostic.RCS1138.severity = error 280 | dotnet_diagnostic.RCS1139.severity = error 281 | dotnet_diagnostic.RCS1163.severity = suggestion 282 | dotnet_diagnostic.RCS1168.severity = suggestion 283 | dotnet_diagnostic.RCS1188.severity = error 284 | dotnet_diagnostic.RCS1201.severity = error 285 | dotnet_diagnostic.RCS1207.severity = error 286 | dotnet_diagnostic.RCS1211.severity = error 287 | dotnet_diagnostic.RCS1507.severity = error 288 | 289 | dotnet_diagnostic.SA1000.severity = error 290 | dotnet_diagnostic.SA1001.severity = error 291 | dotnet_diagnostic.SA1002.severity = error 292 | dotnet_diagnostic.SA1003.severity = error 293 | dotnet_diagnostic.SA1004.severity = error 294 | dotnet_diagnostic.SA1005.severity = error 295 | dotnet_diagnostic.SA1006.severity = error 296 | dotnet_diagnostic.SA1007.severity = error 297 | dotnet_diagnostic.SA1008.severity = error 298 | dotnet_diagnostic.SA1009.severity = error 299 | dotnet_diagnostic.SA1010.severity = error 300 | dotnet_diagnostic.SA1011.severity = error 301 | dotnet_diagnostic.SA1012.severity = error 302 | dotnet_diagnostic.SA1013.severity = error 303 | dotnet_diagnostic.SA1014.severity = error 304 | dotnet_diagnostic.SA1015.severity = error 305 | dotnet_diagnostic.SA1016.severity = error 306 | dotnet_diagnostic.SA1017.severity = error 307 | dotnet_diagnostic.SA1018.severity = error 308 | dotnet_diagnostic.SA1019.severity = error 309 | dotnet_diagnostic.SA1020.severity = error 310 | dotnet_diagnostic.SA1021.severity = error 311 | dotnet_diagnostic.SA1022.severity = error 312 | dotnet_diagnostic.SA1023.severity = error 313 | dotnet_diagnostic.SA1024.severity = error 314 | dotnet_diagnostic.SA1025.severity = error 315 | dotnet_diagnostic.SA1026.severity = error 316 | dotnet_diagnostic.SA1027.severity = error 317 | dotnet_diagnostic.SA1028.severity = error 318 | dotnet_diagnostic.SA1100.severity = error 319 | dotnet_diagnostic.SA1101.severity = none 320 | dotnet_diagnostic.SA1102.severity = error 321 | dotnet_diagnostic.SA1103.severity = error 322 | dotnet_diagnostic.SA1104.severity = error 323 | dotnet_diagnostic.SA1105.severity = error 324 | dotnet_diagnostic.SA1106.severity = error 325 | dotnet_diagnostic.SA1107.severity = error 326 | dotnet_diagnostic.SA1108.severity = error 327 | dotnet_diagnostic.SA1110.severity = error 328 | dotnet_diagnostic.SA1111.severity = error 329 | dotnet_diagnostic.SA1112.severity = error 330 | dotnet_diagnostic.SA1113.severity = error 331 | dotnet_diagnostic.SA1114.severity = error 332 | dotnet_diagnostic.SA1115.severity = error 333 | dotnet_diagnostic.SA1116.severity = error 334 | dotnet_diagnostic.SA1117.severity = error 335 | dotnet_diagnostic.SA1118.severity = error 336 | dotnet_diagnostic.SA1119.severity = error 337 | dotnet_diagnostic.SA1120.severity = error 338 | dotnet_diagnostic.SA1121.severity = error 339 | dotnet_diagnostic.SA1122.severity = error 340 | dotnet_diagnostic.SA1123.severity = error 341 | dotnet_diagnostic.SA1124.severity = error 342 | dotnet_diagnostic.SA1125.severity = error 343 | dotnet_diagnostic.SA1127.severity = error 344 | dotnet_diagnostic.SA1128.severity = error 345 | dotnet_diagnostic.SA1129.severity = error 346 | dotnet_diagnostic.SA1130.severity = error 347 | dotnet_diagnostic.SA1131.severity = error 348 | dotnet_diagnostic.SA1132.severity = error 349 | dotnet_diagnostic.SA1133.severity = error 350 | dotnet_diagnostic.SA1134.severity = error 351 | dotnet_diagnostic.SA1135.severity = error 352 | dotnet_diagnostic.SA1136.severity = error 353 | dotnet_diagnostic.SA1137.severity = error 354 | dotnet_diagnostic.SA1139.severity = error 355 | dotnet_diagnostic.SA1200.severity = none 356 | dotnet_diagnostic.SA1201.severity = error 357 | dotnet_diagnostic.SA1202.severity = error 358 | dotnet_diagnostic.SA1203.severity = error 359 | dotnet_diagnostic.SA1204.severity = error 360 | dotnet_diagnostic.SA1205.severity = error 361 | dotnet_diagnostic.SA1206.severity = error 362 | dotnet_diagnostic.SA1207.severity = error 363 | dotnet_diagnostic.SA1208.severity = error 364 | dotnet_diagnostic.SA1209.severity = error 365 | dotnet_diagnostic.SA1210.severity = error 366 | dotnet_diagnostic.SA1211.severity = error 367 | dotnet_diagnostic.SA1212.severity = error 368 | dotnet_diagnostic.SA1213.severity = error 369 | dotnet_diagnostic.SA1214.severity = error 370 | dotnet_diagnostic.SA1216.severity = error 371 | dotnet_diagnostic.SA1217.severity = error 372 | dotnet_diagnostic.SA1300.severity = error 373 | dotnet_diagnostic.SA1302.severity = error 374 | dotnet_diagnostic.SA1303.severity = error 375 | dotnet_diagnostic.SA1304.severity = error 376 | dotnet_diagnostic.SA1306.severity = none 377 | dotnet_diagnostic.SA1307.severity = error 378 | dotnet_diagnostic.SA1308.severity = error 379 | dotnet_diagnostic.SA1309.severity = none 380 | dotnet_diagnostic.SA1310.severity = error 381 | dotnet_diagnostic.SA1311.severity = none 382 | dotnet_diagnostic.SA1312.severity = error 383 | dotnet_diagnostic.SA1313.severity = error 384 | dotnet_diagnostic.SA1314.severity = error 385 | dotnet_diagnostic.SA1316.severity = none 386 | dotnet_diagnostic.SA1400.severity = error 387 | dotnet_diagnostic.SA1401.severity = error 388 | dotnet_diagnostic.SA1402.severity = error 389 | dotnet_diagnostic.SA1403.severity = error 390 | dotnet_diagnostic.SA1404.severity = error 391 | dotnet_diagnostic.SA1405.severity = error 392 | dotnet_diagnostic.SA1406.severity = error 393 | dotnet_diagnostic.SA1407.severity = error 394 | dotnet_diagnostic.SA1408.severity = error 395 | dotnet_diagnostic.SA1410.severity = error 396 | dotnet_diagnostic.SA1411.severity = error 397 | dotnet_diagnostic.SA1413.severity = none 398 | dotnet_diagnostic.SA1500.severity = error 399 | dotnet_diagnostic.SA1501.severity = error 400 | dotnet_diagnostic.SA1502.severity = error 401 | dotnet_diagnostic.SA1503.severity = error 402 | dotnet_diagnostic.SA1504.severity = error 403 | dotnet_diagnostic.SA1505.severity = error 404 | dotnet_diagnostic.SA1506.severity = error 405 | dotnet_diagnostic.SA1507.severity = error 406 | dotnet_diagnostic.SA1508.severity = error 407 | dotnet_diagnostic.SA1509.severity = error 408 | dotnet_diagnostic.SA1510.severity = error 409 | dotnet_diagnostic.SA1511.severity = error 410 | dotnet_diagnostic.SA1512.severity = error 411 | dotnet_diagnostic.SA1513.severity = error 412 | dotnet_diagnostic.SA1514.severity = error 413 | dotnet_diagnostic.SA1515.severity = error 414 | dotnet_diagnostic.SA1516.severity = error 415 | dotnet_diagnostic.SA1517.severity = error 416 | dotnet_diagnostic.SA1518.severity = error 417 | dotnet_diagnostic.SA1519.severity = error 418 | dotnet_diagnostic.SA1520.severity = error 419 | dotnet_diagnostic.SA1600.severity = error 420 | dotnet_diagnostic.SA1601.severity = error 421 | dotnet_diagnostic.SA1602.severity = error 422 | dotnet_diagnostic.SA1604.severity = error 423 | dotnet_diagnostic.SA1605.severity = error 424 | dotnet_diagnostic.SA1606.severity = error 425 | dotnet_diagnostic.SA1607.severity = error 426 | dotnet_diagnostic.SA1608.severity = error 427 | dotnet_diagnostic.SA1610.severity = error 428 | dotnet_diagnostic.SA1611.severity = error 429 | dotnet_diagnostic.SA1612.severity = error 430 | dotnet_diagnostic.SA1613.severity = error 431 | dotnet_diagnostic.SA1614.severity = error 432 | dotnet_diagnostic.SA1615.severity = error 433 | dotnet_diagnostic.SA1616.severity = error 434 | dotnet_diagnostic.SA1617.severity = error 435 | dotnet_diagnostic.SA1618.severity = error 436 | dotnet_diagnostic.SA1619.severity = error 437 | dotnet_diagnostic.SA1620.severity = error 438 | dotnet_diagnostic.SA1621.severity = error 439 | dotnet_diagnostic.SA1622.severity = error 440 | dotnet_diagnostic.SA1623.severity = error 441 | dotnet_diagnostic.SA1624.severity = error 442 | dotnet_diagnostic.SA1625.severity = error 443 | dotnet_diagnostic.SA1626.severity = error 444 | dotnet_diagnostic.SA1627.severity = error 445 | dotnet_diagnostic.SA1629.severity = error 446 | dotnet_diagnostic.SA1633.severity = error 447 | dotnet_diagnostic.SA1634.severity = error 448 | dotnet_diagnostic.SA1635.severity = error 449 | dotnet_diagnostic.SA1636.severity = error 450 | dotnet_diagnostic.SA1637.severity = none 451 | dotnet_diagnostic.SA1638.severity = none 452 | dotnet_diagnostic.SA1640.severity = error 453 | dotnet_diagnostic.SA1641.severity = error 454 | dotnet_diagnostic.SA1642.severity = error 455 | dotnet_diagnostic.SA1643.severity = error 456 | dotnet_diagnostic.SA1649.severity = error 457 | dotnet_diagnostic.SA1651.severity = error 458 | 459 | dotnet_diagnostic.SX1101.severity = error 460 | dotnet_diagnostic.SX1309.severity = error 461 | dotnet_diagnostic.SX1623.severity = none 462 | dotnet_diagnostic.RCS1102.severity=error 463 | dotnet_diagnostic.RCS1166.severity=error 464 | dotnet_diagnostic.RCS1078i.severity=error 465 | dotnet_diagnostic.RCS1248.severity=error 466 | dotnet_diagnostic.RCS1080.severity=error 467 | dotnet_diagnostic.RCS1077.severity=error 468 | dotnet_diagnostic.CA1825.severity=error 469 | dotnet_diagnostic.CA1812.severity=error 470 | dotnet_diagnostic.CA1805.severity=error 471 | dotnet_diagnostic.RCS1197.severity=error 472 | dotnet_diagnostic.RCS1198.severity=error 473 | dotnet_diagnostic.RCS1231.severity=error 474 | dotnet_diagnostic.RCS1235.severity=error 475 | dotnet_diagnostic.RCS1242.severity=error 476 | dotnet_diagnostic.CA2016.severity=warning 477 | dotnet_diagnostic.CA2014.severity=error 478 | dotnet_diagnostic.RCS1010.severity=error 479 | dotnet_diagnostic.RCS1006.severity=error 480 | dotnet_diagnostic.RCS1005.severity=error 481 | dotnet_diagnostic.RCS1020.severity=error 482 | dotnet_diagnostic.RCS1049.severity=warning 483 | dotnet_diagnostic.RCS1058.severity=warning 484 | dotnet_diagnostic.RCS1068.severity=warning 485 | dotnet_diagnostic.RCS1073.severity=warning 486 | dotnet_diagnostic.RCS1084.severity=error 487 | dotnet_diagnostic.RCS1085.severity=error 488 | dotnet_diagnostic.RCS1105.severity=error 489 | dotnet_diagnostic.RCS1112.severity=error 490 | dotnet_diagnostic.RCS1128.severity=error 491 | dotnet_diagnostic.RCS1143.severity=error 492 | dotnet_diagnostic.RCS1171.severity=error 493 | dotnet_diagnostic.RCS1173.severity=error 494 | dotnet_diagnostic.RCS1176.severity=error 495 | dotnet_diagnostic.RCS1177.severity=error 496 | dotnet_diagnostic.RCS1179.severity=error 497 | dotnet_diagnostic.RCS1180.severity=warning 498 | dotnet_diagnostic.RCS1190.severity=error 499 | dotnet_diagnostic.RCS1195.severity=error 500 | dotnet_diagnostic.RCS1214.severity=error 501 | 502 | # C++ Files 503 | [*.{cpp,h,in}] 504 | curly_bracket_next_line = true 505 | indent_brace_style = Allman 506 | 507 | # Xml project files 508 | [*.{csproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}] 509 | indent_size = 2 510 | 511 | # Xml build files 512 | [*.builds] 513 | indent_size = 2 514 | 515 | # Xml files 516 | [*.{xml,stylecop,resx,ruleset}] 517 | indent_size = 2 518 | 519 | # Xml config files 520 | [*.{props,targets,config,nuspec}] 521 | indent_size = 2 522 | 523 | # Shell scripts 524 | [*.sh] 525 | end_of_line = lf 526 | [*.{cmd, bat}] 527 | end_of_line = crlf 528 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Catch all for anything we forgot. Add rules if you get CRLF to LF warnings. 2 | * text=auto 3 | 4 | # Text files that should be normalized to LF in odb. 5 | *.cs text eol=lf diff=csharp 6 | *.xaml text 7 | *.config text 8 | *.c text 9 | *.h text 10 | *.cpp text 11 | *.hpp text 12 | *.sln text 13 | *.csproj text 14 | *.vcxproj text 15 | *.md text 16 | *.tt text 17 | *.sh text 18 | *.ps1 text 19 | *.cmd text 20 | *.bat text 21 | *.markdown text 22 | *.msbuild text 23 | # Binary files that should not be normalized or diffed 24 | *.png binary 25 | *.jpg binary 26 | *.gif binary 27 | *.ico binary 28 | *.rc binary 29 | *.pfx binary 30 | *.snk binary 31 | *.dll binary 32 | *.exe binary 33 | *.lib binary 34 | *.exp binary 35 | *.pdb binary 36 | *.sdf binary 37 | *.7z binary 38 | # Generated file should just use CRLF, it's fiiine 39 | SolutionInfo.cs text eol=crlf diff=csharp 40 | *.mht filter=lfs diff=lfs merge=lfs -text 41 | *.ppam filter=lfs diff=lfs merge=lfs -text 42 | *.wmv filter=lfs diff=lfs merge=lfs -text 43 | *.btif filter=lfs diff=lfs merge=lfs -text 44 | *.fla filter=lfs diff=lfs merge=lfs -text 45 | *.qt filter=lfs diff=lfs merge=lfs -text 46 | *.xlam filter=lfs diff=lfs merge=lfs -text 47 | *.xm filter=lfs diff=lfs merge=lfs -text 48 | *.djvu filter=lfs diff=lfs merge=lfs -text 49 | *.woff filter=lfs diff=lfs merge=lfs -text 50 | *.a filter=lfs diff=lfs merge=lfs -text 51 | *.bak filter=lfs diff=lfs merge=lfs -text 52 | *.lha filter=lfs diff=lfs merge=lfs -text 53 | *.mpg filter=lfs diff=lfs merge=lfs -text 54 | *.xltm filter=lfs diff=lfs merge=lfs -text 55 | *.eol filter=lfs diff=lfs merge=lfs -text 56 | *.ipa filter=lfs diff=lfs merge=lfs -text 57 | *.ttf filter=lfs diff=lfs merge=lfs -text 58 | *.uvm filter=lfs diff=lfs merge=lfs -text 59 | *.cmx filter=lfs diff=lfs merge=lfs -text 60 | *.dng filter=lfs diff=lfs merge=lfs -text 61 | *.xltx filter=lfs diff=lfs merge=lfs -text 62 | *.fli filter=lfs diff=lfs merge=lfs -text 63 | *.wmx filter=lfs diff=lfs merge=lfs -text 64 | *.jxr filter=lfs diff=lfs merge=lfs -text 65 | *.pyv filter=lfs diff=lfs merge=lfs -text 66 | *.s7z filter=lfs diff=lfs merge=lfs -text 67 | *.csv filter=lfs diff=lfs merge=lfs -text 68 | *.pptm filter=lfs diff=lfs merge=lfs -text 69 | *.rz filter=lfs diff=lfs merge=lfs -text 70 | *.wm filter=lfs diff=lfs merge=lfs -text 71 | *.xlsx filter=lfs diff=lfs merge=lfs -text 72 | *.bh filter=lfs diff=lfs merge=lfs -text 73 | *.dat filter=lfs diff=lfs merge=lfs -text 74 | *.mid filter=lfs diff=lfs merge=lfs -text 75 | *.mpga filter=lfs diff=lfs merge=lfs -text 76 | *.ogg filter=lfs diff=lfs merge=lfs -text 77 | *.s3m filter=lfs diff=lfs merge=lfs -text 78 | *.mar filter=lfs diff=lfs merge=lfs -text 79 | *.movie filter=lfs diff=lfs merge=lfs -text 80 | *.pptx filter=lfs diff=lfs merge=lfs -text 81 | *.dll filter=lfs diff=lfs merge=lfs -text 82 | *.docm filter=lfs diff=lfs merge=lfs -text 83 | *.m3u filter=lfs diff=lfs merge=lfs -text 84 | *.mov filter=lfs diff=lfs merge=lfs -text 85 | *.aac filter=lfs diff=lfs merge=lfs -text 86 | *.jar filter=lfs diff=lfs merge=lfs -text 87 | *.midi filter=lfs diff=lfs merge=lfs -text 88 | *.mobi filter=lfs diff=lfs merge=lfs -text 89 | *.potm filter=lfs diff=lfs merge=lfs -text 90 | *.woff2 filter=lfs diff=lfs merge=lfs -text 91 | *.cab filter=lfs diff=lfs merge=lfs -text 92 | *.dmg filter=lfs diff=lfs merge=lfs -text 93 | *.pdf filter=lfs diff=lfs merge=lfs -text 94 | *.war filter=lfs diff=lfs merge=lfs -text 95 | *.bz2 filter=lfs diff=lfs merge=lfs -text 96 | *.icns filter=lfs diff=lfs merge=lfs -text 97 | *.slk filter=lfs diff=lfs merge=lfs -text 98 | *.wbmp filter=lfs diff=lfs merge=lfs -text 99 | *.xpm filter=lfs diff=lfs merge=lfs -text 100 | *.xmind filter=lfs diff=lfs merge=lfs -text 101 | *.3g2 filter=lfs diff=lfs merge=lfs -text 102 | *.m4v filter=lfs diff=lfs merge=lfs -text 103 | *.pic filter=lfs diff=lfs merge=lfs -text 104 | *.uvi filter=lfs diff=lfs merge=lfs -text 105 | *.uvp filter=lfs diff=lfs merge=lfs -text 106 | *.xls filter=lfs diff=lfs merge=lfs -text 107 | *.jpgv filter=lfs diff=lfs merge=lfs -text 108 | *.mka filter=lfs diff=lfs merge=lfs -text 109 | *.swf filter=lfs diff=lfs merge=lfs -text 110 | *.uvs filter=lfs diff=lfs merge=lfs -text 111 | *.wav filter=lfs diff=lfs merge=lfs -text 112 | *.ecelp4800 filter=lfs diff=lfs merge=lfs -text 113 | *.mng filter=lfs diff=lfs merge=lfs -text 114 | *.pps filter=lfs diff=lfs merge=lfs -text 115 | *.whl filter=lfs diff=lfs merge=lfs -text 116 | *.arj filter=lfs diff=lfs merge=lfs -text 117 | *.lzh filter=lfs diff=lfs merge=lfs -text 118 | *.raw filter=lfs diff=lfs merge=lfs -text 119 | *.rlc filter=lfs diff=lfs merge=lfs -text 120 | *.sgi filter=lfs diff=lfs merge=lfs -text 121 | *.tar filter=lfs diff=lfs merge=lfs -text 122 | *.au filter=lfs diff=lfs merge=lfs -text 123 | *.dcm filter=lfs diff=lfs merge=lfs -text 124 | *.GIF filter=lfs diff=lfs merge=lfs -text 125 | *.resources filter=lfs diff=lfs merge=lfs -text 126 | *.txz filter=lfs diff=lfs merge=lfs -text 127 | *.rar filter=lfs diff=lfs merge=lfs -text 128 | *.sil filter=lfs diff=lfs merge=lfs -text 129 | *.bk filter=lfs diff=lfs merge=lfs -text 130 | *.DS_Store filter=lfs diff=lfs merge=lfs -text 131 | *.ief filter=lfs diff=lfs merge=lfs -text 132 | *.JPEG filter=lfs diff=lfs merge=lfs -text 133 | *.pbm filter=lfs diff=lfs merge=lfs -text 134 | *.png filter=lfs diff=lfs merge=lfs -text 135 | *.sketch filter=lfs diff=lfs merge=lfs -text 136 | *.tbz2 filter=lfs diff=lfs merge=lfs -text 137 | *.nef filter=lfs diff=lfs merge=lfs -text 138 | *.oga filter=lfs diff=lfs merge=lfs -text 139 | *.zip filter=lfs diff=lfs merge=lfs -text 140 | *.ecelp7470 filter=lfs diff=lfs merge=lfs -text 141 | *.xlt filter=lfs diff=lfs merge=lfs -text 142 | *.exe filter=lfs diff=lfs merge=lfs -text 143 | *.mp4 filter=lfs diff=lfs merge=lfs -text 144 | *.pnm filter=lfs diff=lfs merge=lfs -text 145 | *.ttc filter=lfs diff=lfs merge=lfs -text 146 | *.wdp filter=lfs diff=lfs merge=lfs -text 147 | *.xbm filter=lfs diff=lfs merge=lfs -text 148 | *.ecelp9600 filter=lfs diff=lfs merge=lfs -text 149 | *.pot filter=lfs diff=lfs merge=lfs -text 150 | *.wvx filter=lfs diff=lfs merge=lfs -text 151 | *.uvu filter=lfs diff=lfs merge=lfs -text 152 | *.asf filter=lfs diff=lfs merge=lfs -text 153 | *.dxf filter=lfs diff=lfs merge=lfs -text 154 | *.flv filter=lfs diff=lfs merge=lfs -text 155 | *.mdi filter=lfs diff=lfs merge=lfs -text 156 | *.pcx filter=lfs diff=lfs merge=lfs -text 157 | *.tiff filter=lfs diff=lfs merge=lfs -text 158 | *.bzip2 filter=lfs diff=lfs merge=lfs -text 159 | *.deb filter=lfs diff=lfs merge=lfs -text 160 | *.graffle filter=lfs diff=lfs merge=lfs -text 161 | *.h261 filter=lfs diff=lfs merge=lfs -text 162 | *.jpeg filter=lfs diff=lfs merge=lfs -text 163 | *.ppm filter=lfs diff=lfs merge=lfs -text 164 | *.tif filter=lfs diff=lfs merge=lfs -text 165 | *.ppt filter=lfs diff=lfs merge=lfs -text 166 | *.fbs filter=lfs diff=lfs merge=lfs -text 167 | *.gzip filter=lfs diff=lfs merge=lfs -text 168 | *.o filter=lfs diff=lfs merge=lfs -text 169 | *.sub filter=lfs diff=lfs merge=lfs -text 170 | *.z filter=lfs diff=lfs merge=lfs -text 171 | *.alz filter=lfs diff=lfs merge=lfs -text 172 | *.BMP filter=lfs diff=lfs merge=lfs -text 173 | *.dotm filter=lfs diff=lfs merge=lfs -text 174 | *.key filter=lfs diff=lfs merge=lfs -text 175 | *.rgb filter=lfs diff=lfs merge=lfs -text 176 | *.f4v filter=lfs diff=lfs merge=lfs -text 177 | *.iso filter=lfs diff=lfs merge=lfs -text 178 | *.ai filter=lfs diff=lfs merge=lfs -text 179 | *.dtshd filter=lfs diff=lfs merge=lfs -text 180 | *.fpx filter=lfs diff=lfs merge=lfs -text 181 | *.shar filter=lfs diff=lfs merge=lfs -text 182 | *.img filter=lfs diff=lfs merge=lfs -text 183 | *.rmf filter=lfs diff=lfs merge=lfs -text 184 | *.xz filter=lfs diff=lfs merge=lfs -text 185 | *.eot filter=lfs diff=lfs merge=lfs -text 186 | *.wma filter=lfs diff=lfs merge=lfs -text 187 | *.cpio filter=lfs diff=lfs merge=lfs -text 188 | *.cr2 filter=lfs diff=lfs merge=lfs -text 189 | *.adp filter=lfs diff=lfs merge=lfs -text 190 | *.mpeg filter=lfs diff=lfs merge=lfs -text 191 | *.npx filter=lfs diff=lfs merge=lfs -text 192 | *.pdb filter=lfs diff=lfs merge=lfs -text 193 | *.PNG filter=lfs diff=lfs merge=lfs -text 194 | *.xwd filter=lfs diff=lfs merge=lfs -text 195 | *.egg filter=lfs diff=lfs merge=lfs -text 196 | *.ppsx filter=lfs diff=lfs merge=lfs -text 197 | *.mp4a filter=lfs diff=lfs merge=lfs -text 198 | *.pages filter=lfs diff=lfs merge=lfs -text 199 | *.baml filter=lfs diff=lfs merge=lfs -text 200 | *.bin filter=lfs diff=lfs merge=lfs -text 201 | *.class filter=lfs diff=lfs merge=lfs -text 202 | *.h264 filter=lfs diff=lfs merge=lfs -text 203 | *.lib filter=lfs diff=lfs merge=lfs -text 204 | *.mmr filter=lfs diff=lfs merge=lfs -text 205 | *.dot filter=lfs diff=lfs merge=lfs -text 206 | *.gif filter=lfs diff=lfs merge=lfs -text 207 | *.JPG filter=lfs diff=lfs merge=lfs -text 208 | *.m4a filter=lfs diff=lfs merge=lfs -text 209 | *.so filter=lfs diff=lfs merge=lfs -text 210 | *.tgz filter=lfs diff=lfs merge=lfs -text 211 | *.thmx filter=lfs diff=lfs merge=lfs -text 212 | *.3ds filter=lfs diff=lfs merge=lfs -text 213 | *.bmp filter=lfs diff=lfs merge=lfs -text 214 | *.ogv filter=lfs diff=lfs merge=lfs -text 215 | *.xif filter=lfs diff=lfs merge=lfs -text 216 | *.aiff filter=lfs diff=lfs merge=lfs -text 217 | *.dts filter=lfs diff=lfs merge=lfs -text 218 | *.rip filter=lfs diff=lfs merge=lfs -text 219 | *.vob filter=lfs diff=lfs merge=lfs -text 220 | *.7z filter=lfs diff=lfs merge=lfs -text 221 | *.fh filter=lfs diff=lfs merge=lfs -text 222 | *.flac filter=lfs diff=lfs merge=lfs -text 223 | *.g3 filter=lfs diff=lfs merge=lfs -text 224 | *.jpm filter=lfs diff=lfs merge=lfs -text 225 | *.ppsm filter=lfs diff=lfs merge=lfs -text 226 | *.potx filter=lfs diff=lfs merge=lfs -text 227 | *.zipx filter=lfs diff=lfs merge=lfs -text 228 | *.dsk filter=lfs diff=lfs merge=lfs -text 229 | *.ico filter=lfs diff=lfs merge=lfs -text 230 | *.ktx filter=lfs diff=lfs merge=lfs -text 231 | *.lz filter=lfs diff=lfs merge=lfs -text 232 | *.numbers filter=lfs diff=lfs merge=lfs -text 233 | *.3gp filter=lfs diff=lfs merge=lfs -text 234 | *.fst filter=lfs diff=lfs merge=lfs -text 235 | *.scpt filter=lfs diff=lfs merge=lfs -text 236 | *.epub filter=lfs diff=lfs merge=lfs -text 237 | *.rmvb filter=lfs diff=lfs merge=lfs -text 238 | *.webm filter=lfs diff=lfs merge=lfs -text 239 | *.docx filter=lfs diff=lfs merge=lfs -text 240 | *.pgm filter=lfs diff=lfs merge=lfs -text 241 | *.pya filter=lfs diff=lfs merge=lfs -text 242 | *.rtf filter=lfs diff=lfs merge=lfs -text 243 | *.smv filter=lfs diff=lfs merge=lfs -text 244 | *.tga filter=lfs diff=lfs merge=lfs -text 245 | *.cur filter=lfs diff=lfs merge=lfs -text 246 | *.dwg filter=lfs diff=lfs merge=lfs -text 247 | *.lvp filter=lfs diff=lfs merge=lfs -text 248 | *.pyo filter=lfs diff=lfs merge=lfs -text 249 | *.apk filter=lfs diff=lfs merge=lfs -text 250 | *.ar filter=lfs diff=lfs merge=lfs -text 251 | *.caf filter=lfs diff=lfs merge=lfs -text 252 | *.doc filter=lfs diff=lfs merge=lfs -text 253 | *.h263 filter=lfs diff=lfs merge=lfs -text 254 | *.xlsm filter=lfs diff=lfs merge=lfs -text 255 | *.mp3 filter=lfs diff=lfs merge=lfs -text 256 | *.mxu filter=lfs diff=lfs merge=lfs -text 257 | *.wax filter=lfs diff=lfs merge=lfs -text 258 | *.gz filter=lfs diff=lfs merge=lfs -text 259 | *.mj2 filter=lfs diff=lfs merge=lfs -text 260 | *.otf filter=lfs diff=lfs merge=lfs -text 261 | *.udf filter=lfs diff=lfs merge=lfs -text 262 | *.aif filter=lfs diff=lfs merge=lfs -text 263 | *.lzma filter=lfs diff=lfs merge=lfs -text 264 | *.pyc filter=lfs diff=lfs merge=lfs -text 265 | *.weba filter=lfs diff=lfs merge=lfs -text 266 | *.webp filter=lfs diff=lfs merge=lfs -text 267 | *.cgm filter=lfs diff=lfs merge=lfs -text 268 | *.mkv filter=lfs diff=lfs merge=lfs -text 269 | *.ppa filter=lfs diff=lfs merge=lfs -text 270 | *.uvh filter=lfs diff=lfs merge=lfs -text 271 | *.xpi filter=lfs diff=lfs merge=lfs -text 272 | *.psd filter=lfs diff=lfs merge=lfs -text 273 | *.xlsb filter=lfs diff=lfs merge=lfs -text 274 | *.tbz filter=lfs diff=lfs merge=lfs -text 275 | *.wim filter=lfs diff=lfs merge=lfs -text 276 | *.ape filter=lfs diff=lfs merge=lfs -text 277 | *.avi filter=lfs diff=lfs merge=lfs -text 278 | *.dex filter=lfs diff=lfs merge=lfs -text 279 | *.dra filter=lfs diff=lfs merge=lfs -text 280 | *.dvb filter=lfs diff=lfs merge=lfs -text 281 | *.jpg filter=lfs diff=lfs merge=lfs -text 282 | *.xla filter=lfs diff=lfs merge=lfs -text 283 | *.fvt filter=lfs diff=lfs merge=lfs -text 284 | *.lzo filter=lfs diff=lfs merge=lfs -text 285 | *.pea filter=lfs diff=lfs merge=lfs -text 286 | *.ras filter=lfs diff=lfs merge=lfs -text 287 | *.tlz filter=lfs diff=lfs merge=lfs -text 288 | *.viv filter=lfs diff=lfs merge=lfs -text 289 | *.winmd filter=lfs diff=lfs merge=lfs -text 290 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: nuget 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | open-pull-requests-limit: 20 8 | - package-ecosystem: "github-actions" 9 | directory: "/" 10 | schedule: 11 | # Check for updates to GitHub Actions every weekday 12 | interval: "daily" 13 | -------------------------------------------------------------------------------- /.github/workflows/ci-build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | 9 | env: 10 | configuration: Release 11 | productNamespacePrefix: "GitSMimeSign" 12 | 13 | jobs: 14 | build: 15 | runs-on: windows-2022 16 | outputs: 17 | nbgv: ${{ steps.nbgv.outputs.SemVer2 }} 18 | steps: 19 | - name: Checkout 20 | uses: actions/checkout@v2.3.4 21 | with: 22 | fetch-depth: 0 23 | lfs: true 24 | 25 | - name: Install .NET Core 26 | uses: actions/setup-dotnet@v1.8.2 27 | with: 28 | dotnet-version: 3.1.x 29 | 30 | - name: Install .NET 5 31 | uses: actions/setup-dotnet@v1.8.2 32 | with: 33 | dotnet-version: 5.0.x 34 | 35 | - name: Install .NET 6 36 | uses: actions/setup-dotnet@v1.8.2 37 | with: 38 | dotnet-version: 6.0.x 39 | include-prerelease: true 40 | 41 | # - name: Update VS2019 42 | # shell: powershell 43 | # run: Start-Process -Wait -PassThru -FilePath "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" -ArgumentList "update --passive --norestart --installpath ""C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise""" 44 | 45 | - name: NBGV 46 | id: nbgv 47 | uses: dotnet/nbgv@master 48 | with: 49 | setAllVars: true 50 | 51 | - name: NuGet Restore 52 | run: dotnet restore 53 | working-directory: src 54 | 55 | - name: Build 56 | run: dotnet build --configuration=${{ env.configuration }} --verbosity=minimal --no-restore 57 | working-directory: src 58 | 59 | - name: Run Unit Tests and Generate Coverage 60 | uses: glennawatson/coverlet-msbuild@v1 61 | with: 62 | project-files: '**/*Tests*.csproj' 63 | no-build: true 64 | exclude-filter: '[${{env.productNamespacePrefix}}.*.Tests.*]*' 65 | include-filter: '[${{env.productNamespacePrefix}}*]*' 66 | output-format: cobertura 67 | output: '../../artifacts/' 68 | configuration: ${{ env.configuration }} 69 | 70 | - name: Pack 71 | run: dotnet pack --configuration=${{ env.configuration }} --verbosity=minimal --no-restore 72 | working-directory: src 73 | 74 | - name: Create NuGet Artifacts 75 | uses: actions/upload-artifact@master 76 | with: 77 | name: nuget 78 | path: '**/*.nupkg' 79 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Build and Release 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | 7 | env: 8 | configuration: Release 9 | productNamespacePrefix: "ReactiveMarbles" 10 | 11 | jobs: 12 | build: 13 | runs-on: windows-2022 14 | environment: 15 | name: release 16 | outputs: 17 | nbgv: ${{ steps.nbgv.outputs.SemVer2 }} 18 | steps: 19 | - name: Checkout 20 | uses: actions/checkout@v2.3.4 21 | with: 22 | fetch-depth: 0 23 | lfs: true 24 | 25 | - name: Install .NET Core 26 | uses: actions/setup-dotnet@v1.8.2 27 | with: 28 | dotnet-version: 3.1.x 29 | 30 | - name: Install .NET 5 31 | uses: actions/setup-dotnet@v1.8.2 32 | with: 33 | dotnet-version: 5.0.x 34 | 35 | - name: Install .NET 6 36 | uses: actions/setup-dotnet@v1.8.2 37 | with: 38 | dotnet-version: 6.0.x 39 | include-prerelease: true 40 | 41 | - name: NBGV 42 | id: nbgv 43 | uses: dotnet/nbgv@master 44 | with: 45 | setAllVars: true 46 | 47 | - name: NuGet Restore 48 | run: dotnet restore 49 | working-directory: src 50 | 51 | - name: Build 52 | run: dotnet build --configuration=${{ env.configuration }} --verbosity=minimal --no-restore 53 | working-directory: src 54 | 55 | - name: Pack 56 | run: dotnet pack --configuration=${{ env.configuration }} --verbosity=minimal --no-restore 57 | working-directory: src 58 | 59 | - uses: nuget/setup-nuget@v1 60 | name: Setup NuGet 61 | 62 | # Decode the base 64 encoded pfx and save the Signing_Certificate 63 | - name: Sign NuGet packages 64 | shell: pwsh 65 | run: | 66 | $pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.SIGNING_CERTIFICATE }}") 67 | [IO.File]::WriteAllBytes("GitHubActionsWorkflow.pfx", $pfx_cert_byte) 68 | $secure_password = ConvertTo-SecureString ${{ secrets.SIGN_CERTIFICATE_PASSWORD }} –asplaintext –force 69 | Import-PfxCertificate -FilePath GitHubActionsWorkflow.pfx -Password $secure_password -CertStoreLocation Cert:\CurrentUser\My 70 | nuget sign -Timestamper http://timestamp.digicert.com -CertificateFingerprint ${{ secrets.SIGN_CERTIFICATE_HASH }} **/*.nupkg 71 | 72 | - name: Changelog 73 | uses: glennawatson/ChangeLog@v1.1 74 | id: changelog 75 | 76 | - name: Create Release 77 | uses: actions/create-release@v1.1.4 78 | env: 79 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token 80 | with: 81 | tag_name: ${{ steps.nbgv.outputs.SemVer2 }} 82 | release_name: ${{ steps.nbgv.outputs.SemVer2 }} 83 | body: | 84 | ${{ steps.changelog.outputs.commitLog }} 85 | 86 | - name: NuGet Push 87 | env: 88 | NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }} 89 | SOURCE_URL: https://api.nuget.org/v3/index.json 90 | run: | 91 | dotnet nuget push -s ${{ env.SOURCE_URL }} -k ${{ env.NUGET_AUTH_TOKEN }} **/*.nupkg 92 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Ll]og/ 33 | [Ll]ogs/ 34 | 35 | # Visual Studio 2015/2017 cache/options directory 36 | .vs/ 37 | # Uncomment if you have tasks that create the project's static files in wwwroot 38 | #wwwroot/ 39 | 40 | # Visual Studio 2017 auto generated files 41 | Generated\ Files/ 42 | 43 | # MSTest test Results 44 | [Tt]est[Rr]esult*/ 45 | [Bb]uild[Ll]og.* 46 | 47 | # NUnit 48 | *.VisualState.xml 49 | TestResult.xml 50 | nunit-*.xml 51 | 52 | # Build Results of an ATL Project 53 | [Dd]ebugPS/ 54 | [Rr]eleasePS/ 55 | dlldata.c 56 | 57 | # Benchmark Results 58 | BenchmarkDotNet.Artifacts/ 59 | 60 | # .NET Core 61 | project.lock.json 62 | project.fragment.lock.json 63 | artifacts/ 64 | 65 | # ASP.NET Scaffolding 66 | ScaffoldingReadMe.txt 67 | 68 | # StyleCop 69 | StyleCopReport.xml 70 | 71 | # Files built by Visual Studio 72 | *_i.c 73 | *_p.c 74 | *_h.h 75 | *.ilk 76 | *.meta 77 | *.obj 78 | *.iobj 79 | *.pch 80 | *.pdb 81 | *.ipdb 82 | *.pgc 83 | *.pgd 84 | *.rsp 85 | *.sbr 86 | *.tlb 87 | *.tli 88 | *.tlh 89 | *.tmp 90 | *.tmp_proj 91 | *_wpftmp.csproj 92 | *.log 93 | *.tlog 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Nuget personal access tokens and Credentials 210 | nuget.config 211 | 212 | # Microsoft Azure Build Output 213 | csx/ 214 | *.build.csdef 215 | 216 | # Microsoft Azure Emulator 217 | ecf/ 218 | rcf/ 219 | 220 | # Windows Store app package directories and files 221 | AppPackages/ 222 | BundleArtifacts/ 223 | Package.StoreAssociation.xml 224 | _pkginfo.txt 225 | *.appx 226 | *.appxbundle 227 | *.appxupload 228 | 229 | # Visual Studio cache files 230 | # files ending in .cache can be ignored 231 | *.[Cc]ache 232 | # but keep track of directories ending in .cache 233 | !?*.[Cc]ache/ 234 | 235 | # Others 236 | ClientBin/ 237 | ~$* 238 | *~ 239 | *.dbmdl 240 | *.dbproj.schemaview 241 | *.jfm 242 | *.pfx 243 | *.publishsettings 244 | orleans.codegen.cs 245 | 246 | # Including strong name files can present a security risk 247 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 248 | #*.snk 249 | 250 | # Since there are multiple workflows, uncomment next line to ignore bower_components 251 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 252 | #bower_components/ 253 | 254 | # RIA/Silverlight projects 255 | Generated_Code/ 256 | 257 | # Backup & report files from converting an old project file 258 | # to a newer Visual Studio version. Backup files are not needed, 259 | # because we have git ;-) 260 | _UpgradeReport_Files/ 261 | Backup*/ 262 | UpgradeLog*.XML 263 | UpgradeLog*.htm 264 | ServiceFabricBackup/ 265 | *.rptproj.bak 266 | 267 | # SQL Server files 268 | *.mdf 269 | *.ldf 270 | *.ndf 271 | 272 | # Business Intelligence projects 273 | *.rdl.data 274 | *.bim.layout 275 | *.bim_*.settings 276 | *.rptproj.rsuser 277 | *- [Bb]ackup.rdl 278 | *- [Bb]ackup ([0-9]).rdl 279 | *- [Bb]ackup ([0-9][0-9]).rdl 280 | 281 | # Microsoft Fakes 282 | FakesAssemblies/ 283 | 284 | # GhostDoc plugin setting file 285 | *.GhostDoc.xml 286 | 287 | # Node.js Tools for Visual Studio 288 | .ntvs_analysis.dat 289 | node_modules/ 290 | 291 | # Visual Studio 6 build log 292 | *.plg 293 | 294 | # Visual Studio 6 workspace options file 295 | *.opt 296 | 297 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 298 | *.vbw 299 | 300 | # Visual Studio LightSwitch build output 301 | **/*.HTMLClient/GeneratedArtifacts 302 | **/*.DesktopClient/GeneratedArtifacts 303 | **/*.DesktopClient/ModelManifest.xml 304 | **/*.Server/GeneratedArtifacts 305 | **/*.Server/ModelManifest.xml 306 | _Pvt_Extensions 307 | 308 | # Paket dependency manager 309 | .paket/paket.exe 310 | paket-files/ 311 | 312 | # FAKE - F# Make 313 | .fake/ 314 | 315 | # CodeRush personal settings 316 | .cr/personal 317 | 318 | # Python Tools for Visual Studio (PTVS) 319 | __pycache__/ 320 | *.pyc 321 | 322 | # Cake - Uncomment if you are using it 323 | # tools/** 324 | # !tools/packages.config 325 | 326 | # Tabs Studio 327 | *.tss 328 | 329 | # Telerik's JustMock configuration file 330 | *.jmconfig 331 | 332 | # BizTalk build output 333 | *.btp.cs 334 | *.btm.cs 335 | *.odx.cs 336 | *.xsd.cs 337 | 338 | # OpenCover UI analysis results 339 | OpenCover/ 340 | 341 | # Azure Stream Analytics local run output 342 | ASALocalRun/ 343 | 344 | # MSBuild Binary and Structured Log 345 | *.binlog 346 | 347 | # NVidia Nsight GPU debugger configuration file 348 | *.nvuser 349 | 350 | # MFractors (Xamarin productivity tool) working folder 351 | .mfractor/ 352 | 353 | # Local History for Visual Studio 354 | .localhistory/ 355 | 356 | # BeatPulse healthcheck temp database 357 | healthchecksdb 358 | 359 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 360 | MigrationBackup/ 361 | 362 | # Ionide (cross platform F# VS Code tools) working folder 363 | .ionide/ 364 | 365 | # Fody - auto-generated XML schema 366 | FodyWeavers.xsd 367 | 368 | # VS Code files for those working on multiple tools 369 | .vscode/* 370 | !.vscode/settings.json 371 | !.vscode/tasks.json 372 | !.vscode/launch.json 373 | !.vscode/extensions.json 374 | *.code-workspace 375 | 376 | # Local History for Visual Studio Code 377 | .history/ 378 | 379 | # Windows Installer files from build outputs 380 | *.cab 381 | *.msi 382 | *.msix 383 | *.msm 384 | *.msp 385 | 386 | # JetBrains Rider 387 | .idea/ 388 | *.sln.iml 389 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Glenn Watson 4 | 5 | All rights reserved. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GitSMimeSign 2 | 3 | A dotnet global tool to sign commits from the GIT program. Supports GPGSM style output. 4 | 5 | It has .net core 3.1, net 5 and net6 output. 6 | 7 | It is based off [SMimeSign](https://github.com/github/smimesign) but wrote this program to interop better with the Yubikey. 8 | 9 | ## How to use 10 | 11 | You need a personal SMIME X.509 certificate from a authorised provider. 12 | 13 | ### Install the global tool 14 | 15 | Install using the dotnet global tool utility 16 | 17 | ```Batchfile 18 | dotnet tool install -g gitsmimesign 19 | ``` 20 | 21 | ### Configure git 22 | 23 | The following is how to install with GIT versions 2.19 or newer. 24 | 25 | #### Configure globally 26 | 27 | ```Batchfile 28 | git config --global gpg.x509.program gitsmimesign 29 | git config --global gpg.format x509 30 | ``` 31 | 32 | If you want to always use sign commits by default set: 33 | 34 | ```Batchfile 35 | git config --global commit.gpgsign true 36 | ``` 37 | 38 | #### Configure for local repository only 39 | 40 | To configure only a local repository to use the `gitsmimesign`. 41 | 42 | ```Batchfile 43 | cd \to\path\of\repository 44 | git config --local gpg.x509.program gitsmimesign 45 | git config --local gpg.format x509 46 | ``` 47 | 48 | If you want to always use sign commits by default set: 49 | 50 | ```Batchfile 51 | git config --local commit.gpgsign true 52 | ``` 53 | 54 | ### Optional: Explictly specify X.509 certificate 55 | 56 | If you have multiple X.509 certificates that match your identiy, or would otherwise like to use an alternate X.509 certificate, git can be configured to be aware of this. 57 | 58 | Start by listing the available keys: 59 | 60 | ```batchfile 61 | gitsmimesign --list-keys 62 | ``` 63 | 64 | Identify the desired X.509 certificate from the list, and note the Certificate ID. 65 | 66 | #### Configure globally 67 | 68 | ```batchfile 69 | git config --global user.signingkey CERTIFICATE-ID-HERE 70 | ``` 71 | 72 | #### Configure for local repository only 73 | 74 | ```batchfile 75 | cd \to\path\of\repository 76 | git config --local user.signingkey CERTIFICATE-ID-HERE 77 | ``` 78 | 79 | ### Recommended: Set time authority URL 80 | 81 | Because `git` does not pass a RFC3161 time stamp authority URL you can set one in the configuration file 82 | 83 | Create a file in your user profile directory called `.gitsmimesignconfig`, add the contents modified with your timestamp authority url: 84 | 85 | ```ini 86 | [Certificate] 87 | TimeAuthorityUrl=http://url.to/timestamp/authority 88 | ``` 89 | 90 | ### Optional: Configure Yubikey 91 | 92 | Export out a PFX file from the X.509 certificate. Make a backup in a safe location of this file, if someone gets it they can pretend to be you. 93 | 94 | #### Windows 95 | 96 | On windows you can use a [Yubikey Mini Smart Driver](https://support.yubico.com/support/solutions/articles/15000006456-yubikey-smart-card-deployment-guide#YubiKey_Minidriver_Installationies8o) but I found the YubiKey manager approach detailed below easier. 97 | 98 | I am assuming a pin policy of "once" per session, and no "touch" policy, there are other [options](https://support.yubico.com/support/solutions/articles/15000012643-yubikey-manager-cli-ykman-user-manual#ykman_piv_import-keyk8p1yl). I am also installing into slot 9c which is the signing slot. 99 | 100 | 1. Install the [YubiKey manager](https://developers.yubico.com/yubikey-manager-qt/). 101 | 1. Open a command line. 102 | 1. Run `cd "%PROGRAMFILES%\Yubico\YubiKey Manager"` 103 | 1. Change your pin from the default (if you haven't already) and change from the default pin 123456. Run `.\ykman piv change-pin -P 123456 -n ` 104 | 1. Run: `.\ykman piv import-key --pin-policy=default 9c C:\path\to\your.pfx` 105 | 1. When prompted, enter the PIN, management key, and password for the PFX. 106 | 1. Run: `.\ykman piv import-certificate 9c C:\path\to\your.pfx` 107 | 1. When prompted, enter the PIN, management key, and password for the PFX. 108 | 1. You may need to logout of your profile if the keys don't show up in SMIMESign below. 109 | 110 | #### Mac 111 | 112 | 1. Install YubiKey Manager 113 | ```bash 114 | brew install ykman 115 | ``` 116 | 1. Change your pin from the default (if you haven't already) and change from the default pin 123456. Run `ykman piv change-pin -P 123456 -n ` 117 | 1. Run: `ykman piv import-key --pin-policy=default 9c /path/to/your.pfx` 118 | 1. When prompted, enter the PIN, management key, and password for the PFX. 119 | 1. Run: `ykman piv import-certificate 9c /path/to/your.pfx` 120 | 1. When prompted, enter the PIN, management key, and password for the PFX. 121 | 1. You may need to logout of your profile if the keys don't show up in SMIMESign below. 122 | 123 | #### Linux Ubuntu 124 | 125 | 1. Install YubiKey manager 126 | ```bash 127 | sudo apt-add-repository ppa:yubico/stable 128 | sudo apt update 129 | sudo apt install yubikey-manager-qt 130 | ``` 131 | 1. Change your pin from the default (if you haven't already) and change from the default pin 123456. Run `ykman piv change-pin -P 123456 -n ` 132 | 1. Run: `ykman piv import-key --pin-policy=default 9c /path/to/your.pfx` 133 | 1. When prompted, enter the PIN, management key, and password for the PFX. 134 | 1. Run: `ykman piv import-certificate 9c /path/to/your.pfx` 135 | 1. When prompted, enter the PIN, management key, and password for the PFX. 136 | 1. You may need to logout of your profile if the keys don't show up in SMIMESign below. 137 | -------------------------------------------------------------------------------- /src/ApiGeneratorGlobalSuppressions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 Glenn Watson. All rights reserved. 2 | // Glenn Watson licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for full license information. 4 | 5 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddCtorToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.MethodDefinition,System.Collections.Generic.HashSet{System.String})")] 6 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddFieldToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.FieldDefinition,System.Collections.Generic.HashSet{System.String})")] 7 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMemberToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.IMemberDefinition,System.Collections.Generic.HashSet{System.String})")] 8 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMethodToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.MethodDefinition,System.Collections.Generic.HashSet{System.String})")] 9 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddPropertyToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.PropertyDefinition,System.Collections.Generic.HashSet{System.String})")] 10 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateDelegateDeclaration(Mono.Cecil.TypeDefinition,System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")] 11 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateGenericArguments(Mono.Cecil.TypeReference)~System.CodeDom.CodeTypeReference[]")] 12 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateTypeDeclaration(Mono.Cecil.TypeDefinition,System.String[],System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")] 13 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetBaseTypes(Mono.Cecil.TypeDefinition)~System.Collections.Generic.IEnumerable{Mono.Cecil.TypeDefinition}")] 14 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetMethodAttributes(Mono.Cecil.MethodDefinition)~System.CodeDom.MemberAttributes")] 15 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetPropertyAttributes(System.CodeDom.MemberAttributes,System.CodeDom.MemberAttributes)~System.CodeDom.MemberAttributes")] 16 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetTypeName(Mono.Cecil.TypeReference)~System.String")] 17 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsDotNetTypeMember(Mono.Cecil.IMemberDefinition,System.String[])~System.Boolean")] 18 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ModifyCodeTypeReference(System.CodeDom.CodeTypeReference,System.String)~System.CodeDom.CodeTypeReference")] 19 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateGenericParameters(Mono.Cecil.IGenericParameterProvider,System.CodeDom.CodeTypeParameterCollection)")] 20 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateMethodParameters(Mono.Cecil.IMethodSignature,System.CodeDom.CodeParameterDeclarationExpressionCollection,System.Collections.Generic.HashSet{System.String},System.Boolean)")] 21 | 22 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~F:PublicApiGenerator.ApiGenerator.defaultWhitelistedNamespacePrefixes")] 23 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~F:PublicApiGenerator.ApiGenerator.defaultWhitelistedNamespacePrefixes")] 24 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~F:PublicApiGenerator.ApiGenerator.OperatorNameMap")] 25 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~F:PublicApiGenerator.ApiGenerator.OperatorNameMap")] 26 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~F:PublicApiGenerator.ApiGenerator.SkipAttributeNames")] 27 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~F:PublicApiGenerator.ApiGenerator.SkipAttributeNames")] 28 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddCtorToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.MethodDefinition,System.Collections.Generic.HashSet{System.String})")] 29 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddCtorToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.MethodDefinition,System.Collections.Generic.HashSet{System.String})")] 30 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddFieldToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.FieldDefinition,System.Collections.Generic.HashSet{System.String})")] 31 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddFieldToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.FieldDefinition,System.Collections.Generic.HashSet{System.String})")] 32 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMemberToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.IMemberDefinition,System.Collections.Generic.HashSet{System.String})")] 33 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMemberToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.IMemberDefinition,System.Collections.Generic.HashSet{System.String})")] 34 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMethodToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.MethodDefinition,System.Collections.Generic.HashSet{System.String})")] 35 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMethodToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.MethodDefinition,System.Collections.Generic.HashSet{System.String})")] 36 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddPropertyToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.PropertyDefinition,System.Collections.Generic.HashSet{System.String})")] 37 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddPropertyToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.PropertyDefinition,System.Collections.Generic.HashSet{System.String})")] 38 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ConvertAttributeToCode(System.Func{System.CodeDom.CodeTypeReference,System.CodeDom.CodeTypeReference},Mono.Cecil.CustomAttribute)~System.Object")] 39 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ConvertAttributeToCode(System.Func{System.CodeDom.CodeTypeReference,System.CodeDom.CodeTypeReference},Mono.Cecil.CustomAttribute)~System.Object")] 40 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateCodeTypeReference(Mono.Cecil.TypeReference)~System.CodeDom.CodeTypeReference")] 41 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateCodeTypeReference(Mono.Cecil.TypeReference)~System.CodeDom.CodeTypeReference")] 42 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateCustomAttributes(Mono.Cecil.ICustomAttributeProvider,System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeAttributeDeclarationCollection")] 43 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateCustomAttributes(Mono.Cecil.ICustomAttributeProvider,System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeAttributeDeclarationCollection")] 44 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateDelegateDeclaration(Mono.Cecil.TypeDefinition,System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")] 45 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateDelegateDeclaration(Mono.Cecil.TypeDefinition,System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")] 46 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateGenericArguments(Mono.Cecil.TypeReference)~System.CodeDom.CodeTypeReference[]")] 47 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateGenericArguments(Mono.Cecil.TypeReference)~System.CodeDom.CodeTypeReference[]")] 48 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateInitialiserExpression(Mono.Cecil.CustomAttributeArgument)~System.CodeDom.CodeExpression")] 49 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateInitialiserExpression(Mono.Cecil.CustomAttributeArgument)~System.CodeDom.CodeExpression")] 50 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreatePublicApiForAssembly(Mono.Cecil.AssemblyDefinition,System.Func{Mono.Cecil.TypeDefinition,System.Boolean},System.Boolean,System.String[],System.Collections.Generic.HashSet{System.String})~System.String")] 51 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreatePublicApiForAssembly(Mono.Cecil.AssemblyDefinition,System.Func{Mono.Cecil.TypeDefinition,System.Boolean},System.Boolean,System.String[],System.Collections.Generic.HashSet{System.String})~System.String")] 52 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateTypeDeclaration(Mono.Cecil.TypeDefinition,System.String[],System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")] 53 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateTypeDeclaration(Mono.Cecil.TypeDefinition,System.String[],System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")] 54 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.FormatParameterConstant(Mono.Cecil.IConstantProvider)~System.Object")] 55 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.FormatParameterConstant(Mono.Cecil.IConstantProvider)~System.Object")] 56 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GenerateCodeAttributeDeclaration(System.Func{System.CodeDom.CodeTypeReference,System.CodeDom.CodeTypeReference},Mono.Cecil.CustomAttribute)~System.CodeDom.CodeAttributeDeclaration")] 57 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GenerateCodeAttributeDeclaration(System.Func{System.CodeDom.CodeTypeReference,System.CodeDom.CodeTypeReference},Mono.Cecil.CustomAttribute)~System.CodeDom.CodeAttributeDeclaration")] 58 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GenerateEvent(Mono.Cecil.EventDefinition,System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeMember")] 59 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GenerateEvent(Mono.Cecil.EventDefinition,System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeMember")] 60 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetBaseTypes(Mono.Cecil.TypeDefinition)~System.Collections.Generic.IEnumerable{Mono.Cecil.TypeDefinition}")] 61 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetBaseTypes(Mono.Cecil.TypeDefinition)~System.Collections.Generic.IEnumerable{Mono.Cecil.TypeDefinition}")] 62 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetMethodAttributes(Mono.Cecil.MethodDefinition)~System.CodeDom.MemberAttributes")] 63 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetMethodAttributes(Mono.Cecil.MethodDefinition)~System.CodeDom.MemberAttributes")] 64 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetPropertyAttributes(System.CodeDom.MemberAttributes,System.CodeDom.MemberAttributes)~System.CodeDom.MemberAttributes")] 65 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetPropertyAttributes(System.CodeDom.MemberAttributes,System.CodeDom.MemberAttributes)~System.CodeDom.MemberAttributes")] 66 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetTypeName(Mono.Cecil.TypeReference)~System.String")] 67 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetTypeName(Mono.Cecil.TypeReference)~System.String")] 68 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.HasVisiblePropertyMethod(System.CodeDom.MemberAttributes)~System.Boolean")] 69 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.HasVisiblePropertyMethod(System.CodeDom.MemberAttributes)~System.Boolean")] 70 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsCompilerGenerated(Mono.Cecil.IMemberDefinition)~System.Boolean")] 71 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsCompilerGenerated(Mono.Cecil.IMemberDefinition)~System.Boolean")] 72 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsDelegate(Mono.Cecil.TypeDefinition)~System.Boolean")] 73 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsDelegate(Mono.Cecil.TypeDefinition)~System.Boolean")] 74 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsDotNetTypeMember(Mono.Cecil.IMemberDefinition,System.String[])~System.Boolean")] 75 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsDotNetTypeMember(Mono.Cecil.IMemberDefinition,System.String[])~System.Boolean")] 76 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsExtensionMethod(Mono.Cecil.ICustomAttributeProvider)~System.Boolean")] 77 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsExtensionMethod(Mono.Cecil.ICustomAttributeProvider)~System.Boolean")] 78 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsHidingMethod(Mono.Cecil.MethodDefinition)~System.Boolean")] 79 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsHidingMethod(Mono.Cecil.MethodDefinition)~System.Boolean")] 80 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.MakeReadonly(System.CodeDom.CodeTypeReference)~System.CodeDom.CodeTypeReference")] 81 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.MakeReadonly(System.CodeDom.CodeTypeReference)~System.CodeDom.CodeTypeReference")] 82 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ModifyCodeTypeReference(System.CodeDom.CodeTypeReference,System.String)~System.CodeDom.CodeTypeReference")] 83 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ModifyCodeTypeReference(System.CodeDom.CodeTypeReference,System.String)~System.CodeDom.CodeTypeReference")] 84 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.NormaliseGeneratedCode(System.IO.StringWriter)~System.String")] 85 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.NormaliseGeneratedCode(System.IO.StringWriter)~System.String")] 86 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.NormaliseLineEndings(System.String)~System.String")] 87 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.NormaliseLineEndings(System.String)~System.String")] 88 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateCustomAttributes(Mono.Cecil.ICustomAttributeProvider,System.CodeDom.CodeAttributeDeclarationCollection,System.Collections.Generic.HashSet{System.String})")] 89 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateCustomAttributes(Mono.Cecil.ICustomAttributeProvider,System.CodeDom.CodeAttributeDeclarationCollection,System.Collections.Generic.HashSet{System.String})")] 90 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateCustomAttributes(Mono.Cecil.ICustomAttributeProvider,System.CodeDom.CodeAttributeDeclarationCollection,System.Func{System.CodeDom.CodeTypeReference,System.CodeDom.CodeTypeReference},System.Collections.Generic.HashSet{System.String})")] 91 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateCustomAttributes(Mono.Cecil.ICustomAttributeProvider,System.CodeDom.CodeAttributeDeclarationCollection,System.Func{System.CodeDom.CodeTypeReference,System.CodeDom.CodeTypeReference},System.Collections.Generic.HashSet{System.String})")] 92 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateGenericParameters(Mono.Cecil.IGenericParameterProvider,System.CodeDom.CodeTypeParameterCollection)")] 93 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateGenericParameters(Mono.Cecil.IGenericParameterProvider,System.CodeDom.CodeTypeParameterCollection)")] 94 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateMethodParameters(Mono.Cecil.IMethodSignature,System.CodeDom.CodeParameterDeclarationExpressionCollection,System.Collections.Generic.HashSet{System.String},System.Boolean)")] 95 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateMethodParameters(Mono.Cecil.IMethodSignature,System.CodeDom.CodeParameterDeclarationExpressionCollection,System.Collections.Generic.HashSet{System.String},System.Boolean)")] 96 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.RemoveUnnecessaryWhiteSpace(System.String)~System.String")] 97 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.RemoveUnnecessaryWhiteSpace(System.String)~System.String")] 98 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ShouldIncludeAttribute(Mono.Cecil.CustomAttribute,System.Collections.Generic.HashSet{System.String})~System.Boolean")] 99 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ShouldIncludeAttribute(Mono.Cecil.CustomAttribute,System.Collections.Generic.HashSet{System.String})~System.Boolean")] 100 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ShouldIncludeMember(Mono.Cecil.IMemberDefinition,System.String[])~System.Boolean")] 101 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ShouldIncludeMember(Mono.Cecil.IMemberDefinition,System.String[])~System.Boolean")] 102 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ShouldIncludeType(Mono.Cecil.TypeDefinition)~System.Boolean")] 103 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ShouldIncludeType(Mono.Cecil.TypeDefinition)~System.Boolean")] 104 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ShouldOutputBaseType(Mono.Cecil.TypeDefinition)~System.Boolean")] 105 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ShouldOutputBaseType(Mono.Cecil.TypeDefinition)~System.Boolean")] 106 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "type", Target = "~T:PublicApiGenerator.CecilEx")] 107 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "type", Target = "~T:PublicApiGenerator.CecilEx")] 108 | 109 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1009:Closing parenthesis should be spaced correctly", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMemberToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.IMemberDefinition,System.Collections.Generic.HashSet{System.String})")] 110 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1003:Symbols should be spaced correctly", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMemberToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.IMemberDefinition,System.Collections.Generic.HashSet{System.String})")] 111 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1009:Closing parenthesis should be spaced correctly", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateInitialiserExpression(Mono.Cecil.CustomAttributeArgument)~System.CodeDom.CodeExpression")] 112 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1003:Symbols should be spaced correctly", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateInitialiserExpression(Mono.Cecil.CustomAttributeArgument)~System.CodeDom.CodeExpression")] 113 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1009:Closing parenthesis should be spaced correctly", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetPropertyAttributes(System.CodeDom.MemberAttributes,System.CodeDom.MemberAttributes)~System.CodeDom.MemberAttributes")] 114 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1003:Symbols should be spaced correctly", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetPropertyAttributes(System.CodeDom.MemberAttributes,System.CodeDom.MemberAttributes)~System.CodeDom.MemberAttributes")] 115 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1009:Closing parenthesis should be spaced correctly", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.RemoveUnnecessaryWhiteSpace(System.String)~System.String")] 116 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1122:Use string.Empty for empty strings", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetTypeName(Mono.Cecil.TypeReference)~System.String")] 117 | 118 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1305:Specify IFormatProvider", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateInitialiserExpression(Mono.Cecil.CustomAttributeArgument)~System.CodeDom.CodeExpression")] 119 | 120 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1513:Closing brace should be followed by blank line", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddPropertyToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.PropertyDefinition,System.Collections.Generic.HashSet{System.String})")] 121 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1513:Closing brace should be followed by blank line", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateGenericArguments(Mono.Cecil.TypeReference)~System.CodeDom.CodeTypeReference[]")] 122 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1513:Closing brace should be followed by blank line", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreatePublicApiForAssembly(Mono.Cecil.AssemblyDefinition,System.Func{Mono.Cecil.TypeDefinition,System.Boolean},System.Boolean,System.String[],System.Collections.Generic.HashSet{System.String})~System.String")] 123 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1513:Closing brace should be followed by blank line", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateTypeDeclaration(Mono.Cecil.TypeDefinition,System.String[],System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")] 124 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1513:Closing brace should be followed by blank line", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GenerateCodeAttributeDeclaration(System.Func{System.CodeDom.CodeTypeReference,System.CodeDom.CodeTypeReference},Mono.Cecil.CustomAttribute)~System.CodeDom.CodeAttributeDeclaration")] 125 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1513:Closing brace should be followed by blank line", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateGenericParameters(Mono.Cecil.IGenericParameterProvider,System.CodeDom.CodeTypeParameterCollection)")] 126 | 127 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "RCS1001:Add braces (when expression spans over multiple lines).", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateTypeDeclaration(Mono.Cecil.TypeDefinition,System.String[],System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")] 128 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1117:Parameters should be on same line or separate lines", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GeneratePublicApi(System.Reflection.Assembly,System.Type[],System.Boolean,System.String[],System.String[])~System.String")] 129 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1117:Parameters should be on same line or separate lines", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.NormaliseGeneratedCode(System.IO.StringWriter)~System.String")] 130 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1116:Split parameters should start on line after declaration", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMemberToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.IMemberDefinition,System.Collections.Generic.HashSet{System.String})")] 131 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1116:Split parameters should start on line after declaration", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddPropertyToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.PropertyDefinition,System.Collections.Generic.HashSet{System.String})")] 132 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1116:Split parameters should start on line after declaration", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateCustomAttributes(Mono.Cecil.ICustomAttributeProvider,System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeAttributeDeclarationCollection")] 133 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1116:Split parameters should start on line after declaration", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateCustomAttributes(Mono.Cecil.ICustomAttributeProvider,System.CodeDom.CodeAttributeDeclarationCollection,System.Collections.Generic.HashSet{System.String})")] 134 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1116:Split parameters should start on line after declaration", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateCustomAttributes(Mono.Cecil.ICustomAttributeProvider,System.CodeDom.CodeAttributeDeclarationCollection,System.Func{System.CodeDom.CodeTypeReference,System.CodeDom.CodeTypeReference},System.Collections.Generic.HashSet{System.String})")] 135 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1116:Split parameters should start on line after declaration", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateMethodParameters(Mono.Cecil.IMethodSignature,System.CodeDom.CodeParameterDeclarationExpressionCollection,System.Collections.Generic.HashSet{System.String},System.Boolean)")] 136 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1116:Split parameters should start on line after declaration", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.RemoveUnnecessaryWhiteSpace(System.String)~System.String")] 137 | 138 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1000:Keywords should be spaced correctly", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateTypeDeclaration(Mono.Cecil.TypeDefinition,System.String[],System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")] 139 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1209:Using alias directives should be placed after other using directives", Justification = "NuGet Inclusion")] 140 | 141 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1210:Using directives should be ordered alphabetically by namespace", Justification = "NuGet Inclusion")] 142 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1208:System using directives should be placed before other using directives", Justification = "NuGet Inclusion")] 143 | 144 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1201:Elements should appear in the correct order", Justification = "NuGet Inclusion", Scope = "member", Target = "~F:PublicApiGenerator.ApiGenerator.OperatorNameMap")] 145 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1201:Elements should appear in the correct order", Justification = "NuGet Inclusion", Scope = "member", Target = "~F:PublicApiGenerator.ApiGenerator.SkipAttributeNames")] 146 | 147 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1825:Avoid zero-length array allocations.", Justification = "NuGet Inclusion", Scope = "member", Target = "~F:PublicApiGenerator.ApiGenerator.defaultWhitelistedNamespacePrefixes")] 148 | 149 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1307:Specify StringComparison", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMethodToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.MethodDefinition,System.Collections.Generic.HashSet{System.String})")] 150 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1307:Specify StringComparison", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsDotNetTypeMember(Mono.Cecil.IMemberDefinition,System.String[])~System.Boolean")] 151 | 152 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1512:Single-line comments should not be followed by blank line", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddPropertyToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.PropertyDefinition,System.Collections.Generic.HashSet{System.String})")] 153 | 154 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1515:Single-line comment should be preceded by blank line", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMethodToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.MethodDefinition,System.Collections.Generic.HashSet{System.String})")] 155 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1515:Single-line comment should be preceded by blank line", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateTypeDeclaration(Mono.Cecil.TypeDefinition,System.String[],System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")] 156 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1520:Use braces consistently", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateTypeDeclaration(Mono.Cecil.TypeDefinition,System.String[],System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")] 157 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:File may only contain a single type", Justification = "NuGet Inclusion", Scope = "type", Target = "~T:PublicApiGenerator.CecilEx")] 158 | 159 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1005:Single line comments should begin with single space", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateInitialiserExpression(Mono.Cecil.CustomAttributeArgument)~System.CodeDom.CodeExpression")] 160 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1111:Closing parenthesis should be on line of last parameter", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.RemoveUnnecessaryWhiteSpace(System.String)~System.String")] 161 | -------------------------------------------------------------------------------- /src/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | AnyCPU 5 | $(MSBuildProjectName.Contains('Tests')) 6 | Glenn Watson 7 | Copyright (c) 2021 Glenn Watson 8 | MIT 9 | https://github.com/glennawatson/GitSMimeSign/ 10 | A global tool for performing GIT SMime Sign operations. 11 | glennawatson 12 | git;x509;smime 13 | https://github.com/glennawatson/GitSMimeSign/releases 14 | https://github.com/glennawatson/GitSMimeSign 15 | git 16 | 17 | 18 | true 19 | 20 | true 21 | 22 | $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb 23 | true 24 | 25 | 26 | 27 | true 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | $(MSBuildThisFileDirectory) 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /src/Directory.build.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | $(AssemblyName) ($(TargetFramework)) 4 | 5 | 6 | 7 | $(DefineConstants);NET_45;XAML 8 | 9 | 10 | $(DefineConstants);NETFX_CORE;XAML;WINDOWS_UWP 11 | 12 | 13 | $(DefineConstants);MONO;UIKIT;COCOA 14 | 15 | 16 | $(DefineConstants);MONO;COCOA 17 | 18 | 19 | $(DefineConstants);MONO;UIKIT;COCOA 20 | 21 | 22 | $(DefineConstants);MONO;UIKIT;COCOA 23 | 24 | 25 | $(DefineConstants);MONO;ANDROID 26 | 27 | 28 | $(DefineConstants);TIZEN 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/GITSMimeSign.Tests/GitSMimeSign.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/GITSMimeSign.Tests/SignVerifyTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 Glenn Watson. All rights reserved. 2 | // Glenn Watson licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for full license information. 4 | 5 | using System; 6 | using System.Collections.Generic; 7 | using System.IO; 8 | using System.Security.Cryptography; 9 | using System.Security.Cryptography.X509Certificates; 10 | using System.Text; 11 | using System.Threading.Tasks; 12 | 13 | using FluentAssertions; 14 | 15 | using GitSMimeSign.Actions; 16 | using GitSMimeSign.Helpers; 17 | 18 | using Xunit; 19 | 20 | namespace GitSMimeSigner.Tests 21 | { 22 | /// 23 | /// Tests associated with the Sign procedures. 24 | /// 25 | public class SignVerifyTests 26 | { 27 | /// 28 | /// Perform signing/verification with detached signatures and PEM encoding. 29 | /// This is the common scenario for GIT. 30 | /// 31 | /// A task to monitor. 32 | [Fact] 33 | public async Task TestSignAndVerifyPemDetached() 34 | { 35 | var (outputStream, gpgStream) = GetOutputStreams(); 36 | var certificate = Generate(); 37 | var bytes = Encoding.UTF8.GetBytes("Hello World"); 38 | var result = await SignAction.PerformSign(certificate, bytes, null, true, true, X509IncludeOption.WholeChain).ConfigureAwait(false); 39 | 40 | Assert.Equal(0, result); 41 | 42 | var output = GetStreamContents(outputStream).Replace("\r\n", string.Empty).Replace("\n", string.Empty).Replace("\r", string.Empty); 43 | var gpg = GetStreamContents(gpgStream); 44 | output.Should().Be("[GitSMimeSign:] Finished signing"); 45 | gpg.Should().NotBeEmpty(); 46 | } 47 | 48 | private static string GetStreamContents(Stream stream) 49 | { 50 | stream.Flush(); 51 | stream.Position = 0; 52 | using var sr = new StreamReader(stream); 53 | return sr.ReadToEnd(); 54 | } 55 | 56 | private static (MemoryStream output, MemoryStream gpg) GetOutputStreams() 57 | { 58 | var gpgMemoryStream = new MemoryStream(); 59 | var outputMemoryStream = new MemoryStream(); 60 | 61 | GpgOutputHelper.OutputStream = new Lazy(gpgMemoryStream); 62 | GpgOutputHelper.TextWriter = new StreamWriter(gpgMemoryStream); 63 | InfoOutputHelper.TextWriter = new StreamWriter(outputMemoryStream); 64 | 65 | return (outputMemoryStream, gpgMemoryStream); 66 | } 67 | 68 | private static X509Certificate2 Generate() 69 | { 70 | // Taken from https://github.com/dotnet/corefx/blob/5012dfe0813bf9f3eaf7a6460671e07ea048fd52/src/System.Security.Cryptography.X509Certificates/tests/CertificateCreation/CertificateRequestUsageTests.cs#L190 71 | using var rsa = RSA.Create(); 72 | var request = new CertificateRequest( 73 | "CN=localhost, OU=.NET Framework (CoreFX), O=Microsoft Corporation, L=Redmond, S=Washington, C=US", 74 | rsa, 75 | HashAlgorithmName.SHA256, 76 | RSASignaturePadding.Pkcs1); 77 | 78 | var caFakeIssuer = GenerateCA("CN=Fake Name CA, OU=Fake, O=Fake Org, L=FakeVille, S=Fake State, C=US"); 79 | 80 | var serialNumber = new byte[8]; 81 | RandomNumberGenerator.Fill(serialNumber); 82 | var now = DateTimeOffset.UtcNow; 83 | var cert = request.Create(caFakeIssuer, now.AddDays(-1), now.AddDays(90), serialNumber); 84 | 85 | var temp = cert.CopyWithPrivateKey(rsa); 86 | 87 | // Work around described in https://github.com/dotnet/corefx/issues/35120 88 | return new X509Certificate2(temp.Export(X509ContentType.Pfx)); 89 | } 90 | 91 | private static X509Certificate2 GenerateCA(string subject) 92 | { 93 | using var rsa = RSA.Create(); 94 | var request = new CertificateRequest( 95 | subject, 96 | rsa, 97 | HashAlgorithmName.SHA256, 98 | RSASignaturePadding.Pkcs1); 99 | 100 | request.CertificateExtensions.Add( 101 | new X509BasicConstraintsExtension(true, false, 0, true)); 102 | 103 | var now = DateTimeOffset.UtcNow; 104 | return request.CreateSelfSigned(now.AddDays(-2), now.AddDays(91)); 105 | } 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /src/GITSMimeSign.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.0.31717.71 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitSMimeSign", "GITSMimeSign\GitSMimeSign.csproj", "{4D29B301-B3B0-4963-86C9-8AD463883EE8}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitSMimeSign.Tests", "GITSMimeSign.Tests\GitSMimeSign.Tests.csproj", "{C2B83A80-995F-4B2D-82A0-047E897DA8AE}" 9 | EndProject 10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DBF691BE-CCA4-4C4E-A920-68AE7E22C4ED}" 11 | ProjectSection(SolutionItems) = preProject 12 | ..\.editorconfig = ..\.editorconfig 13 | ..\.github\workflows\ci-build.yml = ..\.github\workflows\ci-build.yml 14 | Directory.Build.props = Directory.Build.props 15 | Directory.build.targets = Directory.build.targets 16 | global.json = global.json 17 | ..\LICENSE = ..\LICENSE 18 | ..\README.md = ..\README.md 19 | ..\.github\workflows\release.yml = ..\.github\workflows\release.yml 20 | ..\version.json = ..\version.json 21 | EndProjectSection 22 | EndProject 23 | Global 24 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 25 | Debug|Any CPU = Debug|Any CPU 26 | Release|Any CPU = Release|Any CPU 27 | EndGlobalSection 28 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 29 | {4D29B301-B3B0-4963-86C9-8AD463883EE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 30 | {4D29B301-B3B0-4963-86C9-8AD463883EE8}.Debug|Any CPU.Build.0 = Debug|Any CPU 31 | {4D29B301-B3B0-4963-86C9-8AD463883EE8}.Release|Any CPU.ActiveCfg = Release|Any CPU 32 | {4D29B301-B3B0-4963-86C9-8AD463883EE8}.Release|Any CPU.Build.0 = Release|Any CPU 33 | {C2B83A80-995F-4B2D-82A0-047E897DA8AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 34 | {C2B83A80-995F-4B2D-82A0-047E897DA8AE}.Debug|Any CPU.Build.0 = Debug|Any CPU 35 | {C2B83A80-995F-4B2D-82A0-047E897DA8AE}.Release|Any CPU.ActiveCfg = Release|Any CPU 36 | {C2B83A80-995F-4B2D-82A0-047E897DA8AE}.Release|Any CPU.Build.0 = Release|Any CPU 37 | EndGlobalSection 38 | GlobalSection(SolutionProperties) = preSolution 39 | HideSolutionNode = FALSE 40 | EndGlobalSection 41 | GlobalSection(ExtensibilityGlobals) = postSolution 42 | SolutionGuid = {DE29D500-561A-44C5-9505-A9A7325B2234} 43 | EndGlobalSection 44 | EndGlobal 45 | -------------------------------------------------------------------------------- /src/GITSMimeSign/Actions/ListKeysAction.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 Glenn Watson. All rights reserved. 2 | // Glenn Watson licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for full license information. 4 | 5 | using System; 6 | using System.Globalization; 7 | using System.Security.Cryptography; 8 | using System.Security.Cryptography.X509Certificates; 9 | using System.Threading.Tasks; 10 | using GitSMimeSign.Helpers; 11 | using GitSMimeSign.Properties; 12 | 13 | namespace GitSMimeSign.Actions 14 | { 15 | internal static class ListKeysAction 16 | { 17 | public static Task Do() 18 | { 19 | using (var store = new X509Store(StoreName.My, StoreLocation.CurrentUser)) 20 | { 21 | try 22 | { 23 | store.Open(OpenFlags.OpenExistingOnly | OpenFlags.ReadOnly); 24 | 25 | var firstEntry = true; 26 | 27 | for (var i = 0; i < store.Certificates.Count; ++i) 28 | { 29 | var certificate = store.Certificates[i]; 30 | 31 | if (!certificate.IsValidSigningCertificate()) 32 | { 33 | continue; 34 | } 35 | 36 | if (!firstEntry) 37 | { 38 | Console.WriteLine(); 39 | } 40 | else 41 | { 42 | firstEntry = false; 43 | } 44 | 45 | Console.WriteLine(Resources.IdHeader, certificate.Thumbprint); 46 | Console.WriteLine(Resources.SerialNumberHeader, certificate.SerialNumber); 47 | Console.WriteLine(Resources.SignatureAlgorithmHeader, certificate.SignatureAlgorithm.FriendlyName); 48 | Console.WriteLine(Resources.ValidityHeader, certificate.NotBefore.ToString("o", CultureInfo.InvariantCulture), certificate.NotAfter.ToString("o", CultureInfo.InvariantCulture)); 49 | Console.WriteLine(Resources.IssuerHeader, certificate.Issuer); 50 | Console.WriteLine(Resources.SubjectHeader, certificate.Subject); 51 | Console.WriteLine(Resources.EmailHeader, certificate.GetNameInfo(X509NameType.EmailName, false)); 52 | } 53 | 54 | return Task.FromResult(0); 55 | } 56 | catch (CryptographicException) 57 | { 58 | return Task.FromException(new SignClientException(Resources.X509StoreIssue)); 59 | } 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/GITSMimeSign/Actions/SignAction.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 Glenn Watson. All rights reserved. 2 | // Glenn Watson licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for full license information. 4 | 5 | using System; 6 | using System.Globalization; 7 | using System.Security.Cryptography.Pkcs; 8 | using System.Security.Cryptography.X509Certificates; 9 | using System.Threading.Tasks; 10 | 11 | using GitSMimeSign.Helpers; 12 | using GitSMimeSign.Properties; 13 | using GitSMimeSign.Timestamper; 14 | 15 | namespace GitSMimeSign.Actions 16 | { 17 | internal static class SignAction 18 | { 19 | // BEGIN_SIGNING 20 | // Mark the start of the actual signing process. This may be used as an 21 | // indication that all requested secret keys are ready for use. 22 | private const string BeginSigning = "BEGIN_SIGNING"; 23 | 24 | // SIG_CREATED 25 | // A signature has been created using these parameters. 26 | // Values for type are: 27 | // - D :: detached 28 | // - C :: cleartext 29 | // - S :: standard 30 | // (only the first character should be checked) 31 | // 32 | // are 2 hex digits with the OpenPGP signature class. 33 | // 34 | // Note, that TIMESTAMP may either be a number of seconds since Epoch 35 | // or an ISO 8601 string which can be detected by the presence of the 36 | // letter 'T'. 37 | private const string SignatureCreated = "SIG_CREATED"; 38 | 39 | /// 40 | /// Gets or sets the time stamper which will perform time stamping operations. 41 | /// 42 | internal static ITimeStamper TimeStamper { get; set; } = HttpTimeStamper.Default; 43 | 44 | /// 45 | /// Performs the sign action. 46 | /// 47 | /// The file name to sign. If null will be stdin. 48 | /// The email address or certificate id of the certificate to sign against. 49 | /// A uri to the timestamp authority. 50 | /// If the signing operation should be detached and produce separate signature. 51 | /// If we should produce data in the PEM encoded format. 52 | /// The certificate include options, if we should just include end certificates, or intermediate/root certificates as well. 53 | /// 0 if the operation was successful, 1 otherwise. 54 | public static Task Do(string fileName, string localUser, Uri timeStampAuthority, bool isDetached, bool useArmor, X509IncludeOption includeOption) 55 | { 56 | if (localUser is null) 57 | { 58 | throw new ArgumentNullException(nameof(localUser), Resources.InvalidCertificateId); 59 | } 60 | 61 | var certificate = CertificateHelper.FindUserCertificate(localUser); 62 | 63 | if (certificate is null) 64 | { 65 | throw new ArgumentException("Failed to get identity certificate with identity: " + localUser, nameof(localUser)); 66 | } 67 | 68 | var bytes = FileSystemStreamHelper.ReadFileStreamFully(fileName); 69 | 70 | return PerformSign(certificate, bytes, timeStampAuthority, isDetached, useArmor, includeOption); 71 | } 72 | 73 | /// 74 | /// Performs a signing operation. 75 | /// 76 | /// The certificate to use for signing. 77 | /// The bytes to sign. 78 | /// A optional RFC3161 timestamp authority to sign against. 79 | /// If we should be producing detached results. 80 | /// If we should encode in PEM format. 81 | /// The certificate include options, if we should just include end certificates, or intermediate/root certificates as well. 82 | /// 0 if the operation was successful, 1 otherwise. 83 | internal static async Task PerformSign(X509Certificate2 certificate, byte[] bytes, Uri timeStampAuthority, bool isDetached, bool useArmor, X509IncludeOption includeOption) 84 | { 85 | if (certificate is null) 86 | { 87 | throw new ArgumentNullException(nameof(certificate), Resources.InvalidCertificate); 88 | } 89 | 90 | if (!certificate.HasPrivateKey) 91 | { 92 | throw new ArgumentException($"The certificate {certificate.Thumbprint} has a invalid signing key.", nameof(certificate)); 93 | } 94 | 95 | if (bytes is null) 96 | { 97 | throw new ArgumentNullException(nameof(bytes), Resources.NothingToEncrypt); 98 | } 99 | 100 | // Git is looking for "\n[GNUPG:] SIG_CREATED ", meaning we need to print a 101 | // line before SIG_CREATED. BEGIN_SIGNING seems appropriate. GPG emits this, 102 | // though GPGSM does not. 103 | GpgOutputHelper.WriteLine(BeginSigning); 104 | 105 | var contentInfo = new ContentInfo(bytes); 106 | var cms = new SignedCms(contentInfo, isDetached); 107 | var signer = new CmsSigner(certificate) { IncludeOption = includeOption }; 108 | signer.SignedAttributes.Add(new Pkcs9SigningTime()); 109 | 110 | cms.ComputeSignature(signer, false); 111 | 112 | // If we are provided with a authority, add the timestamp certificate into our unsigned attributes. 113 | if (timeStampAuthority is not null) 114 | { 115 | InfoOutputHelper.WriteLine("Stamping with RFC 3161 Time Stamp Authority: " + timeStampAuthority); 116 | await TimeStamper.GetAndSetRfc3161Timestamp(cms, timeStampAuthority).ConfigureAwait(false); 117 | } 118 | 119 | var encoding = cms.Encode(); 120 | 121 | // Write out the signature in GPG expected format. 122 | WriteGpgFormatSignature(certificate, isDetached); 123 | 124 | KeyOutputHelper.Write(encoding, useArmor); 125 | 126 | InfoOutputHelper.WriteLine("Finished signing"); 127 | 128 | GpgOutputHelper.Flush(); 129 | InfoOutputHelper.Flush(); 130 | 131 | return 0; 132 | } 133 | 134 | private static void WriteGpgFormatSignature(X509Certificate2 certificate, bool isDetached) 135 | { 136 | const int signatureCode = 0; // GPGSM uses 0 as well. 137 | var signatureType = isDetached ? "D" : "S"; 138 | var (algorithmCode, hashCode) = CertificateHelper.ToPgpPublicKeyAlgorithmCode(certificate); 139 | GpgOutputHelper.WriteLine($"{SignatureCreated} {signatureType} {algorithmCode.ToString()} {hashCode.ToString()} {signatureCode.ToString()} {DateTime.UtcNow.ToString("O", CultureInfo.InvariantCulture)} {certificate.Thumbprint}"); 140 | } 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /src/GITSMimeSign/Actions/VerifyAction.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019 Glenn Watson. All rights reserved. 2 | // Glenn Watson licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for full license information. 4 | 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Globalization; 8 | using System.Linq; 9 | using System.Security.Cryptography; 10 | using System.Security.Cryptography.Pkcs; 11 | using System.Security.Cryptography.X509Certificates; 12 | 13 | using GitSMimeSign.Helpers; 14 | using GitSMimeSign.Properties; 15 | using GitSMimeSign.Timestamper; 16 | 17 | namespace GitSMimeSign.Actions 18 | { 19 | /// 20 | /// Verifies the data. 21 | /// 22 | internal static class VerifyAction 23 | { 24 | // NEWSIG [] 25 | // Is issued right before a signature verification starts. This is 26 | // useful to define a context for parsing ERROR status messages. 27 | // arguments are currently defined. If SIGNERS_UID is given and is 28 | // not "-" this is the percent escape value of the OpenPGP Signer's 29 | // User ID signature sub-packet. 30 | private const string NewSig = "NEWSIG"; 31 | 32 | // BADSIG 33 | // The signature with the keyid has not been verified okay. The username is 34 | // the primary one encoded in UTF-8 and %XX escaped. The fingerprint may be 35 | // used instead of the long keyid if it is available. This is the case with 36 | // CMS and might eventually also be available for OpenPGP. 37 | private const string BadSignature = "BADSIG"; 38 | 39 | // GOODSIG 40 | // The signature with the keyid is good. For each signature only one 41 | // of the codes GOODSIG, BADSIG, EXPSIG, EXPKEYSIG, REVKEYSIG or 42 | // ERRSIG will be emitted. In the past they were used as a marker 43 | // for a new signature; new code should use the NEWSIG status 44 | // instead. The username is the primary one encoded in UTF-8 and %XX 45 | // escaped. The fingerprint may be used instead of the long keyid if 46 | // it is available. This is the case with CMS and might eventually 47 | // also be available for OpenPGP. 48 | private const string GoodSignature = "GOODSIG"; 49 | 50 | // ERRSIG