Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3359168
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:50:23+00:00 2026-05-18T02:50:23+00:00

How do I use current date & time as the value for the findValue

  • 0

How do I use current date & time as the value for the findValue attribute in the ServiceCertificate config when using “FindByTimeValid” for the x509FindType? Using DateTime.Now as below obiously doesn’t work but neither does “2010-10-20 14:35:28Z”. I have two certificates on the server with the same details as one of them has expired which is why I’m using this find type value.

For example:

<serviceCredentials>
        <serviceCertificate findValue="DateTime.Now" x509FindType="FindByTimeValid" storeLocation="LocalMachine" storeName="My"/>
</serviceCredentials>

Edit: I fixed this by removing the expired certificate but I’m still curious if this is possible.

Thanks

Keith

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T02:50:23+00:00Added an answer on May 18, 2026 at 2:50 am

    As no-one seems slightly interested in this question (2 views in a month and I think at least one of them was me) I decided to break out Reflector and have a look at the process and have found the following.

    In the X509Certificate2Collection.FindCertInStore(SafeCertStoreHandle safeSourceStoreHandle, X509FindType findType, object findValue, bool validOnly) method of the System.ServiceModel assembly we have the following code

    case X509FindType.FindByTimeValid:
    if (findValue.GetType() != typeof(DateTime))
    {
        throw new CryptographicException(SR.GetString("Cryptography_X509_InvalidFindValue"));
    }
    

    As you can see from the signature the findValue comes in as an object which I think is in turn loaded by the config parser as a string which means this will never work.

    So the answer is you can’t do this though the xml config but you can if you do it programmatically.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I've got a text input that get's date & time in this format:
I am using mysqldump to backup mysql database. Now I just need to use
Is there any difference between the following operations? (Advance current date to 160 days)
I have embedded the fullcalendar jquery control by using this code: $(document).ready(function() { var
I have the following code for use in my asp.net website: CalendarService service =
I have xml file with data that i have to display in table. Now
i need to get a difference of two dates ,one date from a table
I have created a web application which is creating and updating the xml file
As mentioned in the title, my paginator doesn't show anything when I click to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.