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 strManifest name; trust and lock checks match on this package identity. manifest 名称;信任与锁检查以它作为包身份匹配。
crate_name: &'static strRust crate that carries the plugin implementation. 承载插件实现的 Rust crate。
version: &'static strDeclared plugin version. 声明的插件版本。
framework: FrameworkIdHost framework the plugin targets. 插件针对的宿主框架。
source: PluginSourceTrust lane the plugin came from. 插件的来源信任通道。
mode: PluginModeWhether the plugin extends or replaces a slot. 插件是扩展还是替换插槽。
checksum: &'static strDigest 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
impl PluginManifest
Sourcepub fn targets(self, framework: FrameworkId) -> bool
pub fn targets(self, framework: FrameworkId) -> bool
Whether the manifest names exactly this framework. manifest 指明的框架是否就是这一个。
Sourcepub fn verify_bytes(self, bytes: &[u8]) -> bool
pub fn verify_bytes(self, bytes: &[u8]) -> bool
Verify the manifest digest against plugin bytes before native loading. 在 native 加载前,用插件字节验证 manifest 摘要。
Sourcepub fn signing_payload(
self,
registration: &RegistrationInfo,
bytes: &[u8],
) -> Vec<u8> ⓘ
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
impl Clone for PluginManifest
Source§fn clone(&self) -> PluginManifest
fn clone(&self) -> PluginManifest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more