Expose subject_name_hash

This commit is contained in:
marcelbuesing 2020-03-06 16:52:44 +01:00
parent 08d8367ff2
commit 1cffc2b575
No known key found for this signature in database
GPG Key ID: 5E8C5624159F80BB
2 changed files with 7 additions and 0 deletions

View File

@ -228,6 +228,8 @@ extern "C" {
pub fn X509_set_serialNumber(x: *mut X509, sn: *mut ASN1_INTEGER) -> c_int; pub fn X509_set_serialNumber(x: *mut X509, sn: *mut ASN1_INTEGER) -> c_int;
pub fn X509_get_serialNumber(x: *mut X509) -> *mut ASN1_INTEGER; pub fn X509_get_serialNumber(x: *mut X509) -> *mut ASN1_INTEGER;
pub fn X509_set_issuer_name(x: *mut X509, name: *mut X509_NAME) -> c_int; pub fn X509_set_issuer_name(x: *mut X509, name: *mut X509_NAME) -> c_int;
pub fn X509_subject_name_hash(x: *mut ::X509) -> c_ulong;
} }
cfg_if! { cfg_if! {
if #[cfg(any(ossl110, libressl280))] { if #[cfg(any(ossl110, libressl280))] {

View File

@ -398,6 +398,11 @@ impl X509Ref {
} }
} }
/// Returns the hash of the certificates subject
pub fn subject_name_hash(&self) -> u64 {
unsafe { ffi::X509_subject_name_hash(self.as_ptr()) }
}
/// Returns this certificate's issuer name. /// Returns this certificate's issuer name.
/// ///
/// This corresponds to [`X509_get_issuer_name`]. /// This corresponds to [`X509_get_issuer_name`].