Skip to content

Commit

Permalink
Fix Authenticode Response Encoding
Browse files Browse the repository at this point in the history
Should return DER encoded response
  • Loading branch information
Jemmy1228 committed Jun 15, 2019
1 parent d92509d commit 211809c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions LibTimeStamp/TSResponder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ private byte[] Authenticode(byte[] bRequest, DateTime signTime)
CmsSignedDataGenerator generator = new CmsSignedDataGenerator();
generator.AddSignerInfoGenerator(signerInfoBuilder.Build(signatureFactory, x509Cert));
generator.AddCertificates(x509Store);
byte[] result = generator.Generate(new CmsProcessableByteArray(octets), true).GetEncoded();
CmsSignedData cmsSignedData = generator.Generate(new CmsProcessableByteArray(octets), true);
byte[] result = cmsSignedData.ContentInfo.GetEncoded("DER");
return Encoding.ASCII.GetBytes(Convert.ToBase64String(result).ToArray());

}
}
}

0 comments on commit 211809c

Please sign in to comment.