/// <summary> /// Default constructor using default TSA client of the application configuration. /// </summary> /// <remarks> /// <para> /// When this constructor is used, the application configuration is searched for a TSA client with the name "Xades.TSA". /// </para> /// <para> /// The exact configuration requirements depend on the TSA and should be obtained from them. /// </para> /// </remarks> public DssTimestampProvider() { client = new DSS.TimeStampAuthorityClient(); }
/// <summary> /// Constructor using a TSA client with the provided configuration. /// </summary> /// <remarks> /// <para> /// When this constructor is used, the application configuration is searched for a TSA client with the provided name. /// </para> /// <para> /// The exact configuration requirements depend on the TSA and should be obtained from them. /// </para> /// </remarks> /// <param name="config">The configuration name of the TSA client</param> public DssTimestampProvider(String config) { client = new DSS.TimeStampAuthorityClient(config); }
/// <summary> /// Constructor using a provided TSA client. /// </summary> /// <remarks> /// <para> /// When this constructor is used, the application configuration isn't used. /// </para> /// <para> /// The exact configuration requirements depend on the TSA and should be obtained from them. /// </para> /// </remarks> /// <example> /// <code language="C#"> /// var tsa = new TSA.DSS.TimeStampAuthorityClient(new BasicHttpBinding(), new EndpointAddress("http://www.ca.com/TSA")); /// tsa.ClientCredentials.ClientCertificate.Certificate = certificate; /// var tsProvider = new DssTimestampProvider(tsa); /// </code> /// </example> /// <param name="client">The pre-configured instance of the TSA client.</param> public DssTimestampProvider(DSS.TimeStampAuthorityClient client) { this.client = client; }
/// <summary> /// Constructor using a provided TSA client. /// </summary> /// <remarks> /// <para> /// When this constructor is used, the application configuration isn't used. /// </para> /// <para> /// The eHealth TSA requires the StsBinding as provided by the eH-I codeplex project. /// </para> /// </remarks> /// <example> /// <code language="C#"> /// tsa = new TSA.DSS.TimeStampAuthorityClient(new StsBinding(), new EndpointAddress("https://wwwacc.ehealth.fgov.be/timestampauthority_1_5/timestampauthority")); /// tsa.Endpoint.Behaviors.Remove<ClientCredentials>(); /// tsa.Endpoint.Behaviors.Add(new OptClientCredentials()); /// tsa.ClientCredentials.ClientCertificate.Certificate = certificate; /// var tsProvider = new EHealthTimestampProvider(tsa); /// </code> /// </example> /// <param name="client">The pre-configured instance of the TSA client.</param> public EHealthTimestampProvider(DSS.TimeStampAuthorityClient client) : base(client) { Profile = "urn:ehealth:profiles:timestamping:2.1-cert"; }