pub struct SignedApproval {
pub binding: ApprovalBinding,
pub signature: Vec<u8>,
}Expand description
A signed approval: the binding plus a detached hybrid-COSE composite
signature over its ApprovalBinding::signing_payload. This is the artifact
a reviewer/authority emits and the policy loader consumes.
Fields§
§binding: ApprovalBindingThe reviewed binding (re-derivable + re-hashable at the verifier).
signature: Vec<u8>Detached hybrid-COSE composite signature (EdDSA + ML-DSA-65).
Implementations§
Source§impl SignedApproval
impl SignedApproval
Sourcepub fn sign(
binding: ApprovalBinding,
ed_sk: &SigningKey,
pq_sk: &MlDsaSigningKey,
) -> Result<Self, ApprovalError>
pub fn sign( binding: ApprovalBinding, ed_sk: &SigningKey, pq_sk: &MlDsaSigningKey, ) -> Result<Self, ApprovalError>
Sign an approval binding with the authority’s HYBRID keypair. pq_sk
MUST be Some — an approval is never Ed25519-only (design §14). Passing
the classical key without a PQ key is rejected fail-closed so a misuse
can’t silently downgrade the suite.
Sourcepub fn verify(
&self,
ed_vk: &VerifyingKey,
pq_vk: &MlDsaVerifyingKey,
) -> Result<&ApprovalBinding, ApprovalError>
pub fn verify( &self, ed_vk: &VerifyingKey, pq_vk: &MlDsaVerifyingKey, ) -> Result<&ApprovalBinding, ApprovalError>
Verify the approval under the HYBRID policy (require_pq = true): both the
EdDSA and the anchored ML-DSA-65 layers must verify against the authority’s
keys, over the binding’s signing payload. Fail-closed: a stripped PQ layer,
a wrong key, or a tampered binding all reject.
On success returns the verified ApprovalBinding (so the caller does not
re-trust self.binding without having checked the signature).
Sourcepub fn verify_binds(
&self,
ed_vk: &VerifyingKey,
pq_vk: &MlDsaVerifyingKey,
ucan: &Ucan,
generation: u64,
bundle_hash: &[u8; 32],
) -> Result<(), ApprovalError>
pub fn verify_binds( &self, ed_vk: &VerifyingKey, pq_vk: &MlDsaVerifyingKey, ucan: &Ucan, generation: u64, bundle_hash: &[u8; 32], ) -> Result<(), ApprovalError>
Verify the approval AND confirm it binds the given UCAN, generation, and
bundle hash. This is the check the policy loader runs: it has the compiled
bundle’s (generation, bundle_hash) and the approved UCAN in hand and must
confirm the signed approval covers exactly them. Fail-closed on any
mismatch.
Trait Implementations§
Source§impl Clone for SignedApproval
impl Clone for SignedApproval
Source§fn clone(&self) -> SignedApproval
fn clone(&self) -> SignedApproval
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SignedApproval
impl Debug for SignedApproval
Source§impl<'de> Deserialize<'de> for SignedApproval
impl<'de> Deserialize<'de> for SignedApproval
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for SignedApproval
impl PartialEq for SignedApproval
Source§fn eq(&self, other: &SignedApproval) -> bool
fn eq(&self, other: &SignedApproval) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for SignedApproval
impl Serialize for SignedApproval
impl Eq for SignedApproval
impl StructuralPartialEq for SignedApproval
Auto Trait Implementations§
impl Freeze for SignedApproval
impl RefUnwindSafe for SignedApproval
impl Send for SignedApproval
impl Sync for SignedApproval
impl Unpin for SignedApproval
impl UnsafeUnpin for SignedApproval
impl UnwindSafe for SignedApproval
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more