pub struct PeerPolicy { /* private fields */ }Expand description
Which signed peers a host accepts. Build it with PeerPolicy::signed_by and
or_signed_by; only the identities that belong to the running
platform are consulted, and a policy with none for it refuses every peer.
Implementations§
Source§impl PeerPolicy
impl PeerPolicy
Sourcepub fn signed_by(identity: SigningIdentity) -> Self
pub fn signed_by(identity: SigningIdentity) -> Self
Accept a peer signed by identity.
Sourcepub fn or_signed_by(self, identity: SigningIdentity) -> Self
pub fn or_signed_by(self, identity: SigningIdentity) -> Self
Also accept a peer signed by identity (the macOS and the Windows identity of one
product, say).
Sourcepub fn only_executable(self, path: impl Into<PathBuf>) -> Self
pub fn only_executable(self, path: impl Into<PathBuf>) -> Self
Additionally require the peer’s executable to be one of these paths (compared as
HostExpectation compares). Without any, the signature alone decides.
Sourcepub fn signers(&self) -> &[SigningIdentity]
pub fn signers(&self) -> &[SigningIdentity]
The identities this policy names.
Sourcepub fn host_expectation(&self) -> HostExpectation
pub fn host_expectation(&self) -> HostExpectation
This policy as a HostExpectation (the optional executable pins plus the signature
verifier), for an API that takes an expectation, such as
LicenseGate::deliver_from_owner(cx, &policy.host_expectation(), frame) in
rightkit-agent-server (rightkit#1501). Used with CallContext::verify_peer_executable
it gives the same answer as CallContext::verify_peer_signed.