[][src]Struct rpki::resources::AsResources

pub struct AsResources(_);

The AS Resources of an RPKI Certificate.

This type contains the ‘Autonomous System Identifier Delegation Extension’ as defined in [RFC 3779] in the restricted form specified in [RFC 6487].

This type contains the resources as represented in an RPKI certificate’s AS resources extension. This extension provides two options: there can be an actual set of AS numbers associated with the certificate – this is the AsResources::Blocks variant –, or the AS resources of the issuer can be inherited – the AsResources::Inherit variant.

Methods

impl AsResources[src]

pub fn is_inherited(&self) -> bool[src]

Returns whether the resources are of the inherited variant.

pub fn as_blocks(&self) -> Option<&AsBlocks>[src]

Returns a reference to the blocks if there are any.

pub fn to_blocks(&self) -> Result<AsBlocks, ValidationError>[src]

Converts the resources into blocks or returns an error.

impl AsResources[src]

pub fn take_from<S: Source>(cons: &mut Constructed<S>) -> Result<Self, S::Err>[src]

Takes the AS resources from the beginning of an encoded value.

The ASN.1 specification for the ASIdentifiers types parsed here is given in section 3.2.3 of RFC 3779 as follows:

ASIdentifiers      ::= SEQUENCE {
    asnum              [0] EXPLICIT AsIdentifierChoice OPTIONAL,
    rdi                [1] EXPLICIT AsIdentifierChoice OPTIONAL }

AsIdentifierChoice ::= CHOICE {
    inherit            NULL,
    asIdsOrRanges      SEQUENCE OF ASIdOrRange }

ASIdOrRange        ::= CHOICE {
    id                 ASId,
    range              ASRange }

ASRange            ::= SEQUENCE {
    min                ASId,
    max                ASId }

ASId               ::= INTEGER

Section 4.8.11 of RFC 6487 limits the ASIdentifiers to the asnum choice. If asIdsOrRanges is chosen, it must include a non-empty set of AS numbers.

This function implements these limitations. It maps the id choice of AsIdOrRange to a range covering one number in order to keep things simpler.

pub fn encode(self) -> impl Values[src]

Trait Implementations

impl Clone for AsResources[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for AsResources[src]

Auto Trait Implementations

impl Send for AsResources

impl Sync for AsResources

Blanket Implementations

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

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

type Owned = T

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.