Share via

Microsoft is not supported. NET 4.8 Time stamp of the digital signature.

Anonymous
2024-11-11T09:06:55+00:00

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();

                                            }                                                    

                                        }

                                    }

                                }

                            }

                        }

Windows for home | Windows 10 | Internet and connectivity

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Anonymous
    2024-11-12T06:56:50+00:00

    Hello, Reus Weijie Hu

    Welcome to the Microsoft Community.

    Thanks for visiting Microsoft Community.  

    I wish I could handle your problem, however, it is more suitable for publishing on Microsoft Learn, more users post these issues there, you can click on "Ask a question", there are experts who can provide more professional solutions in that place.  

    Here is a link to the forum where you can raise specific scenarios and share your idea to help solve the problem.  

    Windows API - Win32 - Microsoft Q&A

    Sincerely hope that your question will be dealt with appropriately after contact the correct department. Thank you for your understanding! 

    Best regards

    Bobhe | Microsoft Community Support Specialist

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2024-11-11T09:09:38+00:00

    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.

    Was this answer helpful?

    0 comments No comments