acapy_agent.anoncreds package

async acapy_agent.anoncreds.setup(context: InjectionContext) None[source]

Set up default resolvers.

Subpackages

Submodules

acapy_agent.anoncreds.base module

Base Registry.

exception acapy_agent.anoncreds.base.AnonCredsObjectAlreadyExists(message: str, obj_id: str, obj: T | None = None, *args, **kwargs)[source]

Bases: AnonCredsRegistrationError, Generic[T]

Raised when an AnonCreds object already exists.

property message: str

Message.

exception acapy_agent.anoncreds.base.AnonCredsObjectNotFound(message: str | None = None, resolution_metadata: dict | None = None)[source]

Bases: BaseAnonCredsError

Raised when object is not found in resolver.

exception acapy_agent.anoncreds.base.AnonCredsRegistrationError(*args, error_code: str | None = None, **kwargs)[source]

Bases: BaseAnonCredsError

Raised when registering an AnonCreds object fails.

exception acapy_agent.anoncreds.base.AnonCredsResolutionError(*args, error_code: str | None = None, **kwargs)[source]

Bases: BaseAnonCredsError

Raised when resolving an AnonCreds object fails.

exception acapy_agent.anoncreds.base.AnonCredsSchemaAlreadyExists(message: str, obj_id: str, obj: T | None = None, *args, **kwargs)[source]

Bases: AnonCredsObjectAlreadyExists[AnonCredsSchema]

Raised when a schema already exists.

property schema: AnonCredsSchema

Get Schema.

property schema_id: str

Get Schema Id.

exception acapy_agent.anoncreds.base.BaseAnonCredsError(*args, error_code: str | None = None, **kwargs)[source]

Bases: BaseError

Base error class for AnonCreds.

class acapy_agent.anoncreds.base.BaseAnonCredsHandler[source]

Bases: ABC

Base Anon Creds Handler.

abstractmethod async setup(context: InjectionContext)[source]

Class Setup method.

abstract property supported_identifiers_regex: Pattern

Regex to match supported identifiers.

async supports(identifier: str) bool[source]

Determine whether this registry supports the given identifier.

class acapy_agent.anoncreds.base.BaseAnonCredsRegistrar[source]

Bases: BaseAnonCredsHandler

Base AnonCreds Registrar.

abstractmethod async register_credential_definition(profile: Profile, schema: GetSchemaResult, credential_definition: CredDef, options: dict | None = None) CredDefResult[source]

Register a credential definition on the registry.

abstractmethod async register_revocation_list(profile: Profile, rev_reg_def: RevRegDef, rev_list: RevList, options: dict | None = None) RevListResult[source]

Register a revocation list on the registry.

abstractmethod async register_revocation_registry_definition(profile: Profile, revocation_registry_definition: RevRegDef, options: dict | None = None) RevRegDefResult[source]

Register a revocation registry definition on the registry.

abstractmethod async register_schema(profile: Profile, schema: AnonCredsSchema, options: dict | None = None) SchemaResult[source]

Register a schema on the registry.

abstractmethod async update_revocation_list(profile: Profile, rev_reg_def: RevRegDef, prev_list: RevList, curr_list: RevList, revoked: Sequence[int], options: dict | None = None) RevListResult[source]

Update a revocation list on the registry.

class acapy_agent.anoncreds.base.BaseAnonCredsResolver[source]

Bases: BaseAnonCredsHandler

Base Anon Creds Resolver.

abstractmethod async get_credential_definition(profile: Profile, credential_definition_id: str) GetCredDefResult[source]

Get a credential definition from the registry.

abstractmethod async get_revocation_list(profile: Profile, revocation_registry_id: str, timestamp_from: int | None = 0, timestamp_to: int | None = None) GetRevListResult[source]

Get a revocation list from the registry.

abstractmethod async get_revocation_registry_definition(profile: Profile, revocation_registry_id: str) GetRevRegDefResult[source]

Get a revocation registry definition from the registry.

abstractmethod async get_schema(profile: Profile, schema_id: str) GetSchemaResult[source]

Get a schema from the registry.

abstractmethod async get_schema_info_by_id(profile: Profile, schema_id: str) AnonCredsSchemaInfo[source]

Get a schema info from the registry.

acapy_agent.anoncreds.constants module

Constants for AnonCreds.

acapy_agent.anoncreds.error_messages module

Error messages for anoncreds.

acapy_agent.anoncreds.events module

Events fired by AnonCreds interface.

class acapy_agent.anoncreds.events.CredDefFinishedEvent(payload: CredDefFinishedPayload)[source]

Bases: Event

Event for cred def finished.

property payload: CredDefFinishedPayload

Return payload.

classmethod with_payload(schema_id: str, cred_def_id: str, issuer_id: str, support_revocation: bool, max_cred_num: int, options: dict | None = None)[source]

With payload.

class acapy_agent.anoncreds.events.CredDefFinishedPayload(schema_id: str, cred_def_id: str, issuer_id: str, support_revocation: bool, max_cred_num: int, options: dict)[source]

Bases: NamedTuple

Payload of cred def finished event.

cred_def_id: str

Alias for field number 1

issuer_id: str

Alias for field number 2

max_cred_num: int

Alias for field number 4

options: dict

Alias for field number 5

schema_id: str

Alias for field number 0

support_revocation: bool

Alias for field number 3

class acapy_agent.anoncreds.events.RevListFinishedEvent(payload: RevListFinishedPayload)[source]

Bases: Event

Event for rev list finished.

property payload: RevListFinishedPayload

Return payload.

classmethod with_payload(rev_reg_id: str, revoked: list, options: dict | None = None)[source]

With payload.

class acapy_agent.anoncreds.events.RevListFinishedPayload(rev_reg_id: str, revoked: list, options: dict)[source]

Bases: NamedTuple

Payload of rev list finished event.

options: dict

Alias for field number 2

rev_reg_id: str

Alias for field number 0

revoked: list

Alias for field number 1

class acapy_agent.anoncreds.events.RevRegDefFinishedEvent(payload: RevRegDefFinishedPayload)[source]

Bases: Event

Event for rev reg def finished.

property payload: RevRegDefFinishedPayload

Return payload.

classmethod with_payload(rev_reg_def_id: str, rev_reg_def: RevRegDef, options: dict | None = None)[source]

With payload.

class acapy_agent.anoncreds.events.RevRegDefFinishedPayload(rev_reg_def_id: str, rev_reg_def: RevRegDef, options: dict)[source]

Bases: NamedTuple

Payload of rev reg def finished event.

options: dict

Alias for field number 2

rev_reg_def: RevRegDef

Alias for field number 1

rev_reg_def_id: str

Alias for field number 0

acapy_agent.anoncreds.holder module

acapy_agent.anoncreds.issuer module

acapy_agent.anoncreds.registry module

AnonCreds Registry.

class acapy_agent.anoncreds.registry.AnonCredsRegistry(registries: List[BaseAnonCredsHandler] | None = None)[source]

Bases: object

AnonCredsRegistry.

async get_credential_definition(profile: Profile, credential_definition_id: str) GetCredDefResult[source]

Get a credential definition from the registry.

async get_revocation_list(profile: Profile, rev_reg_def_id: str, timestamp_from: int | None = 0, timestamp_to: int | None = None) GetRevListResult[source]

Get a revocation list from the registry.

async get_revocation_registry_definition(profile: Profile, revocation_registry_id: str) GetRevRegDefResult[source]

Get a revocation registry definition from the registry.

async get_schema(profile: Profile, schema_id: str) GetSchemaResult[source]

Get a schema from the registry.

async get_schema_info_by_id(profile: Profile, schema_id: str) AnonCredsSchemaInfo[source]

Get a schema info from the registry.

register(registry: BaseAnonCredsHandler) None[source]

Register a new registry.

async register_credential_definition(profile: Profile, schema: GetSchemaResult, credential_definition: CredDef, options: dict | None = None) CredDefResult[source]

Register a credential definition on the registry.

async register_revocation_list(profile: Profile, rev_reg_def: RevRegDef, rev_list: RevList, options: dict | None = None) RevListResult[source]

Register a revocation list on the registry.

async register_revocation_registry_definition(profile: Profile, revocation_registry_definition: RevRegDef, options: dict | None = None) RevRegDefResult[source]

Register a revocation registry definition on the registry.

async register_schema(profile: Profile, schema: AnonCredsSchema, options: dict | None = None) SchemaResult[source]

Register a schema on the registry.

async update_revocation_list(profile: Profile, rev_reg_def: RevRegDef, prev_list: RevList, curr_list: RevList, revoked: Sequence[int], options: dict | None = None) RevListResult[source]

Update a revocation list on the registry.

acapy_agent.anoncreds.util module

Utilities for dealing with Indy conventions.

async acapy_agent.anoncreds.util.generate_pr_nonce() str[source]

Generate a nonce for a proof request.

acapy_agent.anoncreds.util.handle_value_error(e: ValueError) None[source]

Handle ValueError message as web response type.

acapy_agent.anoncreds.util.indy_client_dir(subpath: str | None = None, create: bool = False) str[source]

Return ‘/’-terminated subdirectory of indy-client directory.

Parameters:
  • subpath – subpath within indy-client structure

  • create – whether to create subdirectory if absent

acapy_agent.anoncreds.verifier module