pub struct SecuritySetup { /* private fields */ }Expand description
Security setup interface class (class_id = 64) per IEC 62056-6-2 §4.4.7.
Holds the security policy, suite, system titles and certificates, and manages
the server’s symmetric keys.
Both versions are supported:
- version 0 — attributes 1..5, methods
security_activateandglobal_key_transfer; - version 1 — attributes 1..6 (adds
certificates), methods 1..8.
Only the mechanisms required by security suite 0 (AES-GCM-128) are
implemented: security_activate and the key transfer method. The PKI/ECDH
methods (key_agreement, generate_key_pair, certificate handling) belong
to suites 1 and 2 and return an unsupported error here.
Implementations§
Source§impl SecuritySetup
impl SecuritySetup
Sourcepub fn new(config: SecuritySetupConfig) -> Self
pub fn new(config: SecuritySetupConfig) -> Self
Builds a new SecuritySetup from its configuration.
Trait Implementations§
Source§impl Clone for SecuritySetup
impl Clone for SecuritySetup
Source§impl Debug for SecuritySetup
impl Debug for SecuritySetup
Source§impl<'de> Deserialize<'de> for SecuritySetup
impl<'de> Deserialize<'de> for SecuritySetup
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl InterfaceClass for SecuritySetup
impl InterfaceClass for SecuritySetup
Source§fn logical_name(&self) -> &ObisCode
fn logical_name(&self) -> &ObisCode
Returns the object’s logical name (OBIS code).
Source§fn attributes(&self) -> Vec<(u8, CosemDataType)>
fn attributes(&self) -> Vec<(u8, CosemDataType)>
Returns the class attributes as
(attribute_id, value) pairs.Source§fn serialize_ber(&self, buf: &mut Vec<u8>) -> Result<(), BerError>
fn serialize_ber(&self, buf: &mut Vec<u8>) -> Result<(), BerError>
Serializes the object into BER. Read more
Source§fn deserialize_ber(&mut self, data: &[u8]) -> Result<(), BerError>
fn deserialize_ber(&mut self, data: &[u8]) -> Result<(), BerError>
Deserializes the object from BER data. Read more
Source§fn set_attribute(
&mut self,
attribute_id: u8,
value: CosemDataType,
) -> Result<(), String>
fn set_attribute( &mut self, attribute_id: u8, value: CosemDataType, ) -> Result<(), String>
Writes the value of a writable attribute. The default implementation
rejects the write; classes with writable attributes override it. Read more
Source§fn invoke_method(
&mut self,
method_id: u8,
params: Option<CosemDataType>,
) -> Result<CosemDataType, String>
fn invoke_method( &mut self, method_id: u8, params: Option<CosemDataType>, ) -> Result<CosemDataType, String>
Invokes the object method with the given id. Read more
Auto Trait Implementations§
impl Freeze for SecuritySetup
impl RefUnwindSafe for SecuritySetup
impl Send for SecuritySetup
impl Sync for SecuritySetup
impl Unpin for SecuritySetup
impl UnsafeUnpin for SecuritySetup
impl UnwindSafe for SecuritySetup
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
Mutably borrows from an owned value. Read more