в с# примерах TSP нет)
вот кусочек кода под BouncyCastle:
byte[] hash = new SHA256Managed().ComputeHash(ASCIIEncoding.ASCII.GetBytes("TEST"));
TimeStampRequestGenerator reqGen = new TimeStampRequestGenerator();
reqGen.SetCertReq(true);
reqGen.SetReqPolicy("1.2.398.3.3.2.6.2");
TimeStampRequest request = reqGen.Generate(TspAlgorithms.Sha256, hash , BigInteger.ValueOf(100));
byte[] reqData = request.GetEncoded();
HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create("
178.89.4.221/tsp/");
httpReq.Method = "POST";
httpReq.ContentType = "application/timestamp-query";
httpReq.ContentLength = reqData.Length;
Stream reqStream = httpReq.GetRequestStream();
reqStream.Write(reqData, 0, reqData.Length);
reqStream.Close();
HttpWebResponse httpResp = (HttpWebResponse)httpReq.GetResponse();
Stream respStream = new BufferedStream(httpResp.GetResponseStream());
TimeStampResponse response = new TimeStampResponse(respStream);
TimeStampTokenInfo inf = response.TimeStampToken.TimeStampInfo;
//тут конечно же возникает ексепшн т.к. TstInfo = null
respStream.Close();
Вроде все тоже самое как в примере под Java, тем не менее почему то не проходит.