sec_protocol_metadata

Struct sec_protocol_metadata 

Source
#[repr(C)]
pub struct sec_protocol_metadata { /* private fields */ }
Available on crate feature SecProtocolMetadata only.
Expand description

A sec_protocol_metadata instance conatins read-only properties of a connected and configured security protocol. Clients use this object to read information about a protocol instance. Properties include, for example, the negotiated TLS version, ciphersuite, and peer certificates.

See also Apple’s documentation

Implementations§

Source§

impl sec_protocol_metadata

Source

pub unsafe fn negotiated_protocol( metadata: sec_protocol_metadata_t, ) -> *const c_char

Get the application protocol negotiated, e.g., via the TLS ALPN extension.

Parameter metadata: A sec_protocol_metadata_t instance.

Returns: A NULL-terminated string carrying the negotiated protocol.

Source

pub unsafe fn negotiated_tls_protocol_version( metadata: sec_protocol_metadata_t, ) -> tls_protocol_version_t

Available on crate feature SecProtocolTypes only.

Get the negotiated TLS version.

Parameter metadata: A sec_protocol_metadata_t instance.

Returns: A tls_protocol_version_t value.

Source

pub unsafe fn negotiated_protocol_version( metadata: sec_protocol_metadata_t, ) -> SSLProtocol

👎Deprecated
Available on crate feature SecProtocolTypes only.

Get the negotiated TLS version.

Parameter metadata: A sec_protocol_metadata_t instance.

Returns: A SSLProtocol enum of the TLS version.

Source

pub unsafe fn negotiated_tls_ciphersuite( metadata: sec_protocol_metadata_t, ) -> tls_ciphersuite_t

Available on crate feature SecProtocolTypes only.

Get the negotiated TLS ciphersuite.

Parameter metadata: A sec_protocol_metadata_t instance.

Returns: A tls_ciphersuite_t.

Source

pub unsafe fn negotiated_ciphersuite( metadata: sec_protocol_metadata_t, ) -> SSLCipherSuite

👎Deprecated
Available on crate feature CipherSuite only.

Get the negotiated TLS ciphersuite.

Parameter metadata: A sec_protocol_metadata_t instance.

Returns: A SSLCipherSuite.

Source

pub unsafe fn early_data_accepted(metadata: sec_protocol_metadata_t) -> bool

Determine if early data was accepted by the peer.

Parameter metadata: A sec_protocol_metadata_t instance.

Returns: A bool indicating if early data was accepted.

Source

pub unsafe fn access_peer_certificate_chain( metadata: sec_protocol_metadata_t, handler: &DynBlock<dyn Fn(sec_certificate_t)>, ) -> bool

Available on crate features SecProtocolTypes and block2 only.

Get the certificate chain of the protocol instance peer.

Parameter metadata: A sec_protocol_metadata_t instance.

Parameter handler: A block to invoke one or more times with sec_certificate_t objects

Returns: Returns true if the peer certificates were accessible, false otherwise.

Source

pub unsafe fn access_supported_signature_algorithms( metadata: sec_protocol_metadata_t, handler: &DynBlock<dyn Fn(u16)>, ) -> bool

Available on crate feature block2 only.

Get the signature algorithms supported by the peer. Clients may call this in response to a challenge block.

Parameter metadata: A sec_protocol_metadata_t instance.

Parameter handler: A block to invoke one or more times with OCSP data

Returns: Returns true if the supported signature list was accessible, false otherwise.

Source

pub unsafe fn server_name(metadata: sec_protocol_metadata_t) -> *const c_char

Obtain the server name offered by a client or server during connection establishmet. This is the value commonly carried in the TLS SNI extesion.

Parameter metadata: A sec_protocol_metadata_t instance.

Returns: Returns A NULL-terminated string carrying the server name, or NULL if none was provided.

Source

pub unsafe fn peers_are_equal( metadata_a: sec_protocol_metadata_t, metadata_b: sec_protocol_metadata_t, ) -> bool

Compare peer information for two sec_protocol_metadata instances. This comparison does not include protocol configuration options, e.g., ciphersuites.

Parameter metadataA: A sec_protocol_metadata_t instance.

Parameter metadataB: A sec_protocol_metadata_t instance.

Returns: Returns true if both metadata values refer to the same peer, and false otherwise.

Source

pub unsafe fn challenge_parameters_are_equal( metadata_a: sec_protocol_metadata_t, metadata_b: sec_protocol_metadata_t, ) -> bool

Compare challenge-relevant information for two sec_protocol_metadata instances.

This comparison includes all information relevant to a challenge request, including: distinguished names, signature algorithms, and supported certificate types. See Section 7.4.4 of RFC5246 for more details.

Parameter metadataA: A sec_protocol_metadata_t instance.

Parameter metadataB: A sec_protocol_metadata_t instance.

Returns: Returns true if both metadata values have the same challenge parameters.

Trait Implementations§

Source§

impl Debug for sec_protocol_metadata

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl RefEncode for sec_protocol_metadata

Available on crate feature objc2 only.
Source§

const ENCODING_REF: Encoding

The Objective-C type-encoding for a reference of this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> AutoreleaseSafe for T
where T: ?Sized,