Lines Matching refs:Asn1Time
24 //! use openssl::asn1::Asn1Time;
25 //! let tomorrow = Asn1Time::days_from_now(1);
184 /// Asn1Time should be used to store and share time information
185 /// using certificates. If Asn1Time is set using a string, it must
192 pub struct Asn1Time;
193 /// Reference to an [`Asn1Time`]
195 /// [`Asn1Time`]: struct.Asn1Time.html
242 impl PartialEq<Asn1Time> for Asn1TimeRef {
243 fn eq(&self, other: &Asn1Time) -> bool {
251 impl<'a> PartialEq<Asn1Time> for &'a Asn1TimeRef {
252 fn eq(&self, other: &Asn1Time) -> bool {
267 impl PartialOrd<Asn1Time> for Asn1TimeRef {
268 fn partial_cmp(&self, other: &Asn1Time) -> Option<Ordering> {
274 impl<'a> PartialOrd<Asn1Time> for &'a Asn1TimeRef {
275 fn partial_cmp(&self, other: &Asn1Time) -> Option<Ordering> {
302 impl Asn1Time {
304 fn new() -> Result<Asn1Time, ErrorStack> {
309 Ok(Asn1Time::from_ptr(handle))
314 fn from_period(period: c_long) -> Result<Asn1Time, ErrorStack> {
319 Ok(Asn1Time::from_ptr(handle))
324 pub fn days_from_now(days: u32) -> Result<Asn1Time, ErrorStack> {
325 Asn1Time::from_period(days as c_long * 60 * 60 * 24)
330 pub fn from_unix(time: time_t) -> Result<Asn1Time, ErrorStack> {
335 Ok(Asn1Time::from_ptr(handle))
342 pub fn from_str(s: &str) -> Result<Asn1Time, ErrorStack> {
346 let time = Asn1Time::new()?;
358 pub fn from_str_x509(s: &str) -> Result<Asn1Time, ErrorStack> {
362 let time = Asn1Time::new()?;
371 impl PartialEq for Asn1Time {
372 fn eq(&self, other: &Asn1Time) -> bool {
380 impl PartialEq<Asn1TimeRef> for Asn1Time {
389 impl<'a> PartialEq<&'a Asn1TimeRef> for Asn1Time {
398 impl PartialOrd for Asn1Time {
399 fn partial_cmp(&self, other: &Asn1Time) -> Option<Ordering> {
405 impl PartialOrd<Asn1TimeRef> for Asn1Time {
412 impl<'a> PartialOrd<&'a Asn1TimeRef> for Asn1Time {
800 Asn1Time::from_str("99991231235959Z").unwrap();
802 Asn1Time::from_str_x509("99991231235959Z").unwrap();
807 let t = Asn1Time::from_unix(0).unwrap();
814 let a = Asn1Time::from_str("99991231235959Z").unwrap();
815 let b = Asn1Time::from_str("99991231235959Z").unwrap();
816 let c = Asn1Time::from_str("99991231235958Z").unwrap();
833 let a = Asn1Time::from_str("99991231235959Z").unwrap();
834 let b = Asn1Time::from_str("99991231235959Z").unwrap();
835 let c = Asn1Time::from_str("99991231235958Z").unwrap();