// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // Copyright by contributors to this project. // SPDX-License-Identifier: (Apache-2.0 OR MIT)
usecrate::error::IntoAnyError; #[cfg(mls_build_async)] use alloc::boxed::Box; use alloc::vec::Vec; use core::{
fmt::{self, Debug},
ops::Deref,
}; use mls_rs_codec::{MlsDecode, MlsEncode, MlsSize}; use zeroize::Zeroizing;
#[derive(Clone, PartialEq, Eq, MlsSize, MlsEncode, MlsDecode)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] /// Wrapper type that holds a pre-shared key value and zeroizes on drop. pubstruct PreSharedKey( #[mls_codec(with = "mls_rs_codec::byte_vec")] #[cfg_attr(feature = "serde", serde(with = "crate::zeroizing_serde"))]
Zeroizing<Vec<u8>>,
);
/// Storage trait to maintain a set of pre-shared key values. #[cfg_attr(not(mls_build_async), maybe_async::must_be_sync)] #[cfg_attr(mls_build_async, maybe_async::must_be_async)] pubtrait PreSharedKeyStorage: Send + Sync { /// Error type that the underlying storage mechanism returns on internal /// failure. type Error: IntoAnyError;
/// Get a pre-shared key by [`ExternalPskId`](ExternalPskId). /// /// `None` should be returned if a pre-shared key can not be found for `id`. asyncfn get(&self, id: &ExternalPskId) -> Result<Option<PreSharedKey>, Self::Error>;
/// Determines if a PSK is located within the store asyncfn contains(&self, id: &ExternalPskId) -> Result<bool, Self::Error> { self.get(id).await.map(|key| key.is_some())
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.20 Sekunden
(vorverarbeitet am 2026-06-18)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.