rpkimancer.sigobj.base module

Base classes for RPKI Signed Object implementations - RFC6488.

class rpkimancer.sigobj.base.EncapsulatedContent(data)

Bases: Content

Base class for encapContentInfo in RPKI Signed Objects - RFC6488.

Parameters:

data (Any) –

digest_algorithm(*, usedforsecurity=True)

Returns a sha256 hash object; optionally initialized with a string

content_type: OID
file_ext: str
property as_resources: Optional[Union[Literal['INHERIT'], Iterable[Union[int, Tuple[int, int]]]]]

Get the AS Number Resources required by this eContent.

property ip_resources: Optional[Iterable[Union[Tuple[Literal[4, 6], Literal['INHERIT']], IPv4Network, IPv6Network]]]

Get the IP Address Resources required by this eContent.

digest()

Calculate the message digest over the DER-encoded eContent.

Return type:

bytes

signed_attrs()

Construct the signedAttrs value from the encapContentInfo.

Return type:

SignedAttributes

signed_attrs_digest()

Calculate the message digest over the DER-encoded signedAttrs.

Return type:

str

class rpkimancer.sigobj.base.SignedObject(issuer, file_name=None, *args, **kwargs)

Bases: ContentInfo

Base CMS ASN.1 ContentInfo for RPKI Signed Objects - RFC5911/RFC6488.

Parameters:
econtent_cls: Type[EncapsulatedContent]
ee_cert_cls

alias of EECertificate

property econtent_info: EncapsulatedContentInfo

Get the Signed Object’s encapContentInfo.

property econtent: EncapsulatedContent

Get the Signed Object’s eContent.

property file_name: str

Construct the file name of the SignedObject.

publish(*, pub_path, uri_path, repo_path, **kwargs)

Publish the SignedObject artifact as a DER file in the PP.

Parameters:
  • pub_path (str) –

  • uri_path (str) –

  • repo_path (str) –

  • kwargs (Any) –

Return type:

None