pub struct Trust {
pub anchors: Vec<Pem>,
pub pins: Vec<Fingerprint>,
}Expand description
Whom a peer is accepted as.
A peer is accepted if its public-key fingerprint is one of pins, or
its certificate chains to one of anchors and names the host that was
dialled. An address that names a fingerprint
(weida://sha256:…@host:port/path) overrides both: only that identity is
accepted on that connection.
An empty Trust — Trust::by_address — accepts nothing but what the
address names. Dialling an address without a fingerprint under it fails
before any packet is sent. There is no platform root store and no
verification bypass anywhere in the shipped code.
Fields§
§anchors: Vec<Pem>PEM sources holding certificate-authority certificates.
pins: Vec<Fingerprint>Public-key fingerprints accepted outright.
Implementations§
Source§impl Trust
impl Trust
Sourcepub fn by_address() -> Trust
pub fn by_address() -> Trust
Trust only what each dialled address names.
Sourcepub fn pin(fingerprint: Fingerprint) -> Trust
pub fn pin(fingerprint: Fingerprint) -> Trust
Trust one public-key fingerprint.
Sourcepub fn anchor(pem: impl Into<Vec<u8>>) -> Trust
pub fn anchor(pem: impl Into<Vec<u8>>) -> Trust
Trust the certificate authorities in one PEM buffer.
Sourcepub fn anchor_file(path: impl Into<PathBuf>) -> Trust
pub fn anchor_file(path: impl Into<PathBuf>) -> Trust
Trust the certificate authorities in one PEM file.
Sourcepub fn and_pin(self, fingerprint: Fingerprint) -> Trust
pub fn and_pin(self, fingerprint: Fingerprint) -> Trust
Adds a fingerprint.
Sourcepub fn and_anchor(self, pem: impl Into<Vec<u8>>) -> Trust
pub fn and_anchor(self, pem: impl Into<Vec<u8>>) -> Trust
Adds the certificate authorities in a PEM buffer.
Sourcepub fn and_anchor_file(self, path: impl Into<PathBuf>) -> Trust
pub fn and_anchor_file(self, path: impl Into<PathBuf>) -> Trust
Adds the certificate authorities in a PEM file.