pub struct PskReceiver { /* private fields */ }
Expand description
The PskReceiver
is used along with the [PskProvider
] to perform TLS
1.3 out-of-band PSK authentication, using PSK’s generated from KMS.
This struct can be enabled on a config with s2n_tls::config::Builder::set_client_hello_callback
.
Implementations§
Source§impl PskReceiver
impl PskReceiver
Sourcepub fn new(
kms_client: Client,
trusted_key_arns: Vec<KeyArn>,
obfuscation_keys: Vec<ObfuscationKey>,
) -> Self
pub fn new( kms_client: Client, trusted_key_arns: Vec<KeyArn>, obfuscation_keys: Vec<ObfuscationKey>, ) -> Self
Create a new PskReceiver.
This will receive the ciphertext datakey identities from a TLS client hello, then decrypt them using KMS. This establishes a mutually authenticated TLS handshake between parties with IAM permissions to generate and decrypt data keys
-
kms_client
: The KMS Client that will be used for the decrypt calls -
trusted_key_arns
: The list of KMS KeyArns that the PskReceiver will accept PSKs from. This is necessary because an attacker could grant the server decrypt permissions on AttackerKeyArn, but the PskReceiver should not trust any Psk’s from AttackerKeyArn. -
obfuscation_keys
: The keys that will be used to deobfuscate the received identities. The clientPskProvider
must be using one of the obfuscation keys in this list. If the PskReceiver receives a Psk identity obfuscated using a key not on this list, then the handshake will fail.
Trait Implementations§
Source§impl ClientHelloCallback for PskReceiver
impl ClientHelloCallback for PskReceiver
Source§fn on_client_hello(
&self,
connection: &mut Connection,
) -> Result<Option<Pin<Box<dyn ConnectionFuture>>>, Error>
fn on_client_hello( &self, connection: &mut Connection, ) -> Result<Option<Pin<Box<dyn ConnectionFuture>>>, Error>
Ok(None)
to resolve the callback
synchronously or return an Ok(Some(ConnectionFuture))
if it wants to
run some asynchronous task before resolving the callback. Read moreAuto Trait Implementations§
impl Freeze for PskReceiver
impl !RefUnwindSafe for PskReceiver
impl Send for PskReceiver
impl Sync for PskReceiver
impl Unpin for PskReceiver
impl !UnwindSafe for PskReceiver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more