angelos.lib.policy.crypto

Conceal/unveal algorithms.

class angelos.lib.policy.crypto.Crypto

Bases: object

Conceal/unveil policy.

static conceal(data: bytes, sender: angelos.lib.policy.portfolio.PrivatePortfolio, receiver: angelos.lib.policy.portfolio.Portfolio) → bytes

Conceal data.

static document_data(document: Union[angelos.document.entities.Person, angelos.document.entities.Ministry, angelos.document.entities.Church, angelos.document.entities.PrivateKeys, angelos.document.entities.Keys, angelos.document.profiles.PersonProfile, angelos.document.profiles.MinistryProfile, angelos.document.profiles.ChurchProfile, angelos.document.domain.Domain, angelos.document.domain.Node, angelos.document.domain.Network, angelos.document.statements.Verified, angelos.document.statements.Trusted, angelos.document.statements.Revoked, angelos.document.messages.Note, angelos.document.messages.Instant, angelos.document.messages.Mail, angelos.document.messages.Share, angelos.document.messages.Report, angelos.document.envelope.Envelope], exclude: list = []) → bytes

Flatten the data of a Document in a standardized way to a byte string.

Parameters
  • document (Document) – The document to be flattened.

  • exclude (list) – List of fieldnames to exclude from flattening.

Returns (bytes):

The flattened document as bytes.

static latest_keys(keys: Set[angelos.document.entities.Keys])angelos.document.entities.Keys

Return latest key from set.

static old_verify(document: Union[angelos.document.entities.Person, angelos.document.entities.Ministry, angelos.document.entities.Church, angelos.document.entities.PrivateKeys, angelos.document.entities.Keys, angelos.document.profiles.PersonProfile, angelos.document.profiles.MinistryProfile, angelos.document.profiles.ChurchProfile, angelos.document.domain.Domain, angelos.document.domain.Node, angelos.document.domain.Network, angelos.document.statements.Verified, angelos.document.statements.Trusted, angelos.document.statements.Revoked, angelos.document.messages.Note, angelos.document.messages.Instant, angelos.document.messages.Mail, angelos.document.messages.Share, angelos.document.messages.Report, angelos.document.envelope.Envelope], signer: angelos.lib.policy.portfolio.Portfolio, exclude=[]) → bool

Main document verifying algorithm.

static sign(document: Union[angelos.document.entities.Person, angelos.document.entities.Ministry, angelos.document.entities.Church, angelos.document.entities.PrivateKeys, angelos.document.entities.Keys, angelos.document.profiles.PersonProfile, angelos.document.profiles.MinistryProfile, angelos.document.profiles.ChurchProfile, angelos.document.domain.Domain, angelos.document.domain.Node, angelos.document.domain.Network, angelos.document.statements.Verified, angelos.document.statements.Trusted, angelos.document.statements.Revoked, angelos.document.messages.Note, angelos.document.messages.Instant, angelos.document.messages.Mail, angelos.document.messages.Share, angelos.document.messages.Report, angelos.document.envelope.Envelope], signer: angelos.lib.policy.portfolio.PrivatePortfolio, exclude=[], multiple=False) → Union[angelos.document.entities.Person, angelos.document.entities.Ministry, angelos.document.entities.Church, angelos.document.entities.PrivateKeys, angelos.document.entities.Keys, angelos.document.profiles.PersonProfile, angelos.document.profiles.MinistryProfile, angelos.document.profiles.ChurchProfile, angelos.document.domain.Domain, angelos.document.domain.Node, angelos.document.domain.Network, angelos.document.statements.Verified, angelos.document.statements.Trusted, angelos.document.statements.Revoked, angelos.document.messages.Note, angelos.document.messages.Instant, angelos.document.messages.Mail, angelos.document.messages.Share, angelos.document.messages.Report, angelos.document.envelope.Envelope]

Main document signing algorithm.

static sign_header(envelope: angelos.document.envelope.Envelope, header: angelos.document.envelope.Header, signer: angelos.lib.policy.portfolio.PrivatePortfolio)angelos.document.envelope.Header

Sign envelope header

static unveil(data: bytes, receiver: angelos.lib.policy.portfolio.PrivatePortfolio, sender: angelos.lib.policy.portfolio.Portfolio) → bytes

Unveil data.

static verify(document: Union[angelos.document.entities.Person, angelos.document.entities.Ministry, angelos.document.entities.Church, angelos.document.entities.PrivateKeys, angelos.document.entities.Keys, angelos.document.profiles.PersonProfile, angelos.document.profiles.MinistryProfile, angelos.document.profiles.ChurchProfile, angelos.document.domain.Domain, angelos.document.domain.Node, angelos.document.domain.Network, angelos.document.statements.Verified, angelos.document.statements.Trusted, angelos.document.statements.Revoked, angelos.document.messages.Note, angelos.document.messages.Instant, angelos.document.messages.Mail, angelos.document.messages.Share, angelos.document.messages.Report, angelos.document.envelope.Envelope], signer: angelos.lib.policy.portfolio.Portfolio, exclude=[]) → bool

Main document verifying algorithm.

static verify_header(envelope: angelos.document.envelope.Envelope, header_no: int, signer: angelos.lib.policy.portfolio.Portfolio) → bool

Verify envelope header.

static verify_keys(new_key: angelos.document.entities.Keys, signer: angelos.lib.policy.portfolio.Portfolio, exclude=[]) → bool

Verify double signed keys.