Why can't I detect digital signature time stamps for .NET 4.8 by WinCrypt
I cannot use WinCrypt to read the time stamps of digital signatures in.NET 4.8 files, I would like to ask is this Microsoft mechanism?
else if (unsignedAttribute.Oid.Value == WinCrypt.szOID_RSA_counterSign_USA)
{
foreach (var signedAttribute in signerInfo.UnsignedAttributes)
{
if (signedAttribute.Oid.Value == WinCrypt.szOID_RSA_signingTime_USA)
{
Pkcs9AttributeObject obj = new Pkcs9AttributeObject(signedAttribute.Values[0]);
SignedCms rfcTimestampMessage = new SignedCms();
rfcTimestampMessage.Decode(obj.RawData);
rfcTimestampMessage.CheckSignature(true);
foreach(var timeStampSignerInfo in rfcTimestampMessage.SignerInfos)
{
foreach(var timeStampAttribute in timeStampSignerInfo.SignedAttributes)
{
if (timeStampAttribute.Oid.Value == WinCrypt.szOID_RSA_signingTime)
{
Pkcs9SigningTime signingTime1 = (Pkcs9SigningTime)timeStampAttribute.Values[0];
strTimeStamp = signingTime1.SigningTime.ToLocalTime().ToString();
}
}
}
}
}
}
timeStampAttribute. Oid. Value = = WinCrypt. SzOID_RSA_signingTime
this statement can never be true, because no signingTime timeStampAttribute this Value. However, a timestamp is already shown in the file.
timeStampSignerInfo.SignedAttributes contains the values 1.2.840.113549.1.9.3 and 1.2.840.113549.1.9.4 but does not have 1.2.840.113549.1.9.5