Skip to content

aea.helpers.acn.agent_record

This module contains types and helpers for ACN Proof-of-Representation.

AgentRecord Objects

class AgentRecord()

Agent Proof-of-Representation to representative.

__init__

def __init__(address: str, representative_public_key: str,
             identifier: SimpleIdOrStr, ledger_id: SimpleIdOrStr,
             not_before: str, not_after: str, message_format: str,
             signature: str) -> None

Initialize the AgentRecord

Arguments:

  • address: agent address
  • representative_public_key: representative's public key
  • identifier: certificate identifier.
  • ledger_id: ledger identifier the request is referring to.
  • not_before: specify the lower bound for certificate validity. If it is a string, it must follow the format: 'YYYY-MM-DD'. It will be interpreted as timezone UTC-0.
  • not_after: specify the lower bound for certificate validity. If it is a string, it must follow the format: 'YYYY-MM-DD'. It will be interpreted as timezone UTC-0.
  • message_format: message format used for signing
  • signature: proof-of-representation of this AgentRecord

address

@property
def address() -> str

Get agent address

public_key

@property
def public_key() -> str

Get agent public key

representative_public_key

@property
def representative_public_key() -> str

Get agent representative's public key

signature

@property
def signature() -> str

Get record signature

message

@property
def message() -> bytes

Get the message.

identifier

@property
def identifier() -> SimpleIdOrStr

Get the identifier.

ledger_id

@property
def ledger_id() -> SimpleIdOrStr

Get ledger id.

not_before

@property
def not_before() -> str

Get the not_before field.

not_after

@property
def not_after() -> str

Get the not_after field.

message_format

@property
def message_format() -> str

Get the message format.

__str__

def __str__() -> str

Get string representation.

from_cert_request

@classmethod
def from_cert_request(cls,
                      cert_request: CertRequest,
                      address: str,
                      representative_public_key: str,
                      data_dir: Optional[PathLike] = None) -> "AgentRecord"

Get agent record from cert request.