Skip to main content

PluginArtifact

Struct PluginArtifact 

Source
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: RegistrationInfo

Registration 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

Source

pub fn verify_artifact( self, policy: PluginTrustPolicy, ) -> Result<VerifiedPluginArtifact, PluginTrustError>

Verify bytes and return the only artifact accepted by execution hosts. 校验字节,并返回执行宿主唯一接受的工件类型。

Source

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

Source§

fn clone(&self) -> PluginArtifact

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PluginArtifact

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.