pub struct ScPrincipal { /* private fields */ }Expand description
Who sent a request, as far as this node can prove it: the leaf certificate of a verified direct BACnet/SC connection.
It is the SHA-256 of the exact leaf certificate DER the TLS handshake
verified, the same digest the hub’s certificate bindings pin
(ScHubCertificateBinding, with the sc-tls feature).
Unlike DirectScIdentity, it carries no
connection incarnation, so it stays the same when that certificate
reconnects. A renewed certificate is a new principal; list both while it
rolls out.
Only direct SC ingress has one. Requests over B/IP, B/IPv6, MS/TP and Ethernet have none, and neither do requests a hub relays: the hub authenticated its own TLS client, and the origin’s certificate never reaches this node. The VMAC, UUID and routed SNET/SADR a peer sends are claims, never principals. A direct peer that forwards a routed request is only the router: the server’s policy contexts report its principal as the forwarding peer’s and give the routed request none.
A principal identifies; it doesn’t authorize. Compare it against the
fingerprints an installation provisions. Building one with
from_leaf_sha256 makes such a pin; it can’t
make a request carry it.
Debug shows only the first eight hex digits; Display writes all 64
in lowercase, the form to copy into configuration. Neither
shows any other certificate content.
Implementations§
Source§impl ScPrincipal
impl ScPrincipal
Sourcepub const fn from_leaf_sha256(leaf_sha256: [u8; 32]) -> ScPrincipal
pub const fn from_leaf_sha256(leaf_sha256: [u8; 32]) -> ScPrincipal
The principal whose leaf certificate DER has SHA-256 leaf_sha256,
for comparing against the principal a request carries.
Sourcepub const fn leaf_sha256(&self) -> [u8; 32]
pub const fn leaf_sha256(&self) -> [u8; 32]
SHA-256 of the leaf certificate DER.
Trait Implementations§
Source§impl Clone for ScPrincipal
impl Clone for ScPrincipal
Source§fn clone(&self) -> ScPrincipal
fn clone(&self) -> ScPrincipal
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more