Skip to main content

CertAuth

Struct CertAuth 

Source
pub struct CertAuth { /* private fields */ }
Expand description

The aggregate for an RPKI Certification Authority (CA).

It represents an “organizational” CA: It can have multiple parents and multiple keys under each. For each of them, it will have a resource class that represents the actual published CA.

Configurations for published objects such as ROAs or ASPA objects are kept at the level of the CA, and actual RPKI objects are then issued under the resource class that has matching resources.

Implementations§

Source§

impl CertAuth

§Data presentation

Source

pub fn handle(&self) -> &CaHandle

Returns the handle of this CA.

Source

pub fn as_ca_info(&self) -> CertAuthInfo

Returns the CA information for use in the API.

Source

pub fn configured_roas(&self) -> Vec<ConfiguredRoa>

Returns a list of the currently configured ROAs.

Source

pub fn configured_roas_for_configs( &self, roa_configurations: Vec<RoaConfiguration>, ) -> Vec<ConfiguredRoa>

Returns a list of ROAs matching the given ROA configurations.

Source

pub fn child_request(&self) -> ChildRequest

Returns an RFC 8183 Child Request.

This request can be presented as XML to a parent of this CA.

Source

pub fn publisher_request(&self) -> PublisherRequest

Returns an RFC 8183 Publisher Request.

This request can be presented as XML to the repository for this CA.

Source

pub fn id_cert(&self) -> &IdCertInfo

Returns the ID certificate used by this CA.

Source

pub fn all_resources(&self) -> ResourceSet

Returns the complete set of all currently received resources, under all parents, for this CertAuth

Source§

impl CertAuth

§Publishing

Source

pub fn repository_contact(&self) -> KrillResult<&RepositoryContact>

Returns the repository contact information for this CA.

If the CA does not yet have a repository assigned, returns an error.

Source§

impl CertAuth

§Child CAs of this CA.

Source

pub fn child_export( &self, child_handle: &ChildHandle, ) -> KrillResult<ImportChild>

Export a child under this CA, if possible.

Source

pub fn verify_rfc6492(&self, cms: ProvisioningCms) -> KrillResult<Message>

Verifies a received provisioning protocol CMS message.

If the message is for a known child and validates against the ID certificate stored for that child, returns the message. Otherwise returns an error.

Source

pub fn sign_rfc6492_response( &self, message: Message, signer: &KrillSigner, ) -> KrillResult<Bytes>

Signs a provisioning protocol message for sending towards the child.

Source

pub fn list( &self, child_handle: &ChildHandle, issuance_timing: &IssuanceTimingConfig, ) -> KrillResult<ResourceClassListResponse>

Creates a “resource class list response” for a child CA.

This response is part of the provisioning protocol and contains all entitlements assigned to a child CA.

The method returns an error if the child CA is not authorized or unknown.

Source

pub fn issuance_response( &self, child_handle: &ChildHandle, my_rcn: &ResourceClassName, pub_key: &PublicKey, issuance_timing: &IssuanceTimingConfig, ) -> KrillResult<IssuanceResponse>

Creates a “issuance response” for specific resource class of a child.

This response is part of the provisioning protocol and contains a single certificate issued to the child CA in a specific resource class.

Source

pub fn get_child(&self, child: &ChildHandle) -> KrillResult<&ChildDetails>

Returns a child, or an error if the child is unknown.

Source

pub fn children(&self) -> impl Iterator<Item = &ChildHandle>

Returns an iterator for the handles of all children under this CA.

Source§

impl CertAuth

§Parent CAs of this CA

Source

pub fn parents(&self) -> impl Iterator<Item = &ParentHandle>

Returns an iterator over the handles of all parent CAs.

Source

pub fn nr_parents(&self) -> usize

Returns the number parents of the CA.

Source

pub fn has_parent(&self, parent: &ParentHandle) -> bool

Returns whether the given parent is a parent of this CA.

Source

pub fn parent(&self, parent: &ParentHandle) -> KrillResult<&ParentCaContact>

Gets the ParentCaContact for this ParentHandle. Returns an Err when the parent does not exist.

Source

pub fn parent_for_rc( &self, rcn: &ResourceClassName, ) -> KrillResult<&ParentHandle>

Returns the parent handle for the given resource class.

Returns an error if the resource class is not known to this CA.

Source

pub fn cert_requests( &self, parent_handle: &ParentHandle, ) -> HashMap<ResourceClassName, Vec<IssuanceRequest>>

Returns all currently open certificate requests for a parent.

Returns an empty map if the parent is not found.

Source

pub fn has_pending_requests(&self, parent: &ParentHandle) -> bool

Returns whether the CA has any pending requests for a parent

Source

pub fn revoke_requests( &self, parent: &ParentHandle, ) -> HashMap<ResourceClassName, Vec<RevocationRequest>>

Returns the open revocation requests for the given parent.

Source

pub fn revoke_under_parent( &self, parent: &ParentHandle, signer: &KrillSigner, ) -> KrillResult<HashMap<ResourceClassName, Vec<RevocationRequest>>>

Returns new revocation requests for all resource class under a parent.

Source§

impl CertAuth

§Publishing

Source

pub fn process_update_repo( &self, contact: RepositoryContact, signer: &KrillSigner, ) -> KrillResult<Vec<CertAuthEvent>>

Processes the “update repository” command.

Currently, this only allows initially setting the repository. In the future, we will support migrating to a new repository using a key roll. See issue #480.

The command assumes that the repository can be reached. This is checked by the CA manager before issuing the command.

Source§

impl CertAuth

§ROAs

Source

pub fn get_updated_authorizations( &self, updates: &RoaConfigurationUpdates, ) -> KrillResult<Routes>

Returns the ROA configuration resulting from applying the updates.

Does not change the current configuration. Returns the resulting configuration or the reasons why the updates cannot be applied.

Source

pub fn process_route_authorizations_renew( &self, force: bool, config: &Config, signer: &KrillSigner, ) -> KrillResult<Vec<CertAuthEvent>>

Processes the “route origin authorization renew“ commands.

If force is true, all authorizations are renewed, otherwise only those that are close to expiring.

Source§

impl CertAuth

§ASPA

Source

pub fn aspas_definitions_show(&self) -> AspaDefinitionList

Returns the list of current ASPA definitions.

Source§

impl CertAuth

§BGPsec router keys

Source

pub fn bgpsec_definitions_show(&self) -> BgpSecCsrInfoList

Returns all current BGPsec router key definitions.

Source§

impl CertAuth

§RTAs

Source

pub fn rta_list(&self) -> RtaList

Returns a list of all currently defined RTAs.

Source

pub fn rta_show(&self, name: &str) -> KrillResult<ResourceTaggedAttestation>

Returns the RTA with the given name.

Source

pub fn rta_prep_response(&self, name: &str) -> KrillResult<RtaPrepResponse>

Returns the RTA preparation response for the given RTA.

Trait Implementations§

Source§

impl Aggregate for CertAuth

Source§

type Command = SentCommand<CertAuthCommandDetails>

The type representing consecutive commands.
Source§

type StorableCommandDetails = CertAuthStorableCommand

The type representing the details of a command to be stored.
Source§

type Event = CertAuthEvent

The type representing consecutive events.
Source§

type InitCommand = SentInitCommand<CertAuthInitCommandDetails>

The type representing the initial command.
Source§

type InitEvent = CertAuthInitEvent

The type representing the initial event.
Source§

type Error = Error

The type returned when processing a command fails.
Source§

fn init(handle: &MyHandle, event: CertAuthInitEvent) -> Self

Creates a new instance. Read more
Source§

fn process_init_command( command: SentInitCommand<CertAuthInitCommandDetails>, ) -> Result<CertAuthInitEvent, Error>

Tries to initialise a new InitEvent for a new instance. Read more
Source§

fn version(&self) -> u64

Returns the current version of the aggregate.
Source§

fn increment_version(&mut self)

Increments current version of the aggregate.
Source§

fn process_command( &self, command: SentCommand<CertAuthCommandDetails>, ) -> Result<Vec<CertAuthEvent>, Error>

Processes a command. Read more
Source§

fn apply(&mut self, event: CertAuthEvent)

Applies an event to the aggregate. Read more
Source§

fn apply_command(&mut self, command: StoredCommand<Self>)

Applies a stored command. Read more
Source§

impl Clone for CertAuth

Source§

fn clone(&self) -> CertAuth

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 Debug for CertAuth

Source§

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

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

impl<'de> Deserialize<'de> for CertAuth

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for CertAuth

Source§

impl PartialEq for CertAuth

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl PostSaveEventListener<CertAuth> for TaskQueue

Implement post-save listening for CertAuth events.

Used for best effort signaling to local child CAs that a sync with their parent is needed.

Source§

fn listen(&self, ca: &CertAuth, events: &[CertAuthEvent])

Source§

impl PreSaveEventListener<CertAuth> for CaObjectsStore

React to any events on a CA that cause the set of object to change.

Source§

fn listen(&self, ca: &CertAuth, events: &[CertAuthEvent]) -> KrillResult<()>

Source§

impl PreSaveEventListener<CertAuth> for TaskQueue

Implement pre-save listening for CertAuth events.

Source§

fn listen(&self, ca: &CertAuth, events: &[CertAuthEvent]) -> KrillResult<()>

Source§

impl Serialize for CertAuth

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for CertAuth

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Storable for T

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more