pub struct PskCryptoPlugin { /* private fields */ }Expand description
PSK-Crypto-Plugin. Class-Id "DDS:Crypto:PSK:AES-GCM-GMAC:1.2",
Wire-Layout = AES-GCM-Plugin.
Implementations§
Source§impl PskCryptoPlugin
impl PskCryptoPlugin
Sourcepub fn with_suite(suite: Suite) -> Self
pub fn with_suite(suite: Suite) -> Self
Konstruktor mit expliziter Suite.
Sourcepub fn register_psk(&mut self, psk_id: u64, key: Vec<u8>) -> SecurityResult<()>
pub fn register_psk(&mut self, psk_id: u64, key: Vec<u8>) -> SecurityResult<()>
Registriert einen Pre-Shared-Key. Der Caller adressiert ihn
spaeter via register_psk_remote ueber den gleichen
psk_id-Namespace. Im PSK-Pfad gibt es keinen Random-Phase,
d.h. Encrypt-Tokens werden via register_psk_remote direkt
ohne RNG generiert.
§Errors
BadArgument wenn der Key leer ist.
Sourcepub fn register_psk_remote(
&mut self,
local: CryptoHandle,
remote_identity: IdentityHandle,
psk_id: u64,
session_id: [u8; 4],
) -> SecurityResult<CryptoHandle>
pub fn register_psk_remote( &mut self, local: CryptoHandle, remote_identity: IdentityHandle, psk_id: u64, session_id: [u8; 4], ) -> SecurityResult<CryptoHandle>
Registriert einen Remote-Slot fuer einen bekannten PSK. Der
Plugin leitet via HKDF einen Per-Peer-Master-Key ab und
schreibt ihn als Wire-Token in den AES-GCM-Slot. Beide Seiten
muessen denselben PSK + dieselbe session_id verwenden, damit
die Decrypt-Seite passt.
§Errors
BadArgument wenn psk_id unbekannt; sonstige Crypto-Fehler.
Sourcepub fn register_psk_local(
&mut self,
psk_id: u64,
session_id: [u8; 4],
) -> SecurityResult<CryptoHandle>
pub fn register_psk_local( &mut self, psk_id: u64, session_id: [u8; 4], ) -> SecurityResult<CryptoHandle>
Registriert auch den lokalen Slot deterministisch aus
PSK + session_id — ueblicherweise aufgerufen statt
register_local_participant wenn man pure-PSK-Sym-Keys haben
will (beide Seiten rechnen den Key offline aus).
§Errors
Trait Implementations§
Source§impl CryptographicPlugin for PskCryptoPlugin
impl CryptographicPlugin for PskCryptoPlugin
Source§fn register_local_participant(
&mut self,
identity: IdentityHandle,
properties: &[(&str, &str)],
) -> SecurityResult<CryptoHandle>
fn register_local_participant( &mut self, identity: IdentityHandle, properties: &[(&str, &str)], ) -> SecurityResult<CryptoHandle>
Source§fn register_matched_remote_participant(
&mut self,
local: CryptoHandle,
remote_identity: IdentityHandle,
shared_secret: SharedSecretHandle,
) -> SecurityResult<CryptoHandle>
fn register_matched_remote_participant( &mut self, local: CryptoHandle, remote_identity: IdentityHandle, shared_secret: SharedSecretHandle, ) -> SecurityResult<CryptoHandle>
Source§fn register_local_endpoint(
&mut self,
participant: CryptoHandle,
is_writer: bool,
properties: &[(&str, &str)],
) -> SecurityResult<CryptoHandle>
fn register_local_endpoint( &mut self, participant: CryptoHandle, is_writer: bool, properties: &[(&str, &str)], ) -> SecurityResult<CryptoHandle>
Source§fn create_local_participant_crypto_tokens(
&mut self,
local: CryptoHandle,
remote: CryptoHandle,
) -> SecurityResult<Vec<u8>>
fn create_local_participant_crypto_tokens( &mut self, local: CryptoHandle, remote: CryptoHandle, ) -> SecurityResult<Vec<u8>>
ParticipantCryptoTokens-Blob, das an den Remote-
Participant gesendet wird (enthaelt verschluesseltes
Key-Material).Source§fn set_remote_participant_crypto_tokens(
&mut self,
local: CryptoHandle,
remote: CryptoHandle,
tokens: &[u8],
) -> SecurityResult<()>
fn set_remote_participant_crypto_tokens( &mut self, local: CryptoHandle, remote: CryptoHandle, tokens: &[u8], ) -> SecurityResult<()>
Source§fn encrypt_submessage(
&self,
local: CryptoHandle,
remote_list: &[CryptoHandle],
plaintext: &[u8],
aad_extension: &[u8],
) -> SecurityResult<Vec<u8>>
fn encrypt_submessage( &self, local: CryptoHandle, remote_list: &[CryptoHandle], plaintext: &[u8], aad_extension: &[u8], ) -> SecurityResult<Vec<u8>>
SecureSubmessage-Payload (ciphertext + tag). Read moreSource§fn decrypt_submessage(
&self,
local: CryptoHandle,
remote: CryptoHandle,
ciphertext: &[u8],
aad_extension: &[u8],
) -> SecurityResult<Vec<u8>>
fn decrypt_submessage( &self, local: CryptoHandle, remote: CryptoHandle, ciphertext: &[u8], aad_extension: &[u8], ) -> SecurityResult<Vec<u8>>
aad_extension
muss byte-identisch zur Sender-AAD sein (sonst Tag-Mismatch). Read moreSource§fn encrypt_submessage_multi(
&self,
local: CryptoHandle,
receivers: &[(CryptoHandle, u32)],
plaintext: &[u8],
aad_extension: &[u8],
) -> SecurityResult<(Vec<u8>, Vec<ReceiverMac>)>
fn encrypt_submessage_multi( &self, local: CryptoHandle, receivers: &[(CryptoHandle, u32)], plaintext: &[u8], aad_extension: &[u8], ) -> SecurityResult<(Vec<u8>, Vec<ReceiverMac>)>
Receiver-Specific-MACs (Spec
§7.3.6.3). Produziert einen Ciphertext (Sender-Key) plus
pro Remote einen 16-byte Truncated-HMAC. Read more