aries_cloudagent.issuer package¶
Submodules¶
aries_cloudagent.issuer.base module¶
Ledger issuer class.
-
class
aries_cloudagent.issuer.base.
BaseIssuer
[source]¶ Bases:
abc.ABC
Base class for issuer.
-
create_and_store_credential_definition
(origin_did: str, schema: dict, signature_type: str = None, tag: str = None, support_revocation: bool = False) → Tuple[str, str][source]¶ Create a new credential definition and store it in the wallet.
Parameters: - origin_did – the DID issuing the credential definition
- schema_json – the schema used as a basis
- signature_type – the credential definition signature type (default ‘CL’)
- tag – the credential definition tag
- support_revocation – whether to enable revocation for this credential def
Returns: A tuple of the credential definition ID and JSON
-
create_and_store_revocation_registry
(origin_did: str, cred_def_id: str, revoc_def_type: str, tag: str, max_cred_num: int, tails_base_path: str, issuance_type: str = None) → Tuple[str, str, str][source]¶ Create a new revocation registry and store it in the wallet.
Parameters: - origin_did – the DID issuing the revocation registry
- cred_def_id – the identifier of the related credential definition
- revoc_def_type – the revocation registry type (default CL_ACCUM)
- tag – the unique revocation registry tag
- max_cred_num – the number of credentials supported in the registry
- tails_base_path – where to store the tails file
- issuance_type – optionally override the issuance type
Returns: A tuple of the revocation registry ID, JSON, and entry JSON
-
create_and_store_schema
(origin_did: str, schema_name: str, schema_version: str, attribute_names: Sequence[str]) → Tuple[str, str][source]¶ Create a new credential schema and store it in the wallet.
Parameters: - origin_did – the DID issuing the credential definition
- schema_name – the schema name
- schema_version – the schema version
- attribute_names – a sequence of schema attribute names
Returns: A tuple of the schema ID and JSON
-
create_credential
(schema: dict, credential_offer: dict, credential_request: dict, credential_values: dict, revoc_reg_id: str = None, tails_reader_handle: int = None) → Tuple[str, str][source]¶ Create a credential.
- Args
- schema: Schema to create credential for credential_offer: Credential Offer to create credential for credential_request: Credential request to create credential for credential_values: Values to go in credential revoc_reg_id: ID of the revocation registry tails_reader_handle: Handle for the tails file blob reader
Returns: A tuple of created credential and revocation id
-
create_credential_offer
(credential_definition_id) → str[source]¶ Create a credential offer for the given credential definition id.
Parameters: credential_definition_id – The credential definition to create an offer for Returns: The created credential offer
-
credential_definition_in_wallet
(credential_definition_id: str) → bool[source]¶ Check whether a given credential definition ID is present in the wallet.
Parameters: credential_definition_id – The credential definition ID to check
-
make_credential_definition_id
(origin_did: str, schema: dict, signature_type: str = None, tag: str = None) → str[source]¶ Derive the ID for a credential definition.
-
make_schema_id
(origin_did: str, schema_name: str, schema_version: str) → str[source]¶ Derive the ID for a schema.
-
merge_revocation_registry_deltas
(fro_delta: str, to_delta: str) → str[source]¶ Merge revocation registry deltas.
Parameters: - fro_delta – original delta in JSON format
- to_delta – incoming delta in JSON format
Returns: Merged delta in JSON format
-
revoke_credentials
(revoc_reg_id: str, tails_file_path: str, cred_revoc_ids: Sequence[str]) → str[source]¶ Revoke a set of credentials in a revocation registry.
Parameters: - revoc_reg_id – ID of the revocation registry
- tails_file_path – path to the local tails file
- cred_revoc_ids – sequences of credential indexes in the revocation registry
Returns: the combined revocation delta
-
-
exception
aries_cloudagent.issuer.base.
IssuerError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.core.error.BaseError
Generic issuer error.
-
exception
aries_cloudagent.issuer.base.
IssuerRevocationRegistryFullError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.issuer.base.IssuerError
Revocation registry is full when issuing a new credential.
aries_cloudagent.issuer.indy module¶
Indy issuer implementation.
-
class
aries_cloudagent.issuer.indy.
IndyIssuer
(wallet)[source]¶ Bases:
aries_cloudagent.issuer.base.BaseIssuer
Indy issuer class.
-
create_and_store_credential_definition
(origin_did: str, schema: dict, signature_type: str = None, tag: str = None, support_revocation: bool = False) → Tuple[str, str][source]¶ Create a new credential definition and store it in the wallet.
Parameters: - origin_did – the DID issuing the credential definition
- schema – the schema used as a basis
- signature_type – the credential definition signature type (default ‘CL’)
- tag – the credential definition tag
- support_revocation – whether to enable revocation for this credential def
Returns: A tuple of the credential definition ID and JSON
-
create_and_store_revocation_registry
(origin_did: str, cred_def_id: str, revoc_def_type: str, tag: str, max_cred_num: int, tails_base_path: str, issuance_type: str = None) → Tuple[str, str, str][source]¶ Create a new revocation registry and store it in the wallet.
Parameters: - origin_did – the DID issuing the revocation registry
- cred_def_id – the identifier of the related credential definition
- revoc_def_type – the revocation registry type (default CL_ACCUM)
- tag – the unique revocation registry tag
- max_cred_num – the number of credentials supported in the registry
- tails_base_path – where to store the tails file
- issuance_type – optionally override the issuance type
Returns: A tuple of the revocation registry ID, JSON, and entry JSON
-
create_and_store_schema
(origin_did: str, schema_name: str, schema_version: str, attribute_names: Sequence[str]) → Tuple[str, str][source]¶ Create a new credential schema and store it in the wallet.
Parameters: - origin_did – the DID issuing the credential definition
- schema_name – the schema name
- schema_version – the schema version
- attribute_names – a sequence of schema attribute names
Returns: A tuple of the schema ID and JSON
-
create_credential
(schema: dict, credential_offer: dict, credential_request: dict, credential_values: dict, revoc_reg_id: str = None, tails_file_path: str = None) → Tuple[str, str][source]¶ Create a credential.
- Args
- schema: Schema to create credential for credential_offer: Credential Offer to create credential for credential_request: Credential request to create credential for credential_values: Values to go in credential revoc_reg_id: ID of the revocation registry tails_file_path: Path to the local tails file
Returns: A tuple of created credential and revocation id
-
create_credential_offer
(credential_definition_id: str) → str[source]¶ Create a credential offer for the given credential definition id.
Parameters: credential_definition_id – The credential definition to create an offer for Returns: The created credential offer
-
credential_definition_in_wallet
(credential_definition_id: str) → bool[source]¶ Check whether a given credential definition ID is present in the wallet.
Parameters: credential_definition_id – The credential definition ID to check
-
make_credential_definition_id
(origin_did: str, schema: dict, signature_type: str = None, tag: str = None) → str[source]¶ Derive the ID for a credential definition.
-
make_schema_id
(origin_did: str, schema_name: str, schema_version: str) → str[source]¶ Derive the ID for a schema.
-
merge_revocation_registry_deltas
(fro_delta: str, to_delta: str) → str[source]¶ Merge revocation registry deltas.
Parameters: - fro_delta – original delta in JSON format
- to_delta – incoming delta in JSON format
Returns: Merged delta in JSON format
-
revoke_credentials
(revoc_reg_id: str, tails_file_path: str, cred_revoc_ids: Sequence[str]) → str[source]¶ Revoke a set of credentials in a revocation registry.
Parameters: - revoc_reg_id – ID of the revocation registry
- tails_file_path – path to the local tails file
- cred_revoc_ids – sequences of credential indexes in the revocation registry
Returns: the combined revocation delta
-