Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue #410: Update Asn1GeneralizedTime.cs with more precision #410

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

RobLinux
Copy link

added 3 more rounds of precision in FromString

added 3 more rounds of precision in FromString
fixed 26 long precision ...
@RobLinux RobLinux changed the title Update Asn1GeneralizedTime.cs with more precision Fix for issue #410: Update Asn1GeneralizedTime.cs with more precision Dec 29, 2022
@peterdettman
Copy link
Collaborator

I think it is not so simple. The current class relies on not losing precision in the conversion to DateTime, where a tick is 100ns. So if the value has higher precision, probably ToDateTime() shouldn't be available (maybe there could be other methods that are clear about giving a "nearest" value of some kind, or methods to compare to a DateTime) , and also ToStringCanonical would have to operate on the high-precision string directly and not rely on conversion from DateTime.

@RobLinux
Copy link
Author

The thing is the current solution is not working with Apple ASN objects. So indeed some precisions would be lost, but at least the objects would be parsed correctly without exception.

What would you recommend in this case?

@RobLinux
Copy link
Author

RobLinux commented Apr 4, 2024

Any update on this ? what can we do ? it's actually a problem in my organization

@RobLinux
Copy link
Author

RobLinux commented Apr 4, 2024

Because the problem is that currently I can't deserialie a datetime with a higher precision, which is a problem.

@RobLinux
Copy link
Author

RobLinux commented Apr 4, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants