@@ -423,6 +423,20 @@ impl X509Ref {
423
423
}
424
424
}
425
425
426
+ /// Returns this certificate's CRL distribution points, if they exist.
427
+ #[ corresponds( X509_get_ext_d2i ) ]
428
+ pub fn crl_distribution_points ( & self ) -> Option < Stack < DistPoint > > {
429
+ unsafe {
430
+ let stack = ffi:: X509_get_ext_d2i (
431
+ self . as_ptr ( ) ,
432
+ ffi:: NID_crl_distribution_points ,
433
+ ptr:: null_mut ( ) ,
434
+ ptr:: null_mut ( ) ,
435
+ ) ;
436
+ Stack :: from_ptr_opt ( stack as * mut _ )
437
+ }
438
+ }
439
+
426
440
/// Returns this certificate's issuer alternative name entries, if they exist.
427
441
#[ corresponds( X509_get_ext_d2i ) ]
428
442
pub fn issuer_alt_names ( & self ) -> Option < Stack < GeneralName > > {
@@ -1927,6 +1941,49 @@ impl Stackable for GeneralName {
1927
1941
type StackType = ffi:: stack_st_GENERAL_NAME ;
1928
1942
}
1929
1943
1944
+ foreign_type_and_impl_send_sync ! {
1945
+ type CType = ffi:: DIST_POINT ;
1946
+ fn drop = ffi:: DIST_POINT_free ;
1947
+
1948
+ /// A `X509` distribution point.
1949
+ pub struct DistPoint ;
1950
+ /// Reference to `DistPoint`.
1951
+ pub struct DistPointRef ;
1952
+ }
1953
+
1954
+ impl DistPointRef {
1955
+ /// Returns the name of this distribution point if it exists
1956
+ pub fn distpoint ( & self ) -> Option < & DistPointNameRef > {
1957
+ unsafe { DistPointNameRef :: from_const_ptr_opt ( ( * self . as_ptr ( ) ) . distpoint ) }
1958
+ }
1959
+ }
1960
+
1961
+ foreign_type_and_impl_send_sync ! {
1962
+ type CType = ffi:: DIST_POINT_NAME ;
1963
+ fn drop = ffi:: DIST_POINT_NAME_free ;
1964
+
1965
+ /// A `X509` distribution point.
1966
+ pub struct DistPointName ;
1967
+ /// Reference to `DistPointName`.
1968
+ pub struct DistPointNameRef ;
1969
+ }
1970
+
1971
+ impl DistPointNameRef {
1972
+ /// Returns the contents of this DistPointName if it is a fullname.
1973
+ pub fn fullname ( & self ) -> Option < & StackRef < GeneralName > > {
1974
+ unsafe {
1975
+ if ( * self . as_ptr ( ) ) . type_ != 0 {
1976
+ return None ;
1977
+ }
1978
+ StackRef :: from_const_ptr_opt ( ( * self . as_ptr ( ) ) . name . fullname )
1979
+ }
1980
+ }
1981
+ }
1982
+
1983
+ impl Stackable for DistPoint {
1984
+ type StackType = ffi:: stack_st_DIST_POINT ;
1985
+ }
1986
+
1930
1987
foreign_type_and_impl_send_sync ! {
1931
1988
type CType = ffi:: ACCESS_DESCRIPTION ;
1932
1989
fn drop = ffi:: ACCESS_DESCRIPTION_free ;
0 commit comments