aries_cloudagent.protocols.issue_credential.v2_0.formats.ld_proof package

Subpackages

Submodules

aries_cloudagent.protocols.issue_credential.v2_0.formats.ld_proof.handler module

V2.0 issue-credential linked data proof credential format handler.

class aries_cloudagent.protocols.issue_credential.v2_0.formats.ld_proof.handler.LDProofCredFormatHandler(profile: aries_cloudagent.core.profile.Profile)[source]

Bases: aries_cloudagent.protocols.issue_credential.v2_0.formats.handler.V20CredFormatHandler

Linked data proof credential format handler.

async create_offer(cred_proposal_message: aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_proposal.V20CredProposal) Tuple[aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_format.V20CredFormat, aries_cloudagent.messaging.decorators.attach_decorator.AttachDecorator][source]

Create linked data proof credential offer.

async create_proposal(cred_ex_record: aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord, proposal_data: Mapping) Tuple[aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_format.V20CredFormat, aries_cloudagent.messaging.decorators.attach_decorator.AttachDecorator][source]

Create linked data proof credential proposal.

async create_request(cred_ex_record: aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord, request_data: Optional[Mapping] = None) Tuple[aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_format.V20CredFormat, aries_cloudagent.messaging.decorators.attach_decorator.AttachDecorator][source]

Create linked data proof credential request.

format: aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_format.V20CredFormat.Format = FormatSpec(aries='aries/', detail=<class 'aries_cloudagent.protocols.issue_credential.v2_0.models.detail.ld_proof.V20CredExRecordLDProof'>, handler=<aries_cloudagent.utils.classloader.DeferLoad object>)
async get_detail_record(cred_ex_id: str) aries_cloudagent.protocols.issue_credential.v2_0.models.detail.ld_proof.V20CredExRecordLDProof[source]

Retrieve credential exchange detail record by cred_ex_id.

get_format_data(message_type: str, data: dict) Tuple[aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_format.V20CredFormat, aries_cloudagent.messaging.decorators.attach_decorator.AttachDecorator][source]

Get credential format and attachment objects for use in cred ex messages.

Returns a tuple of both credential format and attachment decorator for use in credential exchange messages. It looks up the correct format identifier and encodes the data as a base64 attachment.

Parameters
  • message_type (str) – The message type for which to return the cred format. Should be one of the message types defined in the message types file

  • data (dict) – The data to include in the attach decorator

Returns

Credential format and attachment data objects

Return type

CredFormatAttachment

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 issue_credential(cred_ex_record: aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord, retries: int = 5) Tuple[aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_format.V20CredFormat, aries_cloudagent.messaging.decorators.attach_decorator.AttachDecorator][source]

Issue linked data proof credential.

async receive_credential(cred_ex_record: aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord, cred_issue_message: aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_issue.V20CredIssue) None[source]

Receive linked data proof credential.

async receive_offer(cred_ex_record: aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord, cred_offer_message: aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_offer.V20CredOffer) None[source]

Receive linked data proof credential offer.

async receive_proposal(cred_ex_record: aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord, cred_proposal_message: aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_proposal.V20CredProposal) None[source]

Receive linked data proof credential proposal.

async receive_request(cred_ex_record: aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord, cred_request_message: aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_request.V20CredRequest) None[source]

Receive linked data proof request.

async store_credential(cred_ex_record: aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord, cred_id: Optional[str] = None) None[source]

Store linked data proof credential.

classmethod validate_fields(message_type: str, attachment_data: Mapping) None[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.