├── .gitignore
├── CommandLine
├── BaseAttribute.cs
├── CommandLine.csproj
├── CommandLine.csproj.DotSettings
├── CommandLine.sln
├── Core
│ ├── ArgumentsExtensions.cs
│ ├── InstanceBuilder.cs
│ ├── InstanceChooser.cs
│ ├── KeyValuePairHelper.cs
│ ├── NameExtensions.cs
│ ├── NameLookup.cs
│ ├── OptionMapper.cs
│ ├── OptionSpecification.cs
│ ├── PreprocessorGuards.cs
│ ├── ReflectionExtensions.cs
│ ├── Scalar.cs
│ ├── Sequence.cs
│ ├── Specification.cs
│ ├── SpecificationExtensions.cs
│ ├── SpecificationGuards.cs
│ ├── SpecificationProperty.cs
│ ├── SpecificationPropertyExtensions.cs
│ ├── SpecificationPropertyRules.cs
│ ├── Switch.cs
│ ├── Token.cs
│ ├── TokenPartitioner.cs
│ ├── Tokenizer.cs
│ ├── TypeConverter.cs
│ ├── TypeDescriptor.cs
│ ├── TypeLookup.cs
│ ├── ValueMapper.cs
│ ├── ValueSpecification.cs
│ └── Verb.cs
├── Error.cs
├── ErrorExtensions.cs
├── Infrastructure
│ ├── EnumerableExtensions`1.cs
│ ├── EnumerableExtentions.cs
│ ├── ErrorHandling.cs
│ ├── ExceptionExtensions.cs
│ ├── FSharpOptionHelper.cs
│ ├── Maybe.cs
│ ├── PopsicleSetter.cs
│ ├── ReflectionHelper.cs
│ ├── ResultExtensions.cs
│ ├── StringBuilderExtensions.cs
│ └── StringExtensions.cs
├── NameInfo.cs
├── NullInstance.cs
├── OptionAttribute.cs
├── Parser.cs
├── ParserExtensions.cs
├── ParserResult.cs
├── ParserResultExtensions.cs
├── ParserSettings.cs
├── Properties
│ └── AssemblyInfo.cs
├── Text
│ ├── AssemblyLicenseAttribute.cs
│ ├── AssemblyUsageAttribute.cs
│ ├── CopyrightInfo.cs
│ ├── Example.cs
│ ├── HeadingInfo.cs
│ ├── HelpText.cs
│ ├── MultiLineTextAttribute.cs
│ ├── SentenceBuilder.cs
│ └── UsageAttribute.cs
├── UnParserExtensions.cs
├── ValueAttribute.cs
├── VerbAttribute.cs
└── paket.references
├── Readme.docx
├── Xades-master
├── .gitignore
├── Documents
│ ├── Guide du Kit de démarrage Signature avancée XAdES.docx
│ ├── Installation du Kit de démarrage Signature avancée XAdES.docx
│ └── Microsoft.Xades.chm
├── LISEZMOI.txt
├── Source
│ ├── Library
│ │ ├── AllDataObjectsTimeStampCollection.cs
│ │ ├── AssemblyInfo.cs
│ │ ├── CRLIdentifier.cs
│ │ ├── CRLRef.cs
│ │ ├── CRLRefCollection.cs
│ │ ├── CRLRefs.cs
│ │ ├── CRLValue.cs
│ │ ├── CRLValueCollection.cs
│ │ ├── CRLValues.cs
│ │ ├── Cert.cs
│ │ ├── CertCollection.cs
│ │ ├── CertRefs.cs
│ │ ├── CertificateValues.cs
│ │ ├── CertifiedRole.cs
│ │ ├── CertifiedRoleCollection.cs
│ │ ├── CertifiedRoles.cs
│ │ ├── ClaimedRole.cs
│ │ ├── ClaimedRoleCollection.cs
│ │ ├── ClaimedRoles.cs
│ │ ├── CommitmentTypeIndication.cs
│ │ ├── CommitmentTypeIndicationCollection.cs
│ │ ├── CommitmentTypeQualifier.cs
│ │ ├── CommitmentTypeQualifierCollection.cs
│ │ ├── CommitmentTypeQualifiers.cs
│ │ ├── CompleteCertificateRefs.cs
│ │ ├── CompleteRevocationRefs.cs
│ │ ├── CounterSignatureCollection.cs
│ │ ├── DataObjectFormat.cs
│ │ ├── DataObjectFormatCollection.cs
│ │ ├── DigestAlgAndValueType.cs
│ │ ├── DigestMethod.cs
│ │ ├── DocumentationReference.cs
│ │ ├── DocumentationReferenceCollection.cs
│ │ ├── DocumentationReferences.cs
│ │ ├── EncapsulatedPKIData.cs
│ │ ├── EncapsulatedX509Certificate.cs
│ │ ├── EncapsulatedX509CertificateCollection.cs
│ │ ├── HashDataInfo.cs
│ │ ├── HashDataInfoCollection.cs
│ │ ├── Identifier.cs
│ │ ├── IndividualDataObjectsTimeStampCollection.cs
│ │ ├── IssuerSerial.cs
│ │ ├── Library.csproj
│ │ ├── Microsoft.Xades.snk
│ │ ├── NoticeNumberCollection.cs
│ │ ├── NoticeNumbers.cs
│ │ ├── NoticeRef.cs
│ │ ├── OCSPIdentifier.cs
│ │ ├── OCSPRef.cs
│ │ ├── OCSPRefCollection.cs
│ │ ├── OCSPRefs.cs
│ │ ├── OCSPValue.cs
│ │ ├── OCSPValueCollection.cs
│ │ ├── OCSPValues.cs
│ │ ├── ObjectIdentifier.cs
│ │ ├── ObjectReference.cs
│ │ ├── ObjectReferenceCollection.cs
│ │ ├── OtherCertificate.cs
│ │ ├── OtherCertificateCollection.cs
│ │ ├── OtherRef.cs
│ │ ├── OtherRefCollection.cs
│ │ ├── OtherRefs.cs
│ │ ├── OtherValue.cs
│ │ ├── OtherValueCollection.cs
│ │ ├── OtherValues.cs
│ │ ├── QualifyingProperties.cs
│ │ ├── RevocationValues.cs
│ │ ├── SPUri.cs
│ │ ├── SPUserNotice.cs
│ │ ├── SigPolicyQualifier.cs
│ │ ├── SigPolicyQualifierCollection.cs
│ │ ├── SigPolicyQualifiers.cs
│ │ ├── SignaturePolicyId.cs
│ │ ├── SignaturePolicyIdentifier.cs
│ │ ├── SignatureProductionPlace.cs
│ │ ├── SignatureTimeStampCollection.cs
│ │ ├── SignedDataObjectProperties.cs
│ │ ├── SignedProperties.cs
│ │ ├── SignedSignatureProperties.cs
│ │ ├── SignerRole.cs
│ │ ├── SigningCertificate.cs
│ │ ├── TimeStamp.cs
│ │ ├── Transform.cs
│ │ ├── TransformCollection.cs
│ │ ├── Transforms.cs
│ │ ├── UnsignedDataObjectProperties.cs
│ │ ├── UnsignedDataObjectProperty.cs
│ │ ├── UnsignedDataObjectPropertyCollection.cs
│ │ ├── UnsignedProperties.cs
│ │ ├── UnsignedSignatureProperties.cs
│ │ ├── XAdES.xsd
│ │ ├── XMLTimeStamp.cs
│ │ ├── XadesObject.cs
│ │ ├── XadesSignedXml.cs
│ │ ├── doc
│ │ │ └── XAdES.xml
│ │ └── xmldsig-core-schema.xsd
│ ├── Microsoft.Xades.shfbproj
│ ├── Microsoft.Xades.sln
│ ├── Microsoft.Xades.snk
│ └── TestClient
│ │ ├── App.ico
│ │ ├── Asn1Parser.cs
│ │ ├── AssemblyInfo.cs
│ │ ├── HttpTsaClient.cs
│ │ ├── MainForm.cs
│ │ ├── MainForm.resx
│ │ ├── TestClient.csproj
│ │ ├── ViewSignatureForm.cs
│ │ ├── ViewSignatureForm.resx
│ │ ├── XmlRenderTree.cs
│ │ ├── XmlRenderTree.resx
│ │ └── app.config
└── licence.txt
├── Xades.IntegrationTests
├── IntegrationTest.cs
├── NUnitTestHelper.cs
├── Properties
│ └── AssemblyInfo.cs
├── TestData
│ ├── certificate.pfx
│ └── root-certificate.cer
├── TestXml
│ ├── Integration
│ │ ├── exportNsiListResponse-expired.xml
│ │ ├── exportNsiListResponse.xml
│ │ └── getstate.xml
│ ├── Invalid
│ │ ├── certificate-not-match-by-digest-value.xml
│ │ ├── certificate-not-match-by-issuer-name.xml
│ │ ├── certificate-not-match-by-serial-number.xml
│ │ ├── commitment.xml
│ │ ├── data-object-format.xml
│ │ ├── hash-algorithm-not-supported.xml
│ │ ├── invalid-reference-to-signature.xml
│ │ ├── invalid-reference-to-signed-element.xml
│ │ ├── invalid-signature.xml
│ │ ├── not-signed.xml
│ │ ├── signature-not-found.xml
│ │ ├── signed-insde.xml
│ │ ├── signed-more-than-once.xml
│ │ ├── signing-role.xml
│ │ └── xmldsig.xml
│ ├── NotSigned
│ │ ├── not-signed-child.xml
│ │ └── not-signed-root.xml
│ └── Valid
│ │ ├── sign.xml
│ │ └── sing-certificate-is-not-installed.xml
├── Xades.IntegrationTests.csproj
└── packages.config
├── Xades.UnitTests
├── IssuerComparerTests.cs
├── Properties
│ └── AssemblyInfo.cs
├── Xades.UnitTests.csproj
└── packages.config
├── Xades.sln
├── Xades
├── Abstractions
│ ├── ICertificateMatcher.cs
│ ├── ICryptoProvider.cs
│ ├── IIssuerComparer.cs
│ └── IXadesService.cs
├── Exceptions
│ └── XadesBesValidationException.cs
├── Helpers
│ ├── ArrayHelper.cs
│ ├── CertificateHelper.cs
│ ├── CollectionHelper.cs
│ ├── ConvertHelper.cs
│ ├── DateTimeHelper.cs
│ ├── EnumerableHelper.cs
│ ├── KeyInfoHelper.cs
│ ├── X509NameHelper.cs
│ ├── XadesSignedXmlHelper.cs
│ └── XmlDocumentHelper.cs
├── Implementations
│ ├── AdditionalXmlDsigC14NTransform.cs
│ ├── CertificateMatcher.cs
│ ├── GostCryptoProvider.cs
│ ├── GostXadesBesService.cs
│ └── IssuerComparer.cs
├── Models
│ └── XadesInfo.cs
├── Properties
│ └── AssemblyInfo.cs
├── Xades.csproj
├── XadesBesSignedXml.cs
└── packages.config
├── XadesDemo
├── App.config
├── Commands
│ ├── CertificateCommand.cs
│ ├── CommandBase.cs
│ ├── GetStateCommand.cs
│ ├── GisCommandBase.cs
│ ├── ICommand.cs
│ ├── SendCommand.cs
│ ├── SignCommand.cs
│ ├── VerifyCommand.cs
│ └── XadesCommandBase.cs
├── Configurations
│ ├── Options
│ │ ├── CertificateOptions.cs
│ │ ├── GetStateOptions.cs
│ │ ├── OptionBase.cs
│ │ ├── SendOptions.cs
│ │ ├── SignOptions.cs
│ │ ├── VerifyOptions.cs
│ │ └── XadesOptionBase.cs
│ └── Sections
│ │ ├── GisServiceConfiguration.cs
│ │ ├── MethodCollection.cs
│ │ ├── MethodElement.cs
│ │ ├── ServiceCollection.cs
│ │ ├── ServiceElement.cs
│ │ ├── SigningConfiguration.cs
│ │ └── SoapConfiguration.cs
├── Helpers
│ ├── CsvHelper.cs
│ └── PathHelper.cs
├── Infrastructure
│ ├── Constants.cs
│ ├── GisSoapFormatter.cs
│ └── RussianSentenceBuilder.cs
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
├── Templates
│ ├── Inspection
│ │ ├── get-state-template.xml
│ │ └── import-inspection-plan-template.xml
│ ├── NsiAsync
│ │ ├── get-state-template.xml
│ │ └── import-municipal-services-template.xml
│ ├── NsiCommonAsync
│ │ ├── export-nsi-item-template.xml
│ │ ├── export-nsi-list-template.xml
│ │ └── get-state-template.xml
│ ├── is-request-header-template.xml
│ ├── request-header-template.xml
│ └── soap-template.xml
├── XadesDemo.csproj
└── packages.config
└── examples
├── exportNsiItem error request.csv
├── exportNsiItem error response.csv
├── exportNsiItem get-state error response.csv
├── exportNsiItem get-state response.csv
├── exportNsiItem request.csv
├── exportNsiItem response.csv
├── exportNsiList get-state response.csv
├── exportNsiList response.csv
├── importInspectionPlan get-state response error.csv
├── importInspectionPlan get-state response.csv
├── importInspectionPlan request error.csv
├── importInspectionPlan request.csv
├── importInspectionPlan response error.csv
├── importInspectionPlan response.csv
├── importMunicipalServices get-state response error.csv
├── importMunicipalServices request error.csv
├── importMunicipalServices response error.csv
├── importMunicipalServices response error1.csv
└── команды.txt
/.gitignore:
--------------------------------------------------------------------------------
1 | bin
2 | obj
3 | *.suo
4 | *.user
5 | packages
--------------------------------------------------------------------------------
/CommandLine/CommandLine.csproj.DotSettings:
--------------------------------------------------------------------------------
1 |
2 | True
3 | True
--------------------------------------------------------------------------------
/CommandLine/CommandLine.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.31101.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommandLine", "CommandLine.csproj", "{E1BD3C65-49C3-49E7-BABA-C60980CB3F20}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {E1BD3C65-49C3-49E7-BABA-C60980CB3F20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {E1BD3C65-49C3-49E7-BABA-C60980CB3F20}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {E1BD3C65-49C3-49E7-BABA-C60980CB3F20}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {E1BD3C65-49C3-49E7-BABA-C60980CB3F20}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/CommandLine/Core/ArgumentsExtensions.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005-2015 Giacomo Stelluti Scala & Contributors. All rights reserved. See License.md in the project root for license information.
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using CSharpx;
7 |
8 | namespace CommandLine.Core
9 | {
10 | static class ArgumentsExtensions
11 | {
12 | public static IEnumerable Preprocess(
13 | this IEnumerable arguments,
14 | IEnumerable<
15 | Func, IEnumerable>
16 | > preprocessorLookup)
17 | {
18 | return preprocessorLookup.TryHead().MapValueOrDefault(
19 | func =>
20 | {
21 | var errors = func(arguments);
22 | return errors.Any()
23 | ? errors
24 | : arguments.Preprocess(preprocessorLookup.TailNoFail());
25 | },
26 | Enumerable.Empty());
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/CommandLine/Core/KeyValuePairHelper.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005-2015 Giacomo Stelluti Scala & Contributors. All rights reserved. See License.md in the project root for license information.
2 |
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using CSharpx;
6 |
7 | namespace CommandLine.Core
8 | {
9 | static class KeyValuePairHelper
10 | {
11 | public static IEnumerable>> ForSwitch(
12 | IEnumerable tokens)
13 | {
14 | return tokens.Select(t => t.Text.ToKeyValuePair("true"));
15 | }
16 |
17 | public static IEnumerable>> ForScalar(
18 | IEnumerable tokens)
19 | {
20 | return tokens.Pairwise((f, s) => f.Text.ToKeyValuePair(s.Text));
21 | }
22 |
23 | public static IEnumerable>> ForSequence(
24 | IEnumerable tokens)
25 | {
26 | return from t in tokens.Pairwise(
27 | (f, s) =>
28 | f.IsName()
29 | ? f.Text.ToKeyValuePair(tokens.SkipWhile(t => !t.Equals(f)).SkipWhile(t => t.Equals(f)).TakeWhile(v => v.IsValue()).Select(x => x.Text).ToArray())
30 | : string.Empty.ToKeyValuePair())
31 | where t.Key.Length > 0 && t.Value.Any()
32 | select t;
33 | }
34 |
35 | private static KeyValuePair> ToKeyValuePair(this string value, params string[] values)
36 | {
37 | return new KeyValuePair>(value, values);
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/CommandLine/Core/NameExtensions.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005-2015 Giacomo Stelluti Scala & Contributors. All rights reserved. See License.md in the project root for license information.
2 |
3 | using System;
4 |
5 | namespace CommandLine.Core
6 | {
7 | static class NameExtensions
8 | {
9 | public static bool MatchName(this string value, string shortName, string longName, StringComparer comparer)
10 | {
11 | return value.Length == 1
12 | ? comparer.Equals(value, shortName)
13 | : comparer.Equals(value, longName);
14 | }
15 |
16 | public static NameInfo FromOptionSpecification(this OptionSpecification specification)
17 | {
18 | return new NameInfo(
19 | specification.ShortName,
20 | specification.LongName);
21 | }
22 |
23 | public static NameInfo FromSpecification(this Specification specification)
24 | {
25 | switch (specification.Tag)
26 | {
27 | case SpecificationType.Option:
28 | return FromOptionSpecification((OptionSpecification)specification);
29 | default:
30 | return NameInfo.EmptyName;
31 | }
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/CommandLine/Core/NameLookup.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005-2015 Giacomo Stelluti Scala & Contributors. All rights reserved. See License.md in the project root for license information.
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using CSharpx;
7 |
8 | namespace CommandLine.Core
9 | {
10 | enum NameLookupResult
11 | {
12 | NoOptionFound,
13 | BooleanOptionFound,
14 | OtherOptionFound
15 | }
16 |
17 | static class NameLookup
18 | {
19 | public static NameLookupResult Contains(string name, IEnumerable specifications, StringComparer comparer)
20 | {
21 | var option = specifications.FirstOrDefault(a => name.MatchName(a.ShortName, a.LongName, comparer));
22 | if (option == null) return NameLookupResult.NoOptionFound;
23 | return option.ConversionType == typeof(bool)
24 | ? NameLookupResult.BooleanOptionFound
25 | : NameLookupResult.OtherOptionFound;
26 | }
27 |
28 | public static Maybe HavingSeparator(string name, IEnumerable specifications,
29 | StringComparer comparer)
30 | {
31 | return specifications.SingleOrDefault(
32 | a => name.MatchName(a.ShortName, a.LongName, comparer) && a.Separator != '\0')
33 | .ToMaybe()
34 | .MapValueOrDefault(spec => Maybe.Just(spec.Separator), Maybe.Nothing());
35 | }
36 |
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/CommandLine/Core/OptionMapper.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2005-2015 Giacomo Stelluti Scala & Contributors. All rights reserved. See License.md in the project root for license information.
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using CSharpx;
7 | using RailwaySharp.ErrorHandling;
8 |
9 | namespace CommandLine.Core
10 | {
11 | static class OptionMapper
12 | {
13 | public static Result<
14 | IEnumerable, Error>
15 | MapValues(
16 | IEnumerable propertyTuples,
17 | IEnumerable>> options,
18 | Func, Type, bool, Maybe