[][src]Struct krill::daemon::ca::ResourceClass

pub struct ResourceClass { /* fields omitted */ }

A CA may have multiple parents, e.g. two RIRs, and it may not get all its resource entitlements in one set, but in a number of so-called "resource classes".

Each ResourceClass has a namespace, which can be anything, but for Krill is based on the name of the parent ca, and the name of the resource class under that parent.

Furthermore a resource class manages the key life cycle, and certificates for each key, as well as products that need to be issued by the 'current' key for this class.

Implementations

impl ResourceClass[src]

pub fn create(
    name: ResourceClassName,
    name_space: String,
    parent_handle: ParentHandle,
    parent_rc_name: ResourceClassName,
    pending_key: KeyIdentifier
) -> Self
[src]

Creates a new ResourceClass with a single pending key only.

pub fn for_ta(
    parent_rc_name: ResourceClassName,
    pending_key: KeyIdentifier
) -> Self
[src]

impl ResourceClass[src]

pub fn name_space(&self) -> &str[src]

pub fn parent_handle(&self) -> &ParentHandle[src]

Returns the name of the parent where we got this RC from.

pub fn parent_rc_name(&self) -> &ResourceClassName[src]

Returns the name that the parent uses for this RC.

pub fn add_request(&mut self, key_id: KeyIdentifier, req: IssuanceRequest)[src]

Adds a request to an existing key for future reference.

pub fn current_certificate(&self) -> Option<&RcvdCert>[src]

Returns the current certificate, if there is any

pub fn current_resources(&self) -> Option<&ResourceSet>[src]

Returns the current resources for this resource class

pub fn current_key(&self) -> Option<&CurrentKey>[src]

Returns a reference to current key for this RC, if there is any.

pub fn get_current_key(&self) -> KrillResult<&CurrentKey>[src]

pub fn get_new_key(&self) -> KrillResult<&NewKey>[src]

Gets the new key for a key roll, or returns an error if there is none.

pub fn current_objects(&self) -> CurrentObjects[src]

pub fn as_info(&self) -> ResourceClassInfo[src]

Returns a ResourceClassInfo for this, which contains all the same data, but which does not have any behaviour.

impl ResourceClass[src]

pub fn update_received_cert<S: Signer>(
    &self,
    rcvd_cert: RcvdCert,
    repo_info: &RepoInfo,
    signer: &S
) -> KrillResult<Vec<EvtDet>>
[src]

Returns event details for receiving the certificate.

pub fn make_entitlement_events<S: Signer>(
    &self,
    entitlement: &EntitlementClass,
    base_repo: &RepoInfo,
    signer: &S
) -> KrillResult<Vec<EvtDet>>
[src]

Request certificates for any key that needs it. Also, create revocation events for any unexpected keys to recover from issues where the parent believes we have keys that we do not know. This can happen in corner cases where re-initialisation of Krill as a child is done without proper revocation at the parent, or as is the case with ARIN - Krill is sometimes told to just drop all resources.

pub fn make_request_events_new_repo<S: Signer>(
    &self,
    base_repo: &RepoInfo,
    signer: &S
) -> KrillResult<Vec<EvtDet>>
[src]

Request new certificates for all keys when the base repo changes.

pub fn cert_requests(&self) -> Vec<IssuanceRequest>[src]

This function returns all current certificate requests.

pub fn revoke_request(&self) -> Option<&RevocationRequest>[src]

Returns the revocation request for the old key, if it exists.

impl ResourceClass[src]

pub fn apply_delta(
    &mut self,
    delta: CurrentObjectSetDelta,
    key_id: KeyIdentifier
)
[src]

Applies a publication delta to the appropriate key in this resource class.

pub fn publish_objects<S: Signer>(
    &self,
    repo_info: &RepoInfo,
    objects_delta: ObjectsDelta,
    new_revocations: Vec<Revocation>,
    mode: &PublishMode,
    signer: &S
) -> KrillResult<EvtDet>
[src]

Publish/update/withdraw objects under the key, determined by the [PublishMode]. Will revoke updated and withdrawn objects under the correct key as well, i.e. when activating a new key objects will be re-published and updated in terms of publication, but will only be revoked under the old key.

pub fn republish<S: Signer>(
    &self,
    authorizations: &[RouteAuthorization],
    repo_info: &RepoInfo,
    mode: &PublishMode,
    signer: &S
) -> KrillResult<Vec<EvtDet>>
[src]

Republish all keys in this class (that want it). Also update ROAs as needed.

pub fn republish_certs<S: Signer>(
    &self,
    issued_certs: &[&IssuedCert],
    removed_certs: &[&Cert],
    repo_info: &RepoInfo,
    signer: &S
) -> KrillResult<HashMap<KeyIdentifier, CurrentObjectSetDelta>>
[src]

Create a publish event details including the revocations, update, withdrawals needed for updating child certificates.

pub fn all_objects(&self, base_repo: &RepoInfo) -> Vec<PublishElement>[src]

impl ResourceClass[src]

pub fn withdraw(&self, base_repo: &RepoInfo) -> ObjectsDelta[src]

Returns withdraws for all current objects, for when this resource class needs to be removed.

pub fn revoke<S: Signer>(
    &self,
    signer: &S
) -> KrillResult<Vec<RevocationRequest>>
[src]

Returns revocation requests for all certified keys in this resource class.

impl ResourceClass[src]

pub fn received_cert(&mut self, key_id: KeyIdentifier, cert: RcvdCert)[src]

This function marks a certificate as received.

pub fn pending_key_added(&mut self, key_id: KeyIdentifier)[src]

Adds a pending key.

pub fn pending_key_to_new(&mut self, new: CertifiedKey)[src]

Moves a pending key to new

pub fn pending_key_to_active(&mut self, new: CertifiedKey)[src]

Moves a pending key to current

pub fn new_key_activated(&mut self, revoke_req: RevocationRequest)[src]

Activates the new key

pub fn old_key_removed(&mut self)[src]

Removes the old key, we return the to the state where there is one active key.

pub fn keyroll_initiate<S: Signer>(
    &self,
    base_repo: &RepoInfo,
    duration: Duration,
    signer: &mut S
) -> KrillResult<Vec<EvtDet>>
[src]

Initiate a key roll

pub fn keyroll_activate<S: Signer>(
    &self,
    repo_info: &RepoInfo,
    staging: Duration,
    signer: &S
) -> KrillResult<Vec<EvtDet>>
[src]

Activate a new key, if it's been longer than the staging period.

pub fn keyroll_finish(&self, base_repo: &RepoInfo) -> KrillResult<EvtDet>[src]

Finish a key roll, withdraw the old key

impl ResourceClass[src]

pub fn issue_cert<S: Signer>(
    &self,
    csr: CsrInfo,
    child_resources: &ResourceSet,
    limit: RequestResourceLimit,
    signer: &S
) -> KrillResult<IssuedCert>
[src]

Makes a single CA certificate and wraps it in an issuance response.

Will use the intersection of the requested child resources, and the resources actually held by the this resource class. An error will be returned if a ResourceRequestLimit was used that includes resources that are not in this intersection.

Note that this certificate still needs to be added to this RC by calling the update_certs function.

pub fn certificate_issued(&mut self, issued: IssuedCert)[src]

Stores an IssuedCert

pub fn issued(&self, ki: &KeyIdentifier) -> Option<&IssuedCert>[src]

Returns an issued certificate for a key, if it exists

pub fn key_revoked(&mut self, key: &KeyIdentifier)[src]

Removes a revoked key.

impl ResourceClass[src]

pub fn update_roas<S: Signer>(
    &self,
    auths: &[RouteAuthorization],
    mode: &PublishMode,
    signer: &S
) -> KrillResult<RoaUpdates>
[src]

Updates the ROAs in accordance with the current authorizations, and the target resources and key determined by the PublishMode.

pub fn roas_updated(&mut self, updates: RoaUpdates)[src]

Marks the ROAs as updated from a RoaUpdated event.

Trait Implementations

impl Clone for ResourceClass[src]

impl Debug for ResourceClass[src]

impl<'de> Deserialize<'de> for ResourceClass[src]

impl Eq for ResourceClass[src]

impl PartialEq<ResourceClass> for ResourceClass[src]

impl Serialize for ResourceClass[src]

impl StructuralEq for ResourceClass[src]

impl StructuralPartialEq for ResourceClass[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.