pub struct CapabilityCertificate { /* private fields */ }Expand description
A signed endpoint-targeted capability certificate.
Implementations§
Source§impl CapabilityCertificate
impl CapabilityCertificate
pub fn issue_root( domain_id: DomainId, permissions: PermissionSet, owner: &IrohSigner, nonce: [u8; 32], ) -> Result<CapabilityCertificate, AuthorityError>
pub fn delegate( &self, issuer: &IrohSigner, subject: AuthorId, permissions: PermissionSet, delegation_permissions: PermissionSet, valid_from_epoch: u64, valid_through_epoch: Option<u64>, nonce: [u8; 32], ) -> Result<CapabilityCertificate, AuthorityError>
Sourcepub fn delegate_at_control(
&self,
issuer: &IrohSigner,
subject: AuthorId,
permissions: PermissionSet,
delegation_permissions: PermissionSet,
issued_control_sequence: u64,
issued_control_head: Option<[u8; 32]>,
valid_from_epoch: u64,
valid_through_epoch: Option<u64>,
nonce: [u8; 32],
) -> Result<CapabilityCertificate, AuthorityError>
pub fn delegate_at_control( &self, issuer: &IrohSigner, subject: AuthorId, permissions: PermissionSet, delegation_permissions: PermissionSet, issued_control_sequence: u64, issued_control_head: Option<[u8; 32]>, valid_from_epoch: u64, valid_through_epoch: Option<u64>, nonce: [u8; 32], ) -> Result<CapabilityCertificate, AuthorityError>
Delegates authority anchored to an exact accepted domain-control head.
pub const fn domain_id(&self) -> DomainId
pub const fn subject(&self) -> AuthorId
pub const fn issuer_capability(&self) -> Option<CapabilityId>
pub const fn permissions(&self) -> PermissionSet
pub const fn delegation_permissions(&self) -> PermissionSet
pub const fn issued_control_sequence(&self) -> u64
pub const fn issued_control_head(&self) -> Option<[u8; 32]>
pub const fn valid_from_epoch(&self) -> u64
pub const fn valid_through_epoch(&self) -> Option<u64>
pub const fn depth(&self) -> u8
Sourcepub const fn issuer_endpoint(&self) -> AuthorId
pub const fn issuer_endpoint(&self) -> AuthorId
Returns the endpoint that signed this certificate.
pub fn permits(&self, permission: Permission, epoch: u64) -> bool
pub fn id(&self) -> Result<CapabilityId, AuthorityError>
pub fn verify_signature(&self) -> Result<(), AuthorityError>
pub fn validate_delegation( &self, issuer: &CapabilityCertificate, ) -> Result<(), AuthorityError>
pub fn encode_canonical(&self) -> Result<Vec<u8>, AuthorityError>
pub fn decode_canonical( bytes: &[u8], ) -> Result<CapabilityCertificate, AuthorityError>
Trait Implementations§
Source§impl Clone for CapabilityCertificate
impl Clone for CapabilityCertificate
Source§fn clone(&self) -> CapabilityCertificate
fn clone(&self) -> CapabilityCertificate
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CapabilityCertificate
impl Debug for CapabilityCertificate
Source§impl PartialEq for CapabilityCertificate
impl PartialEq for CapabilityCertificate
impl Eq for CapabilityCertificate
impl StructuralPartialEq for CapabilityCertificate
Auto Trait Implementations§
impl Freeze for CapabilityCertificate
impl RefUnwindSafe for CapabilityCertificate
impl Send for CapabilityCertificate
impl Sync for CapabilityCertificate
impl Unpin for CapabilityCertificate
impl UnwindSafe for CapabilityCertificate
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
Mutably borrows from an owned value. Read more
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
Compare self to
key and return true if they are equal.§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>
Converts
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>
Converts
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