Skip to main content

PluginSignatureVerifier

Trait PluginSignatureVerifier 

Source
pub trait PluginSignatureVerifier {
    // Required method
    fn verify(
        &self,
        manifest: PluginManifest,
        payload: &[u8],
        key_fingerprint: &str,
    ) -> bool;
}
Expand description

Host-provided cryptographic verifier for official plugin signatures. 由宿主提供的官方插件签名密码学验证器。

NichLink deliberately does not implement a signature scheme. The host can connect its existing Ed25519, platform keystore, or isolated process verifier without making the registry depend on that implementation. NichLink 刻意不实现具体签名算法。宿主可以接入现有的 Ed25519、平台密钥库或 隔离进程验证器,而不让注册机依赖这些实现。

Required Methods§

Source

fn verify( &self, manifest: PluginManifest, payload: &[u8], key_fingerprint: &str, ) -> bool

Return whether the host accepts this signature over the canonical payload. 宿主是否接受该签名用于给定的规范化载荷。

payload is the bytes the kernel built for this artifact: the manifest fields, the registration that travels beside the plugin bytes, and the bytes themselves. The host supplies the cryptography and does not reassemble the message, so a payload field added later is covered by every verifier without a change on the host side — and no verifier can quietly drop a field core put in. payload 是内核为该工件构造的字节:manifest 字段、随插件字节同行的注册声明,以及字节 本身。宿主只提供密码学、不自行拼装消息:日后新增的载荷字段无需宿主改动即被每个验证器覆盖, 任何验证器也无法悄悄丢掉内核放进去的字段。

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<F> PluginSignatureVerifier for F
where F: Fn(PluginManifest, &[u8], &str) -> bool,