pub struct PluginArtifact {
pub registration: RegistrationInfo,
pub bytes: Vec<u8>,
pub key_fingerprint: Option<String>,
}Expand description
External registration data together with the bytes that produced it. 外部注册声明及其对应的插件字节。
A trusted build consumes this type instead of accepting an unverified
RegistrationInfo. The implementation stays opaque to the registry.
严格构建只接收这个类型,不直接接收未验证的 RegistrationInfo;注册机仍不接触实现。
Fields§
§registration: RegistrationInfoRegistration data the plugin bytes are claimed to produce. 插件字节声称产出的注册声明。
bytes: Vec<u8>Raw plugin bytes covered by the manifest checksum. manifest 摘要所覆盖的原始插件字节。
key_fingerprint: Option<String>Fingerprint of the key that signed these bytes, when the host supplied one. 签名这些字节的密钥指纹;宿主未提供时为 None。
Implementations§
Source§impl PluginArtifact
impl PluginArtifact
Sourcepub fn verify_artifact(
self,
policy: PluginTrustPolicy,
) -> Result<VerifiedPluginArtifact, PluginTrustError>
pub fn verify_artifact( self, policy: PluginTrustPolicy, ) -> Result<VerifiedPluginArtifact, PluginTrustError>
Verify bytes and return the only artifact accepted by execution hosts. 校验字节,并返回执行宿主唯一接受的工件类型。
Sourcepub fn verify_signed(
self,
policy: PluginTrustPolicy,
verifier: &impl PluginSignatureVerifier,
) -> Result<VerifiedPluginArtifact, PluginTrustError>
pub fn verify_signed( self, policy: PluginTrustPolicy, verifier: &impl PluginSignatureVerifier, ) -> Result<VerifiedPluginArtifact, PluginTrustError>
Verify the bytes under policy and ask the host’s signature verifier,
recording the stronger assurance that second check buys.
在 policy 下校验字节,并询问宿主的签名验证器,记录第二次校验换来的更强保证。
This is the only constructor of PluginAssurance::Signature, and therefore
the only way into a channel that requires it
(PluginChannel::Official). Revocation is
consulted before the verifier is asked, because the policy runs first:
a revoked version is refused here exactly as it is on the digest-only path,
whatever the signature says. Without this entry point the Official lane
could never admit anything, and the control the threat model names would
never run.
这是 PluginAssurance::Signature 的唯一构造入口,因而也是进入要求该等级的通道
(PluginChannel::Official)的唯一途径。撤销在询问
验证器之前就被检查,因为策略先运行:无论签名说什么,已吊销版本在这里与纯摘要路径上
一样被拒。没有这个入口,Official 通道永远接纳不了任何东西,威胁模型点名的那个控制也就
永远不会运行。
Trait Implementations§
Source§impl Clone for PluginArtifact
impl Clone for PluginArtifact
Source§fn clone(&self) -> PluginArtifact
fn clone(&self) -> PluginArtifact
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more