Exemplo n.º 1
0
def create_sign(ia: ISD_AS, chain_ver: int, trc_ver: int) -> ProtoSign:
    """
    Create ProtoSign for the specified values with ed25519 as the singing algorithm.

    :param ISD_AS ia: ISD-AS of the signing AS.
    :param int chain_ver: Version of the certificate authenticating the signing key.
    :param int trc_ver: Version of the TRC authenticating the certificate chain.
    :returns: The sign object
    :rtype: ProtoSign
    """
    sign = DefaultSignSrc.from_values(ia, chain_ver, trc_ver)
    return ProtoSign.from_values(ProtoSignType.ED25519, sign.pack())
Exemplo n.º 2
0
 def from_values(cls, cpld_raw, sign=None):
     if not sign:
         sign = ProtoSign.from_values(ProtoSignType.NONE, b"")
     return cls(cls.P_CLS.new_message(blob=cpld_raw, sign=sign.p))
Exemplo n.º 3
0
 def from_values(cls, cpld_raw, sig_type=ProtoSignType.NONE, sig_src=b""):
     s = ProtoSign.from_values(sig_type, sig_src)
     return cls(cls.P_CLS.new_message(blob=cpld_raw, sign=s.p))