aries_cloudagent.protocols.present_proof.v2_0.formats.dif package

Submodules

aries_cloudagent.protocols.present_proof.v2_0.formats.dif.handler module

V2.0 present-proof dif presentation-exchange format handler.

class aries_cloudagent.protocols.present_proof.v2_0.formats.dif.handler.DIFPresFormatHandler(profile: Profile)[source]

Bases: V20PresFormatHandler

DIF presentation format handler.

async create_bound_request(pres_ex_record: V20PresExRecord, request_data: Optional[dict] = None) Tuple[V20PresFormat, AttachDecorator][source]

Create a presentation request bound to a proposal.

Parameters
  • pres_ex_record – Presentation exchange record for which to create presentation request

  • name – name to use in presentation request (None for default)

  • version – version to use in presentation request (None for default)

  • nonce – nonce to use in presentation request (None to generate)

  • comment – Optional human-readable comment pertaining to request creation

Returns

A tuple (updated presentation exchange record, presentation request message)

async create_pres(pres_ex_record: V20PresExRecord, request_data: Optional[dict] = None) Tuple[V20PresFormat, AttachDecorator][source]

Create a presentation.

format: Format = FormatSpec(aries='dif/', handler=<aries_cloudagent.utils.classloader.DeferLoad object>)
get_format_data(message_type: str, data: dict) Tuple[V20PresFormat, AttachDecorator][source]

Get presentation format and attach objects for use in pres_ex messages.

get_format_identifier(message_type: str) str[source]

Get attachment format identifier for format and message combination.

Parameters

message_type (str) – Message type for which to return the format identifier

Returns

Issue credential attachment format identifier

Return type

str

async process_vcrecords_return_list(vc_records: Sequence[VCRecord], record_ids: set) Tuple[Sequence[VCRecord], set][source]

Return list of non-duplicate VCRecords.

async receive_pres(message: V20Pres, pres_ex_record: V20PresExRecord)[source]

Receive a presentation, from message in context on manager creation.

async retrieve_uri_list_from_schema_filter(schema_uri_groups: Sequence[Sequence[SchemaInputDescriptor]]) Sequence[str][source]

Retrieve list of schema uri from uri_group.

classmethod validate_fields(message_type: str, attachment_data: Mapping)[source]

Validate attachment data for a specific message type.

Uses marshmallow schemas to validate if format specific attachment data is valid for the specified message type. Only does structural and type checks, does not validate if .e.g. the issuer value is valid.

Parameters
  • message_type (str) – The message type to validate the attachment data for. Should be one of the message types as defined in message_types.py

  • attachment_data (Mapping) – [description] The attachment data to valide

Raises

Exception – When the data is not valid.

async verify_pres(pres_ex_record: V20PresExRecord) V20PresExRecord[source]

Verify a presentation.

Parameters

pres_ex_record – presentation exchange record with presentation request and presentation to verify

Returns

presentation exchange record, updated