rpkimancer.sigobj.base module

Base classes for RPKI Signed Object implementations - RFC6488.

class rpkimancer.sigobj.base.EncapsulatedContentType(data)

Bases: ContentType

Base for CONTENT-TYPE instance for RPKI Signed Objects - RFC6488.

Parameters:

data (Any) –

digest_algorithm(*, usedforsecurity=True)

Returns a sha256 hash object; optionally initialized with a string

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, Tuple[IPv4Address, IPv4Address], Tuple[IPv6Address, IPv6Address]]]]

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 EncapsulatedContentInfo.

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[SignedData], Generic[ECT]

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

Parameters:
econtent_type: Type[ECT]
ee_cert_cls

alias of EECertificate[ECT]

property econtent_info: EncapsulatedContentInfo[ECT]

Get the Signed Object’s encapContentInfo.

property econtent: ECT

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