pub struct sec_protocol_metadata { /* private fields */ }
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
impl sec_protocol_metadata
Sourcepub unsafe fn negotiated_protocol(
metadata: sec_protocol_metadata_t,
) -> *const c_char
👎Deprecated
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.
§Safety
metadata
must be a valid pointer.
Sourcepub unsafe fn copy_negotiated_protocol(
metadata: sec_protocol_metadata_t,
) -> *const c_char
pub unsafe fn copy_negotiated_protocol( metadata: sec_protocol_metadata_t, ) -> *const c_char
Copy the application protocol negotiated, e.g., via the TLS ALPN extension.
The caller is expected to free
the output string when no longer needed.
Parameter metadata
: A sec_protocol_metadata_t
instance.
Returns: A NULL-terminated string carrying the negotiated protocol.
§Safety
metadata
must be a valid pointer.
Sourcepub unsafe fn negotiated_tls_protocol_version(
metadata: sec_protocol_metadata_t,
) -> tls_protocol_version_t
Available on crate feature SecProtocolTypes
only.
pub unsafe fn negotiated_tls_protocol_version( metadata: sec_protocol_metadata_t, ) -> tls_protocol_version_t
SecProtocolTypes
only.Get the negotiated TLS version.
Parameter metadata
: A sec_protocol_metadata_t
instance.
Returns: A tls_protocol_version_t
value.
§Safety
metadata
must be a valid pointer.
Sourcepub unsafe fn negotiated_protocol_version(
metadata: sec_protocol_metadata_t,
) -> SSLProtocol
👎DeprecatedAvailable on crate feature SecProtocolTypes
only.
pub unsafe fn negotiated_protocol_version( metadata: sec_protocol_metadata_t, ) -> SSLProtocol
SecProtocolTypes
only.Get the negotiated TLS version.
Parameter metadata
: A sec_protocol_metadata_t
instance.
Returns: A SSLProtocol enum of the TLS version.
§Safety
metadata
must be a valid pointer.
Sourcepub unsafe fn negotiated_tls_ciphersuite(
metadata: sec_protocol_metadata_t,
) -> tls_ciphersuite_t
Available on crate feature SecProtocolTypes
only.
pub unsafe fn negotiated_tls_ciphersuite( metadata: sec_protocol_metadata_t, ) -> tls_ciphersuite_t
SecProtocolTypes
only.Get the negotiated TLS ciphersuite.
Parameter metadata
: A sec_protocol_metadata_t
instance.
Returns: A tls_ciphersuite_t
.
§Safety
metadata
must be a valid pointer.
Sourcepub unsafe fn negotiated_ciphersuite(
metadata: sec_protocol_metadata_t,
) -> SSLCipherSuite
👎DeprecatedAvailable on crate feature CipherSuite
only.
pub unsafe fn negotiated_ciphersuite( metadata: sec_protocol_metadata_t, ) -> SSLCipherSuite
CipherSuite
only.Get the negotiated TLS ciphersuite.
Parameter metadata
: A sec_protocol_metadata_t
instance.
Returns: A SSLCipherSuite.
§Safety
metadata
must be a valid pointer.
Sourcepub unsafe fn early_data_accepted(metadata: sec_protocol_metadata_t) -> bool
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.
§Safety
metadata
must be a valid pointer.
Sourcepub 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.
pub unsafe fn access_peer_certificate_chain( metadata: sec_protocol_metadata_t, handler: &DynBlock<dyn Fn(sec_certificate_t)>, ) -> bool
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.
§Safety
metadata
must be a valid pointer.
Sourcepub unsafe fn access_supported_signature_algorithms(
metadata: sec_protocol_metadata_t,
handler: &DynBlock<dyn Fn(u16)>,
) -> bool
Available on crate feature block2
only.
pub unsafe fn access_supported_signature_algorithms( metadata: sec_protocol_metadata_t, handler: &DynBlock<dyn Fn(u16)>, ) -> bool
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.
§Safety
metadata
must be a valid pointer.
Sourcepub unsafe fn server_name(metadata: sec_protocol_metadata_t) -> *const c_char
👎Deprecated
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.
§Safety
metadata
must be a valid pointer.
Sourcepub unsafe fn copy_server_name(
metadata: sec_protocol_metadata_t,
) -> *const c_char
pub unsafe fn copy_server_name( metadata: sec_protocol_metadata_t, ) -> *const c_char
Obtain a copy of the server name offered by a client or server during
connection establishmet. This is the value commonly carried
in the TLS SNI extesion. The caller is expected to free
the output
string when it is no longer needed.
Parameter metadata
: A sec_protocol_metadata_t
instance.
Returns: Returns A NULL-terminated string carrying the server name, or NULL if none was provided.
§Safety
metadata
must be a valid pointer.
Sourcepub unsafe fn peers_are_equal(
metadata_a: sec_protocol_metadata_t,
metadata_b: sec_protocol_metadata_t,
) -> bool
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.
§Safety
metadata_a
must be a valid pointer.metadata_b
must be a valid pointer.
Sourcepub unsafe fn challenge_parameters_are_equal(
metadata_a: sec_protocol_metadata_t,
metadata_b: sec_protocol_metadata_t,
) -> bool
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.
§Safety
metadata_a
must be a valid pointer.metadata_b
must be a valid pointer.
Trait Implementations§
Source§impl Debug for sec_protocol_metadata
impl Debug for sec_protocol_metadata
Source§impl RefEncode for sec_protocol_metadata
Available on crate feature objc2
only.
impl RefEncode for sec_protocol_metadata
objc2
only.