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

Add methods for comparing Asn1TimeRef and creating Asn1Time from Unix time #1173

Merged
merged 2 commits into from
Oct 22, 2019

Conversation

griff
Copy link
Contributor

@griff griff commented Oct 10, 2019

This implements a diff method on Asn1TimeRef using ASN1_TIME_diff and uses this new method to implement combinations of PartialEq and PartialOrd for Asn1Time and Asn1TimeRef.

It also adds a from_unix method to Asn1Time so that you can create a Asn1Time value from a time_t value.

This is mostly just a rework of the earlier work done by @illegalprime in his PR #673 and credit should go to him.

Solves #1157

@griff griff force-pushed the rework-673 branch 2 times, most recently from 2cf4159 to d21d51c Compare October 10, 2019 17:22
openssl/src/asn1.rs Outdated Show resolved Hide resolved
openssl/src/asn1.rs Outdated Show resolved Hide resolved
openssl/src/asn1.rs Outdated Show resolved Hide resolved
This implements a `diff` method on `Asn1TimeRef` using `ASN1_TIME_diff`
and uses this new method to implement combinations of `PartialEq` and
`PartialOrd` for `Asn1Time` and `Asn1TimeRef`.

This is mostly just a rework of the earlier work done by @illegalprime
in his PR sfackler#673 and credit should go to him.
This is mostly just a rework of the earlier work done by @illegalprime
in his PR sfackler#673 and credit should go to him.
@sfackler
Copy link
Owner

Thanks!

@sfackler sfackler merged commit dc72a8e into sfackler:master Oct 22, 2019
@griff griff deleted the rework-673 branch October 22, 2019 09:50
breard-r added a commit to breard-r/acmed that referenced this pull request Jun 12, 2020
The `openssl` crate now include methods to manipulate Asn1Time objects.
Before this improvement, the certificate had to be parsed from the DER
format using the `x509-parser` crate (which is therefore no longer
required).
sfackler/rust-openssl#1173
sfackler/rust-openssl#687
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