Skip to main content

PluginManifest

Struct PluginManifest 

Source
pub struct PluginManifest {
    pub name: &'static str,
    pub crate_name: &'static str,
    pub version: &'static str,
    pub framework: FrameworkId,
    pub source: PluginSource,
    pub mode: PluginMode,
    pub checksum: &'static str,
    pub signature: Option<&'static str>,
    pub public_key_fingerprint: Option<&'static str>,
    pub revocation_list: Option<&'static str>,
}
Expand description

Plugin manifest metadata. 插件 manifest 元数据。

Fields§

§name: &'static str

Manifest name; trust and lock checks match on this package identity. manifest 名称;信任与锁检查以它作为包身份匹配。

§crate_name: &'static str

Rust crate that carries the plugin implementation. 承载插件实现的 Rust crate。

§version: &'static str

Declared plugin version. 声明的插件版本。

§framework: FrameworkId

Host framework the plugin targets. 插件针对的宿主框架。

§source: PluginSource

Trust lane the plugin came from. 插件的来源信任通道。

§mode: PluginMode

Whether the plugin extends or replaces a slot. 插件是扩展还是替换插槽。

§checksum: &'static str

Digest of the plugin bytes, optionally carrying a sha256: prefix. 插件字节的摘要,可带 sha256: 前缀。

§signature: Option<&'static str>

Hex-encoded Ed25519 signature over signing_payload, when supplied. signing_payload 上的十六进制 Ed25519 签名;插件没有签名时为 None。

§public_key_fingerprint: Option<&'static str>

Fingerprint of the public key used for the signature. 用于签名的公钥指纹。

§revocation_list: Option<&'static str>

Identifier of the revocation-list snapshot used by the publisher. 发布者使用的撤销列表快照标识。

Implementations§

Source§

impl PluginManifest

Source

pub fn targets(self, framework: FrameworkId) -> bool

Whether the manifest names exactly this framework. manifest 指明的框架是否就是这一个。

Source

pub fn verify_bytes(self, bytes: &[u8]) -> bool

Verify the manifest digest against plugin bytes before native loading. 在 native 加载前,用插件字节验证 manifest 摘要。

Source

pub fn signing_payload( self, registration: &RegistrationInfo, bytes: &[u8], ) -> Vec<u8> ⓘ

Build the canonical bytes covered by an official plugin signature. 构造官方插件签名覆盖的规范化字节。

The payload covers the manifest’s own fields, the plugin bytes, and every field of the registration those bytes are claimed to produce. A signature over only the first two left the registration unauthenticated: a tampered parent or flow still verified as Signature and could pass a slot contract check the honest artifact failed. The manifest’s signature field is excluded, because a signature cannot cover the bytes that carry it. 载荷覆盖 manifest 自身字段、插件字节,以及这些字节声称产出的 registration 的每个 字段。只覆盖前两者的签名让注册声明完全未被认证:被篡改的 parent 或 flow 仍会验证为 Signature,甚至能通过诚实工件通不过的槽位合同检查。manifest 的 signature 字段被排除, 因为签名无法覆盖承载它的那段字节。

Trait Implementations§

Source§

impl Clone for PluginManifest

Source§

fn clone(&self) -> PluginManifest

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 Copy for PluginManifest

Source§

impl Debug for PluginManifest

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for PluginManifest

Source§

impl PartialEq for PluginManifest

Source§

fn eq(&self, other: &PluginManifest) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PluginManifest

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.