pub struct X509 { /* private fields */ }Expand description
This implements the common core fields for x509 certificates. This information is likely logged with TLS sessions, digital signatures found in executable binaries, S/MIME information in email bodies, or analysis of files on disk.
When the certificate relates to a file, use the fields at file.x509. When hashes of the DER-encoded certificate are available, the hash data set should be populated as well (e.g. file.hash.sha256).
Events that contain certificate information about network connections, should use the x509 fields under the relevant TLS fields: tls.server.x509 and/or tls.client.x509.
Implementations§
Source§impl X509
impl X509
Sourcepub fn get_version_number(&self) -> Option<&String>
pub fn get_version_number(&self) -> Option<&String>
Version of x509 format.
Sourcepub fn set_version_number(&mut self, version_number_arg: String)
pub fn set_version_number(&mut self, version_number_arg: String)
Sourcepub fn get_serial_number(&self) -> Option<&String>
pub fn get_serial_number(&self) -> Option<&String>
Unique serial number issued by the certificate authority. For consistency, if this value is alphanumeric, it should be formatted without colons and uppercase characters.
Sourcepub fn set_serial_number(&mut self, serial_number_arg: String)
pub fn set_serial_number(&mut self, serial_number_arg: String)
Unique serial number issued by the certificate authority. For consistency, if this value is alphanumeric, it should be formatted without colons and uppercase characters.
§Example
55FBB9C7DEBF09809D12CCAA
Sourcepub fn get_issuer_distinguished_name(&self) -> Option<&String>
pub fn get_issuer_distinguished_name(&self) -> Option<&String>
Distinguished name (DN) of issuing certificate authority.
Sourcepub fn set_issuer_distinguished_name(
&mut self,
issuer_distinguished_name_arg: String,
)
pub fn set_issuer_distinguished_name( &mut self, issuer_distinguished_name_arg: String, )
Distinguished name (DN) of issuing certificate authority.
§Example
C=US, O=Example Inc, OU=www.example.com, CN=Example SHA2 High Assurance Server CA
Sourcepub fn get_issuer_common_name(&self) -> &Vec<String>
pub fn get_issuer_common_name(&self) -> &Vec<String>
List of common name (CN) of issuing certificate authority.
Sourcepub fn add_issuer_common_name(&mut self, issuer_common_name_arg: String)
pub fn add_issuer_common_name(&mut self, issuer_common_name_arg: String)
List of common name (CN) of issuing certificate authority.
§Example
Example SHA2 High Assurance Server CA
Sourcepub fn get_issuer_organizational_unit(&self) -> &Vec<String>
pub fn get_issuer_organizational_unit(&self) -> &Vec<String>
List of organizational units (OU) of issuing certificate authority.
Sourcepub fn add_issuer_organizational_unit(
&mut self,
issuer_organizational_unit_arg: String,
)
pub fn add_issuer_organizational_unit( &mut self, issuer_organizational_unit_arg: String, )
Sourcepub fn get_issuer_organization(&self) -> &Vec<String>
pub fn get_issuer_organization(&self) -> &Vec<String>
List of organizations (O) of issuing certificate authority.
Sourcepub fn add_issuer_organization(&mut self, issuer_organization_arg: String)
pub fn add_issuer_organization(&mut self, issuer_organization_arg: String)
Sourcepub fn get_issuer_locality(&self) -> &Vec<String>
pub fn get_issuer_locality(&self) -> &Vec<String>
List of locality names (L)
Sourcepub fn add_issuer_locality(&mut self, issuer_locality_arg: String)
pub fn add_issuer_locality(&mut self, issuer_locality_arg: String)
Sourcepub fn get_issuer_state_or_province(&self) -> &Vec<String>
pub fn get_issuer_state_or_province(&self) -> &Vec<String>
List of state or province names (ST, S, or P)
Sourcepub fn add_issuer_state_or_province(
&mut self,
issuer_state_or_province_arg: String,
)
pub fn add_issuer_state_or_province( &mut self, issuer_state_or_province_arg: String, )
Sourcepub fn get_issuer_country(&self) -> &Vec<String>
pub fn get_issuer_country(&self) -> &Vec<String>
List of country (C) codes
Sourcepub fn add_issuer_country(&mut self, issuer_country_arg: String)
pub fn add_issuer_country(&mut self, issuer_country_arg: String)
Sourcepub fn get_signature_algorithm(&self) -> Option<&String>
pub fn get_signature_algorithm(&self) -> Option<&String>
Identifier for certificate signature algorithm. We recommend using names found in Go Lang Crypto library. See https://github.com/golang/go/blob/go1.14/src/crypto/x509/x509.go#L337-L353.
Sourcepub fn set_signature_algorithm(&mut self, signature_algorithm_arg: String)
pub fn set_signature_algorithm(&mut self, signature_algorithm_arg: String)
Identifier for certificate signature algorithm. We recommend using names found in Go Lang Crypto library. See https://github.com/golang/go/blob/go1.14/src/crypto/x509/x509.go#L337-L353.
§Example
SHA256-RSA
Sourcepub fn get_not_before(&self) -> Option<&Timestamp>
pub fn get_not_before(&self) -> Option<&Timestamp>
Time at which the certificate is first considered valid.
Sourcepub fn set_not_before(&mut self, not_before_arg: Timestamp)
pub fn set_not_before(&mut self, not_before_arg: Timestamp)
Sourcepub fn get_not_after(&self) -> Option<&Timestamp>
pub fn get_not_after(&self) -> Option<&Timestamp>
Time at which the certificate is no longer considered valid.
Sourcepub fn set_not_after(&mut self, not_after_arg: Timestamp)
pub fn set_not_after(&mut self, not_after_arg: Timestamp)
Sourcepub fn get_subject_distinguished_name(&self) -> Option<&String>
pub fn get_subject_distinguished_name(&self) -> Option<&String>
Distinguished name (DN) of the certificate subject entity.
Sourcepub fn set_subject_distinguished_name(
&mut self,
subject_distinguished_name_arg: String,
)
pub fn set_subject_distinguished_name( &mut self, subject_distinguished_name_arg: String, )
Distinguished name (DN) of the certificate subject entity.
§Example
C=US, ST=California, L=San Francisco, O=Example, Inc., CN=shared.global.example.net
Sourcepub fn get_subject_common_name(&self) -> &Vec<String>
pub fn get_subject_common_name(&self) -> &Vec<String>
List of common names (CN) of subject.
Sourcepub fn add_subject_common_name(&mut self, subject_common_name_arg: String)
pub fn add_subject_common_name(&mut self, subject_common_name_arg: String)
Sourcepub fn get_subject_organizational_unit(&self) -> &Vec<String>
pub fn get_subject_organizational_unit(&self) -> &Vec<String>
List of organizational units (OU) of subject.
Sourcepub fn add_subject_organizational_unit(
&mut self,
subject_organizational_unit_arg: String,
)
pub fn add_subject_organizational_unit( &mut self, subject_organizational_unit_arg: String, )
List of organizational units (OU) of subject.
Sourcepub fn get_subject_organization(&self) -> &Vec<String>
pub fn get_subject_organization(&self) -> &Vec<String>
List of organizations (O) of subject.
Sourcepub fn add_subject_organization(&mut self, subject_organization_arg: String)
pub fn add_subject_organization(&mut self, subject_organization_arg: String)
Sourcepub fn get_subject_locality(&self) -> &Vec<String>
pub fn get_subject_locality(&self) -> &Vec<String>
List of locality names (L)
Sourcepub fn add_subject_locality(&mut self, subject_locality_arg: String)
pub fn add_subject_locality(&mut self, subject_locality_arg: String)
Sourcepub fn get_subject_state_or_province(&self) -> &Vec<String>
pub fn get_subject_state_or_province(&self) -> &Vec<String>
List of state or province names (ST, S, or P)
Sourcepub fn add_subject_state_or_province(
&mut self,
subject_state_or_province_arg: String,
)
pub fn add_subject_state_or_province( &mut self, subject_state_or_province_arg: String, )
Sourcepub fn get_subject_country(&self) -> &Vec<String>
pub fn get_subject_country(&self) -> &Vec<String>
List of country (C) code
Sourcepub fn add_subject_country(&mut self, subject_country_arg: String)
pub fn add_subject_country(&mut self, subject_country_arg: String)
Sourcepub fn get_public_key_algorithm(&self) -> Option<&String>
pub fn get_public_key_algorithm(&self) -> Option<&String>
Algorithm used to generate the public key.
Sourcepub fn set_public_key_algorithm(&mut self, public_key_algorithm_arg: String)
pub fn set_public_key_algorithm(&mut self, public_key_algorithm_arg: String)
Sourcepub fn get_public_key_size(&self) -> Option<&u64>
pub fn get_public_key_size(&self) -> Option<&u64>
The size of the public key space in bits.
Sourcepub fn set_public_key_size(&mut self, public_key_size_arg: u64)
pub fn set_public_key_size(&mut self, public_key_size_arg: u64)
Sourcepub fn get_public_key_exponent(&self) -> Option<&u64>
pub fn get_public_key_exponent(&self) -> Option<&u64>
Exponent used to derive the public key. This is algorithm specific.
Sourcepub fn set_public_key_exponent(&mut self, public_key_exponent_arg: u64)
pub fn set_public_key_exponent(&mut self, public_key_exponent_arg: u64)
Sourcepub fn get_public_key_curve(&self) -> Option<&String>
pub fn get_public_key_curve(&self) -> Option<&String>
The curve used by the elliptic curve public key algorithm. This is algorithm specific.
Sourcepub fn set_public_key_curve(&mut self, public_key_curve_arg: String)
pub fn set_public_key_curve(&mut self, public_key_curve_arg: String)
The curve used by the elliptic curve public key algorithm. This is algorithm specific.
§Example
nistp521
Sourcepub fn get_alternative_names(&self) -> &Vec<String>
pub fn get_alternative_names(&self) -> &Vec<String>
List of subject alternative names (SAN). Name types vary by certificate authority and certificate type but commonly contain IP addresses, DNS names (and wildcards), and email addresses.
Sourcepub fn add_alternative_name(&mut self, alternative_name_arg: String)
pub fn add_alternative_name(&mut self, alternative_name_arg: String)
List of subject alternative names (SAN). Name types vary by certificate authority and certificate type but commonly contain IP addresses, DNS names (and wildcards), and email addresses.
§Example
*.elastic.co