Aries Cloud Agent Python Code Documentation
Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized identity applications and services running in non-mobile environments.
This is the Read The Docs site for the Hyperledger Aries Cloud Agent Python. This site contains only the ACA-Py docstrings documentation extracted from the Python Code. For other documentation, please consult the links in the Readme for the ACA-Py GitHub Repo.
If you are getting started with verifiable credentials or Aries, we recommend that you start with this verifiable credentials and agents getting started guide.
Want to quick overview of the deployment model for ACA-Py? See this document.
To investigate the code, use search or click the package links in the left menu to drill into the modules, subpackages and submodules that make up ACA-Py.
Developers that are interested in what DIDComm protocols are supported in ACA-Py should take a look at the protocols package. These should align with the corresponding aries-rfcs protocols. Decorators defined in aries-rfcs and implemented in ACA-Py can be found here. Some general purpose subpackages that might be of interest include wallet and storage. For those agents playing different roles in a verifiable credential exchange, take a look at the issuer, holder and verifier packages.
Please see the ACA-Py Contribution guidelines for how to contribute to ACA-Py, including for how to submit issues about ACA-Py.
aries_cloudagent
aries_cloudagent package
Aries Cloud Agent.
Subpackages
aries_cloudagent.admin package
Submodules
aries_cloudagent.admin.base_server module
Abstract admin server interface.
aries_cloudagent.admin.error module
Admin error classes.
- exception aries_cloudagent.admin.error.AdminError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.core.error.BaseError
Base class for Admin-related errors.
- exception aries_cloudagent.admin.error.AdminSetupError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.admin.error.AdminError
Admin server setup or configuration error.
aries_cloudagent.admin.request_context module
Admin request context class.
A request context provided by the admin server to admin route handlers.
- class aries_cloudagent.admin.request_context.AdminRequestContext(profile: aries_cloudagent.core.profile.Profile, *, context: Optional[aries_cloudagent.config.injection_context.InjectionContext] = None, settings: Optional[Mapping[str, object]] = None)[source]
Bases:
object
Context established by the Conductor and passed into message handlers.
- inject(base_cls: Type[aries_cloudagent.config.base.InjectType], settings: Optional[Mapping[str, object]] = None) aries_cloudagent.config.base.InjectType [source]
Get the provided instance of a given class identifier.
- Parameters
cls – The base class to retrieve an instance of
settings – An optional mapping providing configuration to the provider
- Returns
An instance of the base class, or None
- inject_or(base_cls: Type[aries_cloudagent.config.base.InjectType], settings: Optional[Mapping[str, object]] = None, default: Optional[aries_cloudagent.config.base.InjectType] = None) Optional[aries_cloudagent.config.base.InjectType] [source]
Get the provided instance of a given class identifier or default if not found.
- Parameters
base_cls – The base class to retrieve an instance of
settings – An optional dict providing configuration to the provider
default – default return value if no instance is found
- Returns
An instance of the base class, or None
- property injector: aries_cloudagent.config.injector.Injector
Accessor for the associated Injector instance.
- property profile: aries_cloudagent.core.profile.Profile
Accessor for the associated Profile instance.
- session() aries_cloudagent.core.profile.ProfileSession [source]
Start a new interactive session with no transaction support requested.
- property settings: aries_cloudagent.config.settings.Settings
Accessor for the context settings.
- classmethod test_context(session_inject: Optional[dict] = None, profile: Optional[aries_cloudagent.core.profile.Profile] = None) aries_cloudagent.admin.request_context.AdminRequestContext [source]
Quickly set up a new admin request context for tests.
- transaction() aries_cloudagent.core.profile.ProfileSession [source]
Start a new interactive session with commit and rollback support.
If the current backend does not support transactions, then commit and rollback operations of the session will not have any effect.
aries_cloudagent.admin.server module
aries_cloudagent.askar package
Subpackages
Submodules
aries_cloudagent.askar.profile module
aries_cloudagent.askar.store module
Aries-Askar backend store configuration.
- class aries_cloudagent.askar.store.AskarOpenStore(config: aries_cloudagent.askar.store.AskarStoreConfig, created, store: aries_askar.Store)[source]
Bases:
object
Handle and metadata for an opened Askar store.
- class aries_cloudagent.askar.store.AskarStoreConfig(config: Optional[dict] = None)[source]
Bases:
object
A helper class for handling Askar store configuration.
- DEFAULT_KEY = ''
- DEFAULT_KEY_DERIVATION = 'kdf:argon2i:mod'
- DEFAULT_STORAGE_TYPE = None
- KEY_DERIVATION_ARGON2I_INT = 'kdf:argon2i:int'
- KEY_DERIVATION_ARGON2I_MOD = 'kdf:argon2i:mod'
- KEY_DERIVATION_RAW = 'RAW'
- async open_store(provision: bool = False) aries_cloudagent.askar.store.AskarOpenStore [source]
Open a store, removing and/or creating it if so configured.
- Raises
ProfileNotFoundError – If the store is not found
ProfileError – If there is another aries_askar error
aries_cloudagent.cache package
Submodules
aries_cloudagent.cache.base module
Abstract base classes for cache.
- class aries_cloudagent.cache.base.BaseCache[source]
Bases:
abc.ABC
Abstract cache interface.
- abstract async clear(key: str)[source]
Remove an item from the cache, if present.
- Parameters
key – the key to remove
- exception aries_cloudagent.cache.base.CacheError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.core.error.BaseError
Base class for cache-related errors.
- class aries_cloudagent.cache.base.CacheKeyLock(cache: aries_cloudagent.cache.base.BaseCache, key: str)[source]
Bases:
object
A lock on a particular cache key.
Used to prevent multiple async threads from generating or querying the same semi-expensive data. Not thread safe.
- property future: _asyncio.Future
Fetch the result in the form of an awaitable future.
- property parent: aries_cloudagent.cache.base.CacheKeyLock
Accessor for the parent key lock, if any.
- property result: Any
Fetch the current result, if any.
aries_cloudagent.cache.in_memory module
Basic in-memory cache implementation.
- class aries_cloudagent.cache.in_memory.InMemoryCache[source]
Bases:
aries_cloudagent.cache.base.BaseCache
Basic in-memory cache class.
- async clear(key: str)[source]
Remove an item from the cache, if present.
- Parameters
key – the key to remove
- async get(key: str)[source]
Get an item from the cache.
- Parameters
key – the key to retrieve an item for
- Returns
The record found or None
- async set(keys: Union[str, Sequence[str]], value: Any, ttl: Optional[int] = None)[source]
Add an item to the cache with an optional ttl.
Overwrites existing cache entries.
- Parameters
keys – the key or keys for which to set an item
value – the value to store in the cache
ttl – number of seconds that the record should persist
aries_cloudagent.commands package
Commands module common setup.
- aries_cloudagent.commands.load_command(command: str)[source]
Load the module corresponding with a named command.
- aries_cloudagent.commands.run_command(command: str, argv: Optional[Sequence[str]] = None)[source]
Execute a named command with command line arguments.
Submodules
aries_cloudagent.commands.help module
Help command for indexing available commands.
aries_cloudagent.commands.provision module
aries_cloudagent.commands.start module
aries_cloudagent.commands.upgrade module
aries_cloudagent.config package
Submodules
aries_cloudagent.config.argparse module
aries_cloudagent.config.base module
Configuration base classes.
- class aries_cloudagent.config.base.BaseInjector[source]
Bases:
abc.ABC
Base injector class.
- abstract copy() aries_cloudagent.config.base.BaseInjector [source]
Produce a copy of the injector instance.
- abstract inject(base_cls: Type[aries_cloudagent.config.base.InjectType], settings: Optional[Mapping[str, Any]] = None) aries_cloudagent.config.base.InjectType [source]
Get the provided instance of a given class identifier.
- Parameters
cls – The base class to retrieve an instance of
settings – An optional mapping providing configuration to the provider
- Returns
An instance of the base class, or None
- abstract inject_or(base_cls: Type[aries_cloudagent.config.base.InjectType], settings: Optional[Mapping[str, Any]] = None, default: Optional[aries_cloudagent.config.base.InjectType] = None) Optional[aries_cloudagent.config.base.InjectType] [source]
Get the provided instance of a given class identifier or default if not found.
- Parameters
base_cls – The base class to retrieve an instance of
settings – An optional dict providing configuration to the provider
default – default return value if no instance is found
- Returns
An instance of the base class, or None
- class aries_cloudagent.config.base.BaseProvider[source]
Bases:
abc.ABC
Base provider class.
- provide(settings: aries_cloudagent.config.base.BaseSettings, injector: aries_cloudagent.config.base.BaseInjector)[source]
Provide the object instance given a config and injector.
- class aries_cloudagent.config.base.BaseSettings(*args, **kwds)[source]
-
Base settings class.
- abstract copy() aries_cloudagent.config.base.BaseSettings [source]
Produce a copy of the settings instance.
- abstract extend(other: Mapping[str, Any]) aries_cloudagent.config.base.BaseSettings [source]
Merge another mapping to produce a new settings instance.
- get_bool(*var_names, default: Optional[bool] = None) Optional[bool] [source]
Fetch a setting as a boolean value.
- Parameters
var_names – A list of variable name alternatives
default – The default value to return if none are defined
- get_int(*var_names, default: Optional[int] = None) Optional[int] [source]
Fetch a setting as an integer value.
- Parameters
var_names – A list of variable name alternatives
default – The default value to return if none are defined
- exception aries_cloudagent.config.base.ConfigError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.core.error.BaseError
A base exception for all configuration errors.
- exception aries_cloudagent.config.base.InjectionError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.config.base.ConfigError
The base exception raised by Injector and Provider implementations.
- exception aries_cloudagent.config.base.SettingsError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.config.base.ConfigError
The base exception raised by BaseSettings implementations.
aries_cloudagent.config.base_context module
Base injection context builder classes.
aries_cloudagent.config.default_context module
aries_cloudagent.config.error module
Errors for config modules.
- exception aries_cloudagent.config.error.ArgsParseError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.config.base.ConfigError
Error raised when there is a problem parsing the command-line arguments.
aries_cloudagent.config.injection_context module
Injection context implementation.
- class aries_cloudagent.config.injection_context.InjectionContext(*, settings: Optional[Mapping[str, object]] = None, enforce_typing: bool = True)[source]
Bases:
aries_cloudagent.config.base.BaseInjector
Manager for configuration settings and class providers.
- ROOT_SCOPE = 'application'
- copy() aries_cloudagent.config.injection_context.InjectionContext [source]
Produce a copy of the injector instance.
- inject(base_cls: Type[aries_cloudagent.config.base.InjectType], settings: Optional[Mapping[str, object]] = None) aries_cloudagent.config.base.InjectType [source]
Get the provided instance of a given class identifier.
- Parameters
cls – The base class to retrieve an instance of
settings – An optional mapping providing configuration to the provider
- Returns
An instance of the base class, or None
- inject_or(base_cls: Type[aries_cloudagent.config.base.InjectType], settings: Optional[Mapping[str, object]] = None, default: Optional[aries_cloudagent.config.base.InjectType] = None) Optional[aries_cloudagent.config.base.InjectType] [source]
Get the provided instance of a given class identifier or default if not found.
- Parameters
base_cls – The base class to retrieve an instance of
settings – An optional dict providing configuration to the provider
default – default return value if no instance is found
- Returns
An instance of the base class, or None
- property injector: aries_cloudagent.config.injector.Injector
Accessor for scope-specific injector.
- injector_for_scope(scope_name: str) aries_cloudagent.config.injector.Injector [source]
Fetch the injector for a specific scope.
- Parameters
scope_name – The unique scope identifier
- property settings: aries_cloudagent.config.settings.Settings
Accessor for scope-specific settings.
- start_scope(scope_name: str, settings: Optional[Mapping[str, object]] = None) aries_cloudagent.config.injection_context.InjectionContext [source]
Begin a new named scope.
- Parameters
scope_name – The unique name for the scope being entered
settings – An optional mapping of additional settings to apply
- Returns
A new injection context representing the scope
- exception aries_cloudagent.config.injection_context.InjectionContextError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.config.base.InjectionError
Base class for issues in the injection context.
aries_cloudagent.config.injector module
Standard Injector implementation.
- class aries_cloudagent.config.injector.Injector(settings: Optional[Mapping[str, object]] = None, *, enforce_typing: bool = True)[source]
Bases:
aries_cloudagent.config.base.BaseInjector
Injector implementation with static and dynamic bindings.
- bind_instance(base_cls: Type[aries_cloudagent.config.base.InjectType], instance: aries_cloudagent.config.base.InjectType)[source]
Add a static instance as a class binding.
- bind_provider(base_cls: Type[aries_cloudagent.config.base.InjectType], provider: aries_cloudagent.config.base.BaseProvider, *, cache: bool = False)[source]
Add a dynamic instance resolver as a class binding.
- clear_binding(base_cls: Type[aries_cloudagent.config.base.InjectType])[source]
Remove a previously-added binding.
- copy() aries_cloudagent.config.base.BaseInjector [source]
Produce a copy of the injector instance.
- get_provider(base_cls: Type[aries_cloudagent.config.base.InjectType])[source]
Find the provider associated with a class binding.
- inject(base_cls: Type[aries_cloudagent.config.base.InjectType], settings: Optional[Mapping[str, object]] = None) aries_cloudagent.config.base.InjectType [source]
Get the provided instance of a given class identifier.
- Parameters
cls – The base class to retrieve an instance of
params – An optional dict providing configuration to the provider
- Returns
An instance of the base class, or None
- inject_or(base_cls: Type[aries_cloudagent.config.base.InjectType], settings: Optional[Mapping[str, object]] = None, default: Optional[aries_cloudagent.config.base.InjectType] = None) Optional[aries_cloudagent.config.base.InjectType] [source]
Get the provided instance of a given class identifier or default if not found.
- Parameters
base_cls – The base class to retrieve an instance of
settings – An optional dict providing configuration to the provider
default – default return value if no instance is found
- Returns
An instance of the base class, or None
- property settings: aries_cloudagent.config.settings.Settings
Accessor for scope-specific settings.
aries_cloudagent.config.ledger module
aries_cloudagent.config.logging module
Utilities related to logging.
- class aries_cloudagent.config.logging.LoggingConfigurator[source]
Bases:
object
Utility class used to configure logging and print an informative start banner.
- classmethod configure(logging_config_path: Optional[str] = None, log_level: Optional[str] = None, log_file: Optional[str] = None)[source]
Configure logger.
- Parameters
logging_config_path – str: (Default value = None) Optional path to custom logging config
log_level – str: (Default value = None)
- classmethod print_banner(agent_label, inbound_transports, outbound_transports, public_did, admin_server=None, banner_length=40, border_character=':')[source]
Print a startup banner describing the configuration.
- Parameters
agent_label – Agent Label
inbound_transports – Configured inbound transports
outbound_transports – Configured outbound transports
admin_server – Admin server info
public_did – Public DID
banner_length – (Default value = 40) Length of the banner
border_character – (Default value = “:”) Character to use in banner
border –
- aries_cloudagent.config.logging.load_resource(path: str, encoding: Optional[str] = None) TextIO [source]
Open a resource file located in a python package or the local filesystem.
- Parameters
path – The resource path in the form of dir/file or package:dir/file
- Returns
A file-like object representing the resource
aries_cloudagent.config.plugin_settings module
Settings implementation for plugins.
- class aries_cloudagent.config.plugin_settings.PluginSettings(values: Optional[Mapping[str, Any]] = None)[source]
-
Retrieve immutable settings for plugins.
Plugin settings should be retrieved by calling:
PluginSettings.for_plugin(settings, “my_plugin”, {“default”: “values”})
This will extract the PLUGIN_CONFIG_KEY in “settings” and return a new PluginSettings instance.
- copy() aries_cloudagent.config.base.BaseSettings [source]
Produce a copy of the settings instance.
- extend(other: Mapping[str, Any]) aries_cloudagent.config.base.BaseSettings [source]
Merge another settings instance to produce a new instance.
- classmethod for_plugin(settings: aries_cloudagent.config.base.BaseSettings, plugin: str, default: Optional[Mapping[str, Any]] = None) aries_cloudagent.config.plugin_settings.PluginSettings [source]
Construct a PluginSettings object from another settings object.
PLUGIN_CONFIG_KEY is read from settings.
aries_cloudagent.config.provider module
Service provider implementations.
- class aries_cloudagent.config.provider.CachedProvider(provider: aries_cloudagent.config.base.BaseProvider, unique_settings_keys: tuple = ())[source]
Bases:
aries_cloudagent.config.base.BaseProvider
Cache the result of another provider.
- provide(config: aries_cloudagent.config.base.BaseSettings, injector: aries_cloudagent.config.base.BaseInjector)[source]
Provide the object instance given a config and injector.
Instances are cached keyed on a SHA256 digest of the relevant subset of settings.
- class aries_cloudagent.config.provider.ClassProvider(instance_cls: Union[str, type], *ctor_args, init_method: Optional[str] = None, **ctor_kwargs)[source]
Bases:
aries_cloudagent.config.base.BaseProvider
Provider for a particular class.
- class Inject(base_cls: type)[source]
Bases:
object
A class for passing injected arguments to the constructor.
- provide(config: aries_cloudagent.config.base.BaseSettings, injector: aries_cloudagent.config.base.BaseInjector)[source]
Provide the object instance given a config and injector.
- class aries_cloudagent.config.provider.InstanceProvider(instance)[source]
Bases:
aries_cloudagent.config.base.BaseProvider
Provider for a previously-created instance.
- provide(config: aries_cloudagent.config.base.BaseSettings, injector: aries_cloudagent.config.base.BaseInjector)[source]
Provide the object instance given a config and injector.
- class aries_cloudagent.config.provider.StatsProvider(provider: aries_cloudagent.config.base.BaseProvider, methods: Sequence[str], *, ignore_missing: bool = True)[source]
Bases:
aries_cloudagent.config.base.BaseProvider
Add statistics to the results of another provider.
- provide(config: aries_cloudagent.config.base.BaseSettings, injector: aries_cloudagent.config.base.BaseInjector)[source]
Provide the object instance given a config and injector.
aries_cloudagent.config.settings module
Settings implementation.
- class aries_cloudagent.config.settings.Settings(values: Optional[Mapping[str, Any]] = None)[source]
Bases:
aries_cloudagent.config.base.BaseSettings
,MutableMapping
[str
,Any
]Mutable settings implementation.
- copy() aries_cloudagent.config.base.BaseSettings [source]
Produce a copy of the settings instance.
- extend(other: Mapping[str, Any]) aries_cloudagent.config.base.BaseSettings [source]
Merge another settings instance to produce a new instance.
- for_plugin(plugin: str, default: Optional[Mapping[str, Any]] = None)[source]
Retrieve settings for plugin.
- get_value(*var_names, default=None)[source]
Fetch a setting.
- Parameters
var_names – A list of variable name alternatives
default – The default value to return if none are defined
- set_default(var_name: str, value)[source]
Add a setting if not currently defined.
- Parameters
var_name – The name of the setting
value – The value to assign
aries_cloudagent.config.util module
Entrypoint.
- class aries_cloudagent.config.util.BoundedInt(min: Optional[int] = None, max: Optional[int] = None)[source]
Bases:
object
Argument value parser for a bounded integer.
aries_cloudagent.config.wallet module
aries_cloudagent.connections package
Subpackages
DID Document model support.
Copyright 2017-2019 Government of Canada Public Services and Procurement Canada - buyandsell.gc.ca
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
- class aries_cloudagent.connections.models.diddoc.DIDDoc(did: Optional[str] = None)[source]
Bases:
object
DID document, grouping a DID with verification keys and services.
Retains DIDs as raw values (orientated toward indy-facing operations), everything else as URIs (oriented toward W3C-facing operations).
- CONTEXT = 'https://w3id.org/did/v1'
- add_service_pubkeys(service: dict, tags: Union[Sequence[str], str]) List[aries_cloudagent.connections.models.diddoc.publickey.PublicKey] [source]
Add public keys specified in service. Return public keys so discovered.
- Parameters
service – service from DID document
tags – potential tags marking public keys of type of interest (the standard is still coalescing)
- Raises
ValueError – for public key reference not present in DID document.
Returns: list of public keys from the document service specification
- classmethod deserialize(did_doc: dict) aries_cloudagent.connections.models.diddoc.diddoc.DIDDoc [source]
Construct DIDDoc object from dict representation.
- Parameters
did_doc – DIDDoc dict representation
- Raises
ValueError – for bad DID or missing mandatory item.
Returns: DIDDoc from input json
- classmethod from_json(did_doc_json: str) aries_cloudagent.connections.models.diddoc.diddoc.DIDDoc [source]
Construct DIDDoc object from json representation.
- Parameters
did_doc_json – DIDDoc json representation
Returns: DIDDoc from input json
- serialize() dict [source]
Dump current object to a JSON-compatible dictionary.
- Returns
dict representation of current DIDDoc
- set(item: Union[aries_cloudagent.connections.models.diddoc.service.Service, aries_cloudagent.connections.models.diddoc.publickey.PublicKey]) aries_cloudagent.connections.models.diddoc.diddoc.DIDDoc [source]
Add or replace service or public key; return current DIDDoc.
- Raises
ValueError – if input item is neither service nor public key.
- Parameters
item – service or public key to set
Returns: the current DIDDoc
- class aries_cloudagent.connections.models.diddoc.LinkedDataKeySpec(ver_type, authn_type, specifier)
Bases:
tuple
- property authn_type
Alias for field number 1
- property specifier
Alias for field number 2
- property ver_type
Alias for field number 0
- class aries_cloudagent.connections.models.diddoc.PublicKey(did: str, ident: str, value: str, pk_type: Optional[aries_cloudagent.connections.models.diddoc.publickey.PublicKeyType] = None, controller: Optional[str] = None, authn: bool = False)[source]
Bases:
object
Public key specification to embed in DID document.
Retains DIDs as raw values (orientated toward indy-facing operations), everything else as URIs (oriented toward W3C-facing operations).
- property authn: bool
Accessor for the authentication marker.
Returns: whether public key is marked as having DID authentication privilege
- property type: aries_cloudagent.connections.models.diddoc.publickey.PublicKeyType
Accessor for the public key type.
- class aries_cloudagent.connections.models.diddoc.PublicKeyType(value)[source]
Bases:
enum.Enum
Class encapsulating public key types.
- ED25519_SIG_2018 = LinkedDataKeySpec(ver_type='Ed25519VerificationKey2018', authn_type='Ed25519SignatureAuthentication2018', specifier='publicKeyBase58')
- EDDSA_SA_SIG_SECP256K1 = LinkedDataKeySpec(ver_type='Secp256k1VerificationKey2018', authn_type='Secp256k1SignatureAuthenticationKey2018', specifier='publicKeyHex')
- RSA_SIG_2018 = LinkedDataKeySpec(ver_type='RsaVerificationKey2018', authn_type='RsaSignatureAuthentication2018', specifier='publicKeyPem')
- static get(val: str) aries_cloudagent.connections.models.diddoc.publickey.PublicKeyType [source]
Find enum instance corresponding to input value (RsaVerificationKey2018 etc).
- Parameters
val – input value marking public key type
Returns: the public key type
- class aries_cloudagent.connections.models.diddoc.Service(did: str, ident: str, typ: str, recip_keys: Union[Sequence, aries_cloudagent.connections.models.diddoc.publickey.PublicKey], routing_keys: Union[Sequence, aries_cloudagent.connections.models.diddoc.publickey.PublicKey], endpoint: str, priority: int = 0)[source]
Bases:
object
Service specification to embed in DID document.
Retains DIDs as raw values (orientated toward indy-facing operations), everything else as URIs (oriented toward W3C-facing operations).
- property recip_keys: List[aries_cloudagent.connections.models.diddoc.publickey.PublicKey]
Accessor for the recipient keys.
- property routing_keys: List[aries_cloudagent.connections.models.diddoc.publickey.PublicKey]
Accessor for the routing keys.
DID Document classes.
Copyright 2017-2019 Government of Canada Public Services and Procurement Canada - buyandsell.gc.ca
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
- class aries_cloudagent.connections.models.diddoc.diddoc.DIDDoc(did: Optional[str] = None)[source]
Bases:
object
DID document, grouping a DID with verification keys and services.
Retains DIDs as raw values (orientated toward indy-facing operations), everything else as URIs (oriented toward W3C-facing operations).
- CONTEXT = 'https://w3id.org/did/v1'
- add_service_pubkeys(service: dict, tags: Union[Sequence[str], str]) List[aries_cloudagent.connections.models.diddoc.publickey.PublicKey] [source]
Add public keys specified in service. Return public keys so discovered.
- Parameters
service – service from DID document
tags – potential tags marking public keys of type of interest (the standard is still coalescing)
- Raises
ValueError – for public key reference not present in DID document.
Returns: list of public keys from the document service specification
- classmethod deserialize(did_doc: dict) aries_cloudagent.connections.models.diddoc.diddoc.DIDDoc [source]
Construct DIDDoc object from dict representation.
- Parameters
did_doc – DIDDoc dict representation
- Raises
ValueError – for bad DID or missing mandatory item.
Returns: DIDDoc from input json
- classmethod from_json(did_doc_json: str) aries_cloudagent.connections.models.diddoc.diddoc.DIDDoc [source]
Construct DIDDoc object from json representation.
- Parameters
did_doc_json – DIDDoc json representation
Returns: DIDDoc from input json
- serialize() dict [source]
Dump current object to a JSON-compatible dictionary.
- Returns
dict representation of current DIDDoc
- set(item: Union[aries_cloudagent.connections.models.diddoc.service.Service, aries_cloudagent.connections.models.diddoc.publickey.PublicKey]) aries_cloudagent.connections.models.diddoc.diddoc.DIDDoc [source]
Add or replace service or public key; return current DIDDoc.
- Raises
ValueError – if input item is neither service nor public key.
- Parameters
item – service or public key to set
Returns: the current DIDDoc
DID Document Public Key classes.
Copyright 2017-2019 Government of Canada Public Services and Procurement Canada - buyandsell.gc.ca
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
- class aries_cloudagent.connections.models.diddoc.publickey.LinkedDataKeySpec(ver_type, authn_type, specifier)
Bases:
tuple
- property authn_type
Alias for field number 1
- property specifier
Alias for field number 2
- property ver_type
Alias for field number 0
- class aries_cloudagent.connections.models.diddoc.publickey.PublicKey(did: str, ident: str, value: str, pk_type: Optional[aries_cloudagent.connections.models.diddoc.publickey.PublicKeyType] = None, controller: Optional[str] = None, authn: bool = False)[source]
Bases:
object
Public key specification to embed in DID document.
Retains DIDs as raw values (orientated toward indy-facing operations), everything else as URIs (oriented toward W3C-facing operations).
- property authn: bool
Accessor for the authentication marker.
Returns: whether public key is marked as having DID authentication privilege
- property type: aries_cloudagent.connections.models.diddoc.publickey.PublicKeyType
Accessor for the public key type.
- class aries_cloudagent.connections.models.diddoc.publickey.PublicKeyType(value)[source]
Bases:
enum.Enum
Class encapsulating public key types.
- ED25519_SIG_2018 = LinkedDataKeySpec(ver_type='Ed25519VerificationKey2018', authn_type='Ed25519SignatureAuthentication2018', specifier='publicKeyBase58')
- EDDSA_SA_SIG_SECP256K1 = LinkedDataKeySpec(ver_type='Secp256k1VerificationKey2018', authn_type='Secp256k1SignatureAuthenticationKey2018', specifier='publicKeyHex')
- RSA_SIG_2018 = LinkedDataKeySpec(ver_type='RsaVerificationKey2018', authn_type='RsaSignatureAuthentication2018', specifier='publicKeyPem')
- static get(val: str) aries_cloudagent.connections.models.diddoc.publickey.PublicKeyType [source]
Find enum instance corresponding to input value (RsaVerificationKey2018 etc).
- Parameters
val – input value marking public key type
Returns: the public key type
DID Document Service classes.
Copyright 2017-2019 Government of Canada Public Services and Procurement Canada - buyandsell.gc.ca
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
- class aries_cloudagent.connections.models.diddoc.service.Service(did: str, ident: str, typ: str, recip_keys: Union[Sequence, aries_cloudagent.connections.models.diddoc.publickey.PublicKey], routing_keys: Union[Sequence, aries_cloudagent.connections.models.diddoc.publickey.PublicKey], endpoint: str, priority: int = 0)[source]
Bases:
object
Service specification to embed in DID document.
Retains DIDs as raw values (orientated toward indy-facing operations), everything else as URIs (oriented toward W3C-facing operations).
- property recip_keys: List[aries_cloudagent.connections.models.diddoc.publickey.PublicKey]
Accessor for the recipient keys.
- property routing_keys: List[aries_cloudagent.connections.models.diddoc.publickey.PublicKey]
Accessor for the routing keys.
DIDDoc utility methods.
Copyright 2017-2019 Government of Canada Public Services and Procurement Canada - buyandsell.gc.ca
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
- aries_cloudagent.connections.models.diddoc.util.canon_did(uri: str) str [source]
Convert a URI into a DID if need be, left-stripping ‘did:sov:’ if present.
- Parameters
uri – input URI or DID
- Raises
ValueError – for invalid input.
- aries_cloudagent.connections.models.diddoc.util.canon_ref(did: str, ref: str, delimiter: Optional[str] = None)[source]
Given a reference in a DID document, return it in its canonical form of a URI.
- Parameters
did – DID acting as the identifier of the DID document
ref – reference to canonicalize, either a DID or a fragment pointing to a location in the DID doc
delimiter – delimiter character marking fragment (default ‘#’) or introducing identifier (‘;’) against DID resource
- aries_cloudagent.connections.models.diddoc.util.ok_did(token: str) bool [source]
Whether input token looks like a valid decentralized identifier.
- Parameters
token – candidate string
Returns: whether input token looks like a valid schema identifier
- aries_cloudagent.connections.models.diddoc.util.resource(ref: str, delimiter: Optional[str] = None) str [source]
Extract the resource for an identifier.
Given a (URI) reference, return up to its delimiter (exclusively), or all of it if there is none.
- Parameters
ref – reference
delimiter – delimiter character (default None maps to ‘#’, or ‘;’ introduces identifiers)
Submodules
aries_cloudagent.connections.base_manager module
aries_cloudagent.connections.util module
aries_cloudagent.core package
Subpackages
Submodules
aries_cloudagent.core.conductor module
aries_cloudagent.core.dispatcher module
aries_cloudagent.core.error module
Common exception classes.
- exception aries_cloudagent.core.error.BaseError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
Exception
Generic exception class which other exceptions should inherit from.
- exception aries_cloudagent.core.error.ProfileDuplicateError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.core.error.ProfileError
Profile with the given name already exists.
- exception aries_cloudagent.core.error.ProfileError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.core.error.BaseError
Base error for profile operations.
- exception aries_cloudagent.core.error.ProfileNotFoundError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.core.error.ProfileError
Requested profile was not found.
- exception aries_cloudagent.core.error.ProfileSessionInactiveError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.core.error.ProfileError
Error raised when a profile session is not currently active.
- exception aries_cloudagent.core.error.ProtocolDefinitionValidationError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.core.error.BaseError
Error raised when there is a problem validating a protocol definition.
- exception aries_cloudagent.core.error.ProtocolMinorVersionNotSupported(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.core.error.BaseError
Minimum minor version protocol error.
Error raised when protocol support exists but minimum minor version is higher than in @type parameter.
- exception aries_cloudagent.core.error.StartupError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.core.error.BaseError
Error raised when there is a problem starting the conductor.
aries_cloudagent.core.event_bus module
A simple event bus.
- class aries_cloudagent.core.event_bus.Event(topic: str, payload: Optional[Any] = None)[source]
Bases:
object
A simple event object.
- property payload
Return this event’s payload.
- property topic
Return this event’s topic.
- with_metadata(metadata: aries_cloudagent.core.event_bus.EventMetadata) aries_cloudagent.core.event_bus.EventWithMetadata [source]
Annotate event with metadata and return EventWithMetadata object.
- class aries_cloudagent.core.event_bus.EventBus[source]
Bases:
object
A simple event bus implementation.
- async notify(profile: Profile, event: aries_cloudagent.core.event_bus.Event)[source]
Notify subscribers of event.
- Parameters
profile (Profile) – context of the event
event (Event) – event to emit
- subscribe(pattern: Pattern, processor: Callable)[source]
Subscribe to an event.
- Parameters
pattern (Pattern) – compiled regular expression for matching topics
processor (Callable) – async callable accepting profile and event
- unsubscribe(pattern: Pattern, processor: Callable)[source]
Unsubscribe from an event.
This method is idempotent. Repeated calls to unsubscribe will not result in errors.
- Parameters
pattern (Pattern) – regular expression used to subscribe the processor
processor (Callable) – processor to unsubscribe
- wait_for_event(waiting_profile: Profile, pattern: Pattern, cond: Optional[Callable[[aries_cloudagent.core.event_bus.Event], bool]] = None) Iterator[Awaitable[aries_cloudagent.core.event_bus.Event]] [source]
Capture an event and retrieve its value.
- class aries_cloudagent.core.event_bus.EventMetadata(pattern: Pattern, match: Match[str])[source]
Bases:
tuple
Metadata passed alongside events to add context.
- property match
Alias for field number 1
- property pattern
Alias for field number 0
- class aries_cloudagent.core.event_bus.EventWithMetadata(topic: str, payload: Any, metadata: aries_cloudagent.core.event_bus.EventMetadata)[source]
Bases:
aries_cloudagent.core.event_bus.Event
Event with metadata passed alongside events to add context.
- property metadata: aries_cloudagent.core.event_bus.EventMetadata
Return metadata.
- class aries_cloudagent.core.event_bus.MockEventBus[source]
Bases:
aries_cloudagent.core.event_bus.EventBus
A mock EventBus for testing.
- async notify(profile: Profile, event: aries_cloudagent.core.event_bus.Event)[source]
Append the event to MockEventBus.events.
aries_cloudagent.core.goal_code_registry module
Handle registration and publication of supported goal codes.
aries_cloudagent.core.oob_processor module
aries_cloudagent.core.plugin_registry module
Handle registration of plugin modules for extending functionality.
- class aries_cloudagent.core.plugin_registry.PluginRegistry(blocklist: Iterable[str] = [])[source]
Bases:
object
Plugin registry for indexing application plugins.
- async init_context(context: aries_cloudagent.config.injection_context.InjectionContext)[source]
Call plugin setup methods on the current context.
- async load_protocol_version(context: aries_cloudagent.config.injection_context.InjectionContext, mod: module, version_definition: Optional[dict] = None)[source]
Load a particular protocol version.
- async load_protocols(context: aries_cloudagent.config.injection_context.InjectionContext, plugin: module)[source]
For modules that don’t implement setup, register protocols manually.
- property plugins: Sequence[module]
Accessor for a list of all plugin modules.
- register_package(package_name: str) Sequence[module] [source]
Register all modules (sub-packages) under a given package name.
- register_protocol_events(context: aries_cloudagent.config.injection_context.InjectionContext)[source]
Call route register_events methods on the current context.
aries_cloudagent.core.profile module
Classes for managing profile information within a request context.
- class aries_cloudagent.core.profile.Profile(*, context: Optional[aries_cloudagent.config.injection_context.InjectionContext] = None, name: Optional[str] = None, created: bool = False)[source]
Bases:
abc.ABC
Base abstraction for handling identity-related state.
- property context: aries_cloudagent.config.injection_context.InjectionContext
Accessor for the injection context.
- inject(base_cls: Type[aries_cloudagent.config.base.InjectType], settings: Optional[Mapping[str, object]] = None) aries_cloudagent.config.base.InjectType [source]
Get the provided instance of a given class identifier.
- Parameters
cls – The base class to retrieve an instance of
settings – An optional mapping providing configuration to the provider
- Returns
An instance of the base class, or None
- inject_or(base_cls: Type[aries_cloudagent.config.base.InjectType], settings: Optional[Mapping[str, object]] = None, default: Optional[aries_cloudagent.config.base.InjectType] = None) Optional[aries_cloudagent.config.base.InjectType] [source]
Get the provided instance of a given class identifier or default if not found.
- Parameters
base_cls – The base class to retrieve an instance of
settings – An optional dict providing configuration to the provider
default – default return value if no instance is found
- Returns
An instance of the base class, or None
- abstract session(context: Optional[aries_cloudagent.config.injection_context.InjectionContext] = None) aries_cloudagent.core.profile.ProfileSession [source]
Start a new interactive session with no transaction support requested.
- property settings: aries_cloudagent.config.base.BaseSettings
Accessor for scope-specific settings.
- abstract transaction(context: Optional[aries_cloudagent.config.injection_context.InjectionContext] = None) aries_cloudagent.core.profile.ProfileSession [source]
Start a new interactive session with commit and rollback support.
If the current backend does not support transactions, then commit and rollback operations of the session will not have any effect.
- class aries_cloudagent.core.profile.ProfileManager[source]
Bases:
abc.ABC
Handle provision and open for profile instances.
- abstract async open(context: aries_cloudagent.config.injection_context.InjectionContext, config: Optional[Mapping[str, Any]] = None) aries_cloudagent.core.profile.Profile [source]
Open an instance of an existing profile.
- abstract async provision(context: aries_cloudagent.config.injection_context.InjectionContext, config: Optional[Mapping[str, Any]] = None) aries_cloudagent.core.profile.Profile [source]
Provision a new instance of a profile.
- class aries_cloudagent.core.profile.ProfileManagerProvider[source]
Bases:
aries_cloudagent.config.base.BaseProvider
The standard profile manager provider which keys off the selected wallet type.
- MANAGER_TYPES = {'askar': 'aries_cloudagent.askar.profile.AskarProfileManager', 'in_memory': 'aries_cloudagent.core.in_memory.InMemoryProfileManager', 'indy': 'aries_cloudagent.indy.sdk.profile.IndySdkProfileManager'}
- provide(settings: aries_cloudagent.config.base.BaseSettings, injector: aries_cloudagent.config.base.BaseInjector)[source]
Create the profile manager instance.
- class aries_cloudagent.core.profile.ProfileSession(profile: aries_cloudagent.core.profile.Profile, *, context: Optional[aries_cloudagent.config.injection_context.InjectionContext] = None, settings: Optional[Mapping[str, Any]] = None)[source]
Bases:
abc.ABC
An active connection to the profile management backend.
- async commit()[source]
Commit any updates performed within the transaction.
If the current session is not a transaction, then nothing is performed.
- property context: aries_cloudagent.config.injection_context.InjectionContext
Accessor for the associated injection context.
- inject(base_cls: Type[aries_cloudagent.config.base.InjectType], settings: Optional[Mapping[str, object]] = None) aries_cloudagent.config.base.InjectType [source]
Get the provided instance of a given class identifier.
- Parameters
cls – The base class to retrieve an instance of
settings – An optional mapping providing configuration to the provider
- Returns
An instance of the base class, or None
- inject_or(base_cls: Type[aries_cloudagent.config.base.InjectType], settings: Optional[Mapping[str, object]] = None, default: Optional[aries_cloudagent.config.base.InjectType] = None) Optional[aries_cloudagent.config.base.InjectType] [source]
Get the provided instance of a given class identifier or default if not found.
- Parameters
base_cls – The base class to retrieve an instance of
settings – An optional dict providing configuration to the provider
default – default return value if no instance is found
- Returns
An instance of the base class, or None
- property profile: aries_cloudagent.core.profile.Profile
Accessor for the associated profile instance.
- async rollback()[source]
Roll back any updates performed within the transaction.
If the current session is not a transaction, then nothing is performed.
- property settings: aries_cloudagent.config.base.BaseSettings
Accessor for scope-specific settings.
aries_cloudagent.core.protocol_registry module
Handle registration and publication of supported protocols.
- class aries_cloudagent.core.protocol_registry.ProtocolRegistry[source]
Bases:
object
Protocol registry for indexing message families.
- create_msg_types_for_minor_version(typesets, version_definition)[source]
Return mapping of message type to module path for minor versions.
- Parameters
typesets – Mappings of message types to register
version_definition – Optional version definition dict
- Returns
Typesets mapping
- async prepare_disclosed(context: aries_cloudagent.config.injection_context.InjectionContext, protocols: Sequence[str])[source]
Call controllers and return publicly supported message families and roles.
- protocols_matching_query(query: str) Sequence[str] [source]
Return a list of message protocols matching a query string.
- register_controllers(*controller_sets, version_definition=None)[source]
Add new controllers.
- Parameters
controller_sets – Mappings of message families to coroutines
aries_cloudagent.core.util module
aries_cloudagent.did package
Submodules
aries_cloudagent.did.did_key module
aries_cloudagent.holder package
Submodules
aries_cloudagent.holder.routes module
aries_cloudagent.indy package
Subpackages
Utilities for dealing with predicates.
- class aries_cloudagent.indy.models.predicate.Predicate(value)[source]
Bases:
enum.Enum
Enum for predicate types that indy-sdk supports.
- GE = Relation(fortran='GE', wql='$gte', math='>=', yes=<function Predicate.<lambda>>, no=<function Predicate.<lambda>>)
- GT = Relation(fortran='GT', wql='$gt', math='>', yes=<function Predicate.<lambda>>, no=<function Predicate.<lambda>>)
- LE = Relation(fortran='LE', wql='$lte', math='<=', yes=<function Predicate.<lambda>>, no=<function Predicate.<lambda>>)
- LT = Relation(fortran='LT', wql='$lt', math='<', yes=<function Predicate.<lambda>>, no=<function Predicate.<lambda>>)
- static get(relation: str) aries_cloudagent.indy.models.predicate.Predicate [source]
Return enum instance corresponding to input relation string.
Indy error handling.
- class aries_cloudagent.indy.sdk.error.IndyErrorHandler(message: Optional[str] = None, error_cls: Type[aries_cloudagent.core.error.BaseError] = <class 'aries_cloudagent.core.error.BaseError'>)[source]
Bases:
object
Trap IndyError and raise an appropriate LedgerError instead.
- classmethod wrap_error(err_value: indy.error.IndyError, message: Optional[str] = None, error_cls: Type[aries_cloudagent.core.error.BaseError] = <class 'aries_cloudagent.core.error.BaseError'>) aries_cloudagent.core.error.BaseError [source]
Create an instance of BaseError from an IndyError.
Indy SDK holder implementation.
- class aries_cloudagent.indy.sdk.holder.IndySdkHolder(wallet: aries_cloudagent.indy.sdk.wallet_setup.IndyOpenWallet)[source]
Bases:
aries_cloudagent.indy.holder.IndyHolder
Indy-SDK holder implementation.
- async create_credential_request(credential_offer: dict, credential_definition: dict, holder_did: str) Tuple[str, str] [source]
Create a credential request for the given credential offer.
- Parameters
credential_offer – The credential offer to create request for
credential_definition – The credential definition to create an offer for
holder_did – the DID of the agent making the request
- Returns
A tuple of the credential request and credential request metadata
- async create_presentation(presentation_request: dict, requested_credentials: dict, schemas: dict, credential_definitions: dict, rev_states: Optional[dict] = None) str [source]
Get credentials stored in the wallet.
- Parameters
presentation_request – Valid indy format presentation request
requested_credentials – Indy format requested credentials
schemas – Indy formatted schemas JSON
credential_definitions – Indy formatted credential definitions JSON
rev_states – Indy format revocation states JSON
- async create_revocation_state(cred_rev_id: str, rev_reg_def: dict, rev_reg_delta: dict, timestamp: int, tails_file_path: str) str [source]
Create current revocation state for a received credential.
- Parameters
cred_rev_id – credential revocation id in revocation registry
rev_reg_def – revocation registry definition
rev_reg_delta – revocation delta
timestamp – delta timestamp
- Returns
the revocation state
- async credential_revoked(ledger: aries_cloudagent.ledger.base.BaseLedger, credential_id: str, fro: Optional[int] = None, to: Optional[int] = None) bool [source]
Check ledger for revocation status of credential by cred id.
- Parameters
credential_id – Credential id to check
- async delete_credential(credential_id: str)[source]
Remove a credential stored in the wallet.
- Parameters
credential_id – Credential id to remove
- async get_credential(credential_id: str) str [source]
Get a credential stored in the wallet.
- Parameters
credential_id – Credential id to retrieve
- async get_credentials(start: int, count: int, wql: dict)[source]
Get credentials stored in the wallet.
- Parameters
start – Starting index
count – Number of records to return
wql – wql query dict
- async get_credentials_for_presentation_request_by_referent(presentation_request: dict, referents: Sequence[str], start: int, count: int, extra_query: dict = {})[source]
Get credentials stored in the wallet.
- Parameters
presentation_request – Valid presentation request from issuer
referents – Presentation request referents to use to search for creds
start – Starting index
count – Maximum number of records to return
extra_query – wql query dict
- async get_mime_type(credential_id: str, attr: Optional[str] = None) Union[dict, str] [source]
Get MIME type per attribute (or for all attributes).
- Parameters
credential_id – credential id
attr – attribute of interest or omit for all
- Returns: Attribute MIME type or dict mapping attribute names to MIME types
attr_meta_json = all_meta.tags.get(attr)
- async store_credential(credential_definition: dict, credential_data: dict, credential_request_metadata: dict, credential_attr_mime_types=None, credential_id: Optional[str] = None, rev_reg_def: Optional[dict] = None) str [source]
Store a credential in the wallet.
- Parameters
credential_definition – Credential definition for this credential
credential_data – Credential data generated by the issuer
credential_request_metadata – credential request metadata generated by the issuer
credential_attr_mime_types – dict mapping attribute names to (optional) MIME types to store as non-secret record, if specified
credential_id – optionally override the stored credential id
rev_reg_def – revocation registry definition in json
- Returns
the ID of the stored credential
Indy utilities.
Utility for loading Postgres wallet plug-in.
Indy-SDK wallet setup and configuration.
- class aries_cloudagent.indy.sdk.wallet_setup.IndyOpenWallet(config: aries_cloudagent.indy.sdk.wallet_setup.IndyWalletConfig, created, handle, master_secret_id: str)[source]
Bases:
object
Handle and metadata for an opened Indy wallet.
- class aries_cloudagent.indy.sdk.wallet_setup.IndyWalletConfig(config: Optional[Mapping[str, Any]] = None)[source]
Bases:
object
A helper class for handling Indy-SDK wallet configuration.
- DEFAULT_FRESHNESS = False
- DEFAULT_KEY = ''
- DEFAULT_KEY_DERIVATION = 'ARGON2I_MOD'
- DEFAULT_STORAGE_TYPE = None
- KEY_DERIVATION_ARGON2I_INT = 'ARGON2I_INT'
- KEY_DERIVATION_ARGON2I_MOD = 'ARGON2I_MOD'
- KEY_DERIVATION_RAW = 'RAW'
- async create_wallet() aries_cloudagent.indy.sdk.wallet_setup.IndyOpenWallet [source]
Create a new wallet.
- Raises
ProfileDuplicateError – If there was an existing wallet with the same name
ProfileError – If there was a problem removing the wallet
ProfileError – If there was another libindy error
- async open_wallet(created: bool = False) aries_cloudagent.indy.sdk.wallet_setup.IndyOpenWallet [source]
Open wallet, removing and/or creating it if so configured.
- Raises
ProfileError – If wallet not found after creation
ProfileNotFoundError – If the wallet is not found
ProfileError – If the wallet is already open
ProfileError – If there is another libindy error
Submodules
aries_cloudagent.indy.holder module
Base Indy Holder class.
- class aries_cloudagent.indy.holder.IndyHolder[source]
Bases:
abc.ABC
Base class for holder.
- CHUNK = 256
- RECORD_TYPE_MIME_TYPES = 'attribute-mime-types'
- abstract async create_credential_request(credential_offer: dict, credential_definition: dict, holder_did: str) Tuple[str, str] [source]
Create a credential request for the given credential offer.
- Parameters
credential_offer – The credential offer to create request for
credential_definition – The credential definition to create an offer for
holder_did – the DID of the agent making the request
- Returns
A tuple of the credential request and credential request metadata
- abstract async create_presentation(presentation_request: dict, requested_credentials: dict, schemas: dict, credential_definitions: dict, rev_states: Optional[dict] = None) str [source]
Get credentials stored in the wallet.
- Parameters
presentation_request – Valid indy format presentation request
requested_credentials – Indy format requested credentials
schemas – Indy formatted schemas JSON
credential_definitions – Indy formatted credential definitions JSON
rev_states – Indy format revocation states JSON
- abstract async create_revocation_state(cred_rev_id: str, rev_reg_def: dict, rev_reg_delta: dict, timestamp: int, tails_file_path: str) str [source]
Create current revocation state for a received credential.
- Parameters
cred_rev_id – credential revocation id in revocation registry
rev_reg_def – revocation registry definition
rev_reg_delta – revocation delta
timestamp – delta timestamp
- Returns
the revocation state
- abstract async credential_revoked(ledger: aries_cloudagent.ledger.base.BaseLedger, credential_id: str, fro: Optional[int] = None, to: Optional[int] = None) bool [source]
Check ledger for revocation status of credential by cred id.
- Parameters
credential_id – Credential id to check
- abstract async delete_credential(credential_id: str)[source]
Remove a credential stored in the wallet.
- Parameters
credential_id – Credential id to remove
- abstract async get_credential(credential_id: str) str [source]
Get a credential stored in the wallet.
- Parameters
credential_id – Credential id to retrieve
- abstract async get_mime_type(credential_id: str, attr: Optional[str] = None) Union[dict, str] [source]
Get MIME type per attribute (or for all attributes).
- Parameters
credential_id – credential id
attr – attribute of interest or omit for all
- Returns: Attribute MIME type or dict mapping attribute names to MIME types
attr_meta_json = all_meta.tags.get(attr)
- abstract async store_credential(credential_definition: dict, credential_data: dict, credential_request_metadata: dict, credential_attr_mime_types=None, credential_id: Optional[str] = None, rev_reg_def: Optional[dict] = None)[source]
Store a credential in the wallet.
- Parameters
credential_definition – Credential definition for this credential
credential_data – Credential data generated by the issuer
credential_request_metadata – credential request metadata generated by the issuer
credential_attr_mime_types – dict mapping attribute names to (optional) MIME types to store as non-secret record, if specified
credential_id – optionally override the stored credential id
rev_reg_def – revocation registry definition in json
- Returns
the ID of the stored credential
- exception aries_cloudagent.indy.holder.IndyHolderError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.core.error.BaseError
Base class for holder exceptions.
aries_cloudagent.indy.issuer module
Base Indy Issuer class.
- class aries_cloudagent.indy.issuer.IndyIssuer[source]
Bases:
abc.ABC
Base class for Indy Issuer.
- abstract async create_and_store_credential_definition(origin_did: str, schema: dict, signature_type: Optional[str] = None, tag: Optional[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
- abstract async 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) 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
- Returns
A tuple of the revocation registry ID, JSON, and entry JSON
- abstract async create_credential(schema: dict, credential_offer: dict, credential_request: dict, credential_values: dict, cred_ex_id: str, revoc_reg_id: Optional[str] = None, tails_file_path: Optional[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 cred_ex_id: credential exchange identifier to use in issuer cred rev rec revoc_reg_id: ID of the revocation registry tails_file_path: The location of the tails file
- Returns
A tuple of created credential and revocation id
- abstract async 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
- abstract async create_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
- abstract async 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: Optional[str] = None, tag: Optional[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.
- abstract async 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
- abstract async revoke_credentials(revoc_reg_id: str, tails_file_path: str, cred_rev_ids: Sequence[str]) Tuple[str, Sequence[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_rev_ids – sequences of credential indexes in the revocation registry
- Returns
Tuple with the combined revocation delta, list of cred rev ids not revoked
- exception aries_cloudagent.indy.issuer.IndyIssuerError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.core.error.BaseError
Generic issuer error.
- exception aries_cloudagent.indy.issuer.IndyIssuerRevocationRegistryFullError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.indy.issuer.IndyIssuerError
Revocation registry is full when issuing a new credential.
aries_cloudagent.indy.util module
Utilities for dealing with Indy conventions.
- async aries_cloudagent.indy.util.generate_pr_nonce() str [source]
Generate a nonce for a proof request.
aries_cloudagent.indy.verifier module
aries_cloudagent.ledger package
Subpackages
Constants for State Proof and LeafHash Inclusion Verification.
Utilities for Processing Replies to Domain Read Requests.
- aries_cloudagent.ledger.merkel_validation.domain_txn_handler.decode_state_value(encoded_value)[source]
Return val, lsn, lut from encoded state value.
- aries_cloudagent.ledger.merkel_validation.domain_txn_handler.encode_state_value(value, seqNo, txnTime)[source]
Return encoded state value.
- aries_cloudagent.ledger.merkel_validation.domain_txn_handler.extract_params_write_request(data)[source]
Return tree_size, leaf_index, audit_path, expected_root_hash from reply.
- aries_cloudagent.ledger.merkel_validation.domain_txn_handler.get_proof_nodes(reply)[source]
Return proof_nodes from reply.
- aries_cloudagent.ledger.merkel_validation.domain_txn_handler.hash_of(text) str [source]
Return 256 bit hexadecimal digest of text.
- aries_cloudagent.ledger.merkel_validation.domain_txn_handler.make_state_path_for_attr(did, attr_name, attr_is_hash=False) bytes [source]
Return state_path for ATTR.
- aries_cloudagent.ledger.merkel_validation.domain_txn_handler.make_state_path_for_claim_def(authors_did, schema_seq_no, signature_type, tag)[source]
Return state_path for CLAIM DEF.
- aries_cloudagent.ledger.merkel_validation.domain_txn_handler.make_state_path_for_nym(did) bytes [source]
Return state_path for NYM.
- aries_cloudagent.ledger.merkel_validation.domain_txn_handler.make_state_path_for_revoc_def(authors_did, cred_def_id, revoc_def_type, revoc_def_tag) bytes [source]
Return state_path for REVOC_DEF.
- aries_cloudagent.ledger.merkel_validation.domain_txn_handler.make_state_path_for_revoc_reg_entry(revoc_reg_def_id) bytes [source]
Return state_path for REVOC_REG_ENTRY.
- aries_cloudagent.ledger.merkel_validation.domain_txn_handler.make_state_path_for_revoc_reg_entry_accum(revoc_reg_def_id) bytes [source]
Return state_path for REVOC_REG_ENTRY_ACCUM.
- aries_cloudagent.ledger.merkel_validation.domain_txn_handler.make_state_path_for_schema(authors_did, schema_name, schema_version) bytes [source]
Return state_path for SCHEMA.
- aries_cloudagent.ledger.merkel_validation.domain_txn_handler.parse_attr_txn(txn_data)[source]
Process txn_data and parse attr_txn based on attr_type.
- aries_cloudagent.ledger.merkel_validation.domain_txn_handler.prepare_attr_for_state(txn, path_only=False)[source]
Return key, value pair for state from ATTR.
- aries_cloudagent.ledger.merkel_validation.domain_txn_handler.prepare_claim_def_for_state(txn, path_only=False)[source]
Return key-value pair for state from CLAIM_DEF.
- aries_cloudagent.ledger.merkel_validation.domain_txn_handler.prepare_for_state_read(reply)[source]
Return state value from read requests reply.
- aries_cloudagent.ledger.merkel_validation.domain_txn_handler.prepare_for_state_write(reply)[source]
Return state key, value pair from write requests reply.
- aries_cloudagent.ledger.merkel_validation.domain_txn_handler.prepare_get_attr_for_state(reply)[source]
Return value for state from GET_ATTR.
- aries_cloudagent.ledger.merkel_validation.domain_txn_handler.prepare_get_claim_def_for_state(reply)[source]
Return value for state from GET_CLAIM_DEF.
- aries_cloudagent.ledger.merkel_validation.domain_txn_handler.prepare_get_nym_for_state(reply)[source]
Return value for state from GET_NYM.
- aries_cloudagent.ledger.merkel_validation.domain_txn_handler.prepare_get_revoc_def_for_state(reply)[source]
Return value for state from GET_REVOC_DEF.
- aries_cloudagent.ledger.merkel_validation.domain_txn_handler.prepare_get_revoc_reg_delta_for_state(reply)[source]
Return value for state from GET_REVOC_REG_DELTA.
- aries_cloudagent.ledger.merkel_validation.domain_txn_handler.prepare_get_revoc_reg_entry_accum_for_state(reply)[source]
Return value for state from GET_REVOC_REG_ENTRY_ACCUM.
- aries_cloudagent.ledger.merkel_validation.domain_txn_handler.prepare_get_revoc_reg_entry_for_state(reply)[source]
Return value for state from GET_REVOC_REG_ENTRY.
- aries_cloudagent.ledger.merkel_validation.domain_txn_handler.prepare_get_schema_for_state(reply)[source]
Return value for state from GET_SCHEMA.
- aries_cloudagent.ledger.merkel_validation.domain_txn_handler.prepare_nym_for_state(txn)[source]
Return encoded state path from NYM.
- aries_cloudagent.ledger.merkel_validation.domain_txn_handler.prepare_revoc_def_for_state(txn, path_only=False)[source]
Return key-value pair for state from REVOC_DEF.
- aries_cloudagent.ledger.merkel_validation.domain_txn_handler.prepare_revoc_reg_entry_accum_for_state(txn)[source]
Return key-value pair for state from REVOC_REG_ENTRY_ACCUM.
Merkle tree hasher for leaf and children nodes.
- class aries_cloudagent.ledger.merkel_validation.hasher.HexTreeHasher(hashfunc=<built-in function openssl_sha256>)[source]
Bases:
aries_cloudagent.ledger.merkel_validation.hasher.TreeHasher
Merkle tree hasher for hex data.
Verify Leaf Inclusion.
- class aries_cloudagent.ledger.merkel_validation.merkel_verifier.MerkleVerifier(hasher=<aries_cloudagent.ledger.merkel_validation.hasher.TreeHasher object>)[source]
Bases:
object
Utility class for verifying leaf inclusion.
- async calculate_root_hash(leaf, leaf_index, audit_path, tree_size)[source]
Calculate root hash, used to verify Merkel AuditPath.
Reference: section 2.1.1 of RFC6962.
- Parameters
leaf – Leaf data.
leaf_index – Index of the leaf in the tree.
audit_path – A list of SHA-256 hashes representing the Merkle audit
path. –
tree_size – tree size
Validates State Proof.
- class aries_cloudagent.ledger.merkel_validation.trie.SubTrie(root_hash=None)[source]
Bases:
object
Utility class for SubTrie and State Proof validation.
- async static get_new_trie_with_proof_nodes(proof_nodes)[source]
Return SubTrie created from proof_nodes.
- property root_hash
Return 32 bytes string.
Merkel Validation Utils.
- aries_cloudagent.ledger.merkel_validation.utils.audit_path_length(index: int, tree_size: int)[source]
Return AuditPath length.
- Parameters
index – Leaf index
tree_size – Tree size
- aries_cloudagent.ledger.merkel_validation.utils.bin_to_nibbles(s)[source]
Convert string s to nibbles (half-bytes).
Submodules
aries_cloudagent.ledger.base module
Ledger base class.
- class aries_cloudagent.ledger.base.BaseLedger[source]
Bases:
abc.ABC
Base class for ledger.
- abstract async accept_txn_author_agreement(taa_record: dict, mechanism: str, accept_time: Optional[int] = None)[source]
Save a new record recording the acceptance of the TAA.
- abstract async create_and_send_credential_definition(issuer: aries_cloudagent.indy.issuer.IndyIssuer, schema_id: str, signature_type: Optional[str] = None, tag: Optional[str] = None, support_revocation: bool = False, write_ledger: bool = True, endorser_did: Optional[str] = None) Tuple[str, dict, bool] [source]
Send credential definition to ledger and store relevant key matter in wallet.
- Parameters
issuer – The issuer instance to use for credential definition creation
schema_id – The schema id of the schema to create cred def for
signature_type – The signature type to use on the credential definition
tag – Optional tag to distinguish multiple credential definitions
support_revocation – Optional flag to enable revocation for this cred def
- Returns
Tuple with cred def id, cred def structure, and whether it’s novel
- abstract async create_and_send_schema(issuer: aries_cloudagent.indy.issuer.IndyIssuer, schema_name: str, schema_version: str, attribute_names: Sequence[str], write_ledger: bool = True, endorser_did: Optional[str] = None) Tuple[str, dict] [source]
Send schema to ledger.
- Parameters
issuer – The issuer instance to use for schema creation
schema_name – The schema name
schema_version – The schema version
attribute_names – A list of schema attributes
- abstract async get_all_endpoints_for_did(did: str) dict [source]
Fetch all endpoints for a ledger DID.
- Parameters
did – The DID to look up on the ledger or in the cache
- abstract async get_credential_definition(credential_definition_id: str) dict [source]
Get a credential definition from the cache if available, otherwise the ledger.
- Parameters
credential_definition_id – The schema id of the schema to fetch cred def for
- abstract async get_endpoint_for_did(did: str, endpoint_type: aries_cloudagent.ledger.endpoint_type.EndpointType = EndpointType.ENDPOINT) str [source]
Fetch the endpoint for a ledger DID.
- Parameters
did – The DID to look up on the ledger or in the cache
endpoint_type – The type of the endpoint (default ‘endpoint’)
- abstract async get_key_for_did(did: str) str [source]
Fetch the verkey for a ledger DID.
- Parameters
did – The DID to look up on the ledger or in the cache
- abstract async get_nym_role(did: str)[source]
Return the role registered to input public DID on the ledger.
- Parameters
did – DID to register on the ledger.
- abstract async get_revoc_reg_def(revoc_reg_id: str) dict [source]
Look up a revocation registry definition by ID.
- abstract async get_revoc_reg_delta(revoc_reg_id: str, timestamp_from=0, timestamp_to=None) Tuple[dict, int] [source]
Look up a revocation registry delta by ID.
- abstract async get_revoc_reg_entry(revoc_reg_id: str, timestamp: int) Tuple[dict, int] [source]
Get revocation registry entry by revocation registry ID and timestamp.
- abstract async get_schema(schema_id: str) dict [source]
Get a schema from the cache if available, otherwise fetch from the ledger.
- Parameters
schema_id – The schema id (or stringified sequence number) to retrieve
- abstract async get_txn_author_agreement(reload: bool = False)[source]
Get the current transaction author agreement, fetching it if necessary.
- abstract async register_nym(did: str, verkey: str, alias: Optional[str] = None, role: Optional[str] = None, write_ledger: bool = True, endorser_did: Optional[str] = None) Tuple[bool, dict] [source]
Register a nym on the ledger.
- Parameters
did – DID to register on the ledger.
verkey – The verification key of the keypair.
alias – Human-friendly alias to assign to the DID.
role – For permissioned ledgers, what role should the new DID have.
- abstract async rotate_public_did_keypair(next_seed: Optional[str] = None) None [source]
Rotate keypair for public DID: create new key, submit to ledger, update wallet.
- Parameters
next_seed – seed for incoming ed25519 keypair (default random)
- abstract async send_revoc_reg_def(revoc_reg_def: dict, issuer_did: Optional[str] = None, write_ledger: bool = True, endorser_did: Optional[str] = None)[source]
Publish a revocation registry definition to the ledger.
- abstract async send_revoc_reg_entry(revoc_reg_id: str, revoc_def_type: str, revoc_reg_entry: dict, issuer_did: Optional[str] = None, write_ledger: bool = True, endorser_did: Optional[str] = None)[source]
Publish a revocation registry entry to the ledger.
- abstract async txn_endorse(request_json: str, endorse_did: Optional[aries_cloudagent.wallet.did_info.DIDInfo] = None) str [source]
Endorse (sign) the provided transaction.
- abstract async txn_submit(request_json: str, sign: bool, taa_accept: bool, sign_did: aries_cloudagent.wallet.did_info.DIDInfo = <object object>) str [source]
Write the provided (signed and possibly endorsed) transaction to the ledger.
- abstract async update_endpoint_for_did(did: str, endpoint: str, endpoint_type: aries_cloudagent.ledger.endpoint_type.EndpointType = EndpointType.ENDPOINT, write_ledger: bool = True, endorser_did: Optional[str] = None) bool [source]
Check and update the endpoint on the ledger.
- Parameters
did – The ledger DID
endpoint – The endpoint address
endpoint_type – The type of the endpoint (default ‘endpoint’)
- class aries_cloudagent.ledger.base.Role(value)[source]
Bases:
enum.Enum
Enum for indy roles.
- ENDORSER = (101,)
- NETWORK_MONITOR = (201,)
- ROLE_REMOVE = ('',)
- STEWARD = (2,)
- TRUSTEE = (0,)
- USER = (None, '')
- static get(token: Optional[Union[str, int]] = None) aries_cloudagent.ledger.base.Role [source]
Return enum instance corresponding to input token.
- Parameters
token – token identifying role to indy-sdk: “STEWARD”, “TRUSTEE”, “ENDORSER”, “” or None
aries_cloudagent.ledger.endpoint_type module
Ledger utilities.
- class aries_cloudagent.ledger.endpoint_type.EndpointType(value)[source]
Bases:
enum.Enum
Enum for endpoint/service types.
- ENDPOINT = EndpointTypeName(w3c='Endpoint', indy='endpoint')
- LINKED_DOMAINS = EndpointTypeName(w3c='LinkedDomains', indy='linked_domains')
- PROFILE = EndpointTypeName(w3c='Profile', indy='profile')
- static get(name: str) aries_cloudagent.ledger.endpoint_type.EndpointType [source]
Return enum instance corresponding to input string.
- property indy
internally-facing, on ledger and in wallet.
- Type
Indy name of endpoint type
- property w3c
externally-facing.
- Type
W3C name of endpoint type
aries_cloudagent.ledger.error module
Ledger related errors.
- exception aries_cloudagent.ledger.error.BadLedgerRequestError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.ledger.error.LedgerError
The current request cannot proceed.
- exception aries_cloudagent.ledger.error.ClosedPoolError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.ledger.error.LedgerError
Indy pool is closed.
- exception aries_cloudagent.ledger.error.LedgerConfigError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.ledger.error.LedgerError
Base class for ledger configuration errors.
- exception aries_cloudagent.ledger.error.LedgerError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.core.error.BaseError
Base class for ledger errors.
- exception aries_cloudagent.ledger.error.LedgerTransactionError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.ledger.error.LedgerError
The ledger rejected the transaction.
aries_cloudagent.ledger.indy module
Indy ledger implementation.
- class aries_cloudagent.ledger.indy.IndySdkLedger(pool: aries_cloudagent.ledger.indy.IndySdkLedgerPool, profile: aries_cloudagent.core.profile.Profile)[source]
Bases:
aries_cloudagent.ledger.base.BaseLedger
Indy ledger class.
- async accept_txn_author_agreement(taa_record: dict, mechanism: str, accept_time: Optional[int] = None)[source]
Save a new record recording the acceptance of the TAA.
- async build_and_return_get_nym_request(submitter_did: Optional[str], target_did: str) str [source]
Build GET_NYM request and return request_json.
- async check_existing_schema(public_did: str, schema_name: str, schema_version: str, attribute_names: Sequence[str]) Tuple[str, dict] [source]
Check if a schema has already been published.
- async create_and_send_credential_definition(issuer: aries_cloudagent.indy.issuer.IndyIssuer, schema_id: str, signature_type: Optional[str] = None, tag: Optional[str] = None, support_revocation: bool = False, write_ledger: bool = True, endorser_did: Optional[str] = None) Tuple[str, dict, bool] [source]
Send credential definition to ledger and store relevant key matter in wallet.
- Parameters
issuer – The issuer instance to use for credential definition creation
schema_id – The schema id of the schema to create cred def for
signature_type – The signature type to use on the credential definition
tag – Optional tag to distinguish multiple credential definitions
support_revocation – Optional flag to enable revocation for this cred def
- Returns
Tuple with cred def id, cred def structure, and whether it’s novel
- async create_and_send_schema(issuer: aries_cloudagent.indy.issuer.IndyIssuer, schema_name: str, schema_version: str, attribute_names: Sequence[str], write_ledger: bool = True, endorser_did: Optional[str] = None) Tuple[str, dict] [source]
Send schema to ledger.
- Parameters
issuer – The issuer instance creating the schema
schema_name – The schema name
schema_version – The schema version
attribute_names – A list of schema attributes
- async credential_definition_id2schema_id(credential_definition_id)[source]
From a credential definition, get the identifier for its schema.
- Parameters
credential_definition_id – The identifier of the credential definition from which to identify a schema
- async fetch_credential_definition(credential_definition_id: str) dict [source]
Get a credential definition from the ledger by id.
- Parameters
credential_definition_id – The cred def id of the cred def to fetch
- async fetch_schema_by_id(schema_id: str) dict [source]
Get schema from ledger.
- Parameters
schema_id – The schema id (or stringified sequence number) to retrieve
- Returns
Indy schema dict
- async fetch_schema_by_seq_no(seq_no: int)[source]
Fetch a schema by its sequence number.
- Parameters
seq_no – schema ledger sequence number
- Returns
Indy schema dict
- async get_all_endpoints_for_did(did: str) dict [source]
Fetch all endpoints for a ledger DID.
- Parameters
did – The DID to look up on the ledger or in the cache
- async get_credential_definition(credential_definition_id: str) dict [source]
Get a credential definition from the cache if available, otherwise the ledger.
- Parameters
credential_definition_id – The schema id of the schema to fetch cred def for
- async get_endpoint_for_did(did: str, endpoint_type: Optional[aries_cloudagent.ledger.endpoint_type.EndpointType] = None) str [source]
Fetch the endpoint for a ledger DID.
- Parameters
did – The DID to look up on the ledger or in the cache
endpoint_type – The type of the endpoint. If none given, returns all
- async get_indy_storage() aries_cloudagent.storage.indy.IndySdkStorage [source]
Get an IndySdkStorage instance for the current wallet.
- async get_key_for_did(did: str) str [source]
Fetch the verkey for a ledger DID.
- Parameters
did – The DID to look up on the ledger or in the cache
- async get_nym_role(did: str) aries_cloudagent.ledger.base.Role [source]
Return the role of the input public DID’s NYM on the ledger.
- Parameters
did – DID to query for role on the ledger.
- async get_revoc_reg_def(revoc_reg_id: str) dict [source]
Get revocation registry definition by ID; augment with ledger timestamp.
- async get_revoc_reg_delta(revoc_reg_id: str, fro=0, to=None) Tuple[dict, int] [source]
Look up a revocation registry delta by ID.
:param revoc_reg_id revocation registry id :param fro earliest EPOCH time of interest :param to latest EPOCH time of interest
:returns delta response, delta timestamp
- async get_revoc_reg_entry(revoc_reg_id: str, timestamp: int)[source]
Get revocation registry entry by revocation registry ID and timestamp.
- async get_schema(schema_id: str) dict [source]
Get a schema from the cache if available, otherwise fetch from the ledger.
- Parameters
schema_id – The schema id (or stringified sequence number) to retrieve
- async get_txn_author_agreement(reload: bool = False) dict [source]
Get the current transaction author agreement, fetching it if necessary.
- async get_wallet_public_did() aries_cloudagent.wallet.did_info.DIDInfo [source]
Fetch the public DID from the wallet.
- property pool_handle
Accessor for the ledger pool handle.
- async register_nym(did: str, verkey: str, alias: Optional[str] = None, role: Optional[str] = None, write_ledger: bool = True, endorser_did: Optional[str] = None) Tuple[bool, dict] [source]
Register a nym on the ledger.
- Parameters
did – DID to register on the ledger.
verkey – The verification key of the keypair.
alias – Human-friendly alias to assign to the DID.
role – For permissioned ledgers, what role should the new DID have.
- async rotate_public_did_keypair(next_seed: Optional[str] = None) None [source]
Rotate keypair for public DID: create new key, submit to ledger, update wallet.
- Parameters
next_seed – seed for incoming ed25519 keypair (default random)
- async send_revoc_reg_def(revoc_reg_def: dict, issuer_did: Optional[str] = None, write_ledger: bool = True, endorser_did: Optional[str] = None)[source]
Publish a revocation registry definition to the ledger.
- async send_revoc_reg_entry(revoc_reg_id: str, revoc_def_type: str, revoc_reg_entry: dict, issuer_did: Optional[str] = None, write_ledger: bool = True, endorser_did: Optional[str] = None)[source]
Publish a revocation registry entry to the ledger.
- async submit_get_nym_request(request_json: str) str [source]
Submit GET_NYM request to ledger and return response_json.
- taa_rough_timestamp() int [source]
Get a timestamp accurate to the day.
Anything more accurate is a privacy concern.
- async txn_endorse(request_json: str, endorse_did: Optional[aries_cloudagent.wallet.did_info.DIDInfo] = None) str [source]
Endorse a (signed) ledger transaction.
- async txn_submit(request_json: str, sign: Optional[bool] = None, taa_accept: Optional[bool] = None, sign_did: aries_cloudagent.wallet.did_info.DIDInfo = <object object>) str [source]
Submit a signed (and endorsed) transaction to the ledger.
- async update_endpoint_for_did(did: str, endpoint: str, endpoint_type: Optional[aries_cloudagent.ledger.endpoint_type.EndpointType] = None, write_ledger: bool = True, endorser_did: Optional[str] = None) bool [source]
Check and update the endpoint on the ledger.
- Parameters
did – The ledger DID
endpoint – The endpoint address
endpoint_type – The type of the endpoint
- class aries_cloudagent.ledger.indy.IndySdkLedgerPool(name: str, *, checked: bool = False, keepalive: int = 0, cache: Optional[aries_cloudagent.cache.base.BaseCache] = None, cache_duration: int = 600, genesis_transactions: Optional[str] = None, read_only: bool = False, socks_proxy: Optional[str] = None)[source]
Bases:
object
Indy ledger manager class.
- async context_open()[source]
Open the ledger if necessary and increase the number of active references.
- class aries_cloudagent.ledger.indy.IndySdkLedgerPoolProvider[source]
Bases:
aries_cloudagent.config.base.BaseProvider
Indy ledger pool provider which keys off the selected pool name.
- provide(settings: aries_cloudagent.config.base.BaseSettings, injector: aries_cloudagent.config.base.BaseInjector)[source]
Create and open the pool instance.
aries_cloudagent.ledger.indy_vdr module
Indy-VDR ledger implementation.
- class aries_cloudagent.ledger.indy_vdr.IndyVdrLedger(pool: aries_cloudagent.ledger.indy_vdr.IndyVdrLedgerPool, profile: aries_cloudagent.core.profile.Profile)[source]
Bases:
aries_cloudagent.ledger.base.BaseLedger
Indy-VDR ledger class.
- async accept_txn_author_agreement(taa_record: dict, mechanism: str, accept_time: Optional[int] = None)[source]
Save a new record recording the acceptance of the TAA.
- async build_and_return_get_nym_request(submitter_did: Optional[str], target_did: str) str [source]
Build GET_NYM request and return request_json.
- async check_existing_schema(public_did: str, schema_name: str, schema_version: str, attribute_names: Sequence[str]) Tuple[str, dict] [source]
Check if a schema has already been published.
- async create_and_send_credential_definition(issuer: aries_cloudagent.indy.issuer.IndyIssuer, schema_id: str, signature_type: Optional[str] = None, tag: Optional[str] = None, support_revocation: bool = False, write_ledger: bool = True, endorser_did: Optional[str] = None) Tuple[str, dict, bool] [source]
Send credential definition to ledger and store relevant key matter in wallet.
- Parameters
issuer – The issuer instance to use for credential definition creation
schema_id – The schema id of the schema to create cred def for
signature_type – The signature type to use on the credential definition
tag – Optional tag to distinguish multiple credential definitions
support_revocation – Optional flag to enable revocation for this cred def
- Returns
Tuple with cred def id, cred def structure, and whether it’s novel
- async create_and_send_schema(issuer: aries_cloudagent.indy.issuer.IndyIssuer, schema_name: str, schema_version: str, attribute_names: Sequence[str], write_ledger: bool = True, endorser_did: Optional[str] = None) Tuple[str, dict] [source]
Send schema to ledger.
- Parameters
issuer – The issuer instance creating the schema
schema_name – The schema name
schema_version – The schema version
attribute_names – A list of schema attributes
- async credential_definition_id2schema_id(credential_definition_id)[source]
From a credential definition, get the identifier for its schema.
- Parameters
credential_definition_id – The identifier of the credential definition from which to identify a schema
- async fetch_credential_definition(credential_definition_id: str) dict [source]
Get a credential definition from the ledger by id.
- Parameters
credential_definition_id – The cred def id of the cred def to fetch
- async fetch_schema_by_id(schema_id: str) dict [source]
Get schema from ledger.
- Parameters
schema_id – The schema id (or stringified sequence number) to retrieve
- Returns
Indy schema dict
- async fetch_schema_by_seq_no(seq_no: int)[source]
Fetch a schema by its sequence number.
- Parameters
seq_no – schema ledger sequence number
- Returns
Indy schema dict
- async get_all_endpoints_for_did(did: str) dict [source]
Fetch all endpoints for a ledger DID.
- Parameters
did – The DID to look up on the ledger or in the cache
- async get_credential_definition(credential_definition_id: str) dict [source]
Get a credential definition from the cache if available, otherwise the ledger.
- Parameters
credential_definition_id – The schema id of the schema to fetch cred def for
- async get_endpoint_for_did(did: str, endpoint_type: Optional[aries_cloudagent.ledger.endpoint_type.EndpointType] = None) str [source]
Fetch the endpoint for a ledger DID.
- Parameters
did – The DID to look up on the ledger or in the cache
endpoint_type – The type of the endpoint. If none given, returns all
- async get_key_for_did(did: str) str [source]
Fetch the verkey for a ledger DID.
- Parameters
did – The DID to look up on the ledger or in the cache
- async get_nym_role(did: str) aries_cloudagent.ledger.base.Role [source]
Return the role of the input public DID’s NYM on the ledger.
- Parameters
did – DID to query for role on the ledger.
- async get_revoc_reg_delta(revoc_reg_id: str, timestamp_from=0, timestamp_to=None) Tuple[dict, int] [source]
Look up a revocation registry delta by ID.
:param revoc_reg_id revocation registry id :param timestamp_from from time. a total number of seconds from Unix Epoch :param timestamp_to to time. a total number of seconds from Unix Epoch
:returns delta response, delta timestamp
- async get_revoc_reg_entry(revoc_reg_id: str, timestamp: int) Tuple[dict, int] [source]
Get revocation registry entry by revocation registry ID and timestamp.
- async get_schema(schema_id: str) dict [source]
Get a schema from the cache if available, otherwise fetch from the ledger.
- Parameters
schema_id – The schema id (or stringified sequence number) to retrieve
- async get_txn_author_agreement(reload: bool = False) dict [source]
Get the current transaction author agreement, fetching it if necessary.
- async get_wallet_public_did() aries_cloudagent.wallet.did_info.DIDInfo [source]
Fetch the public DID from the wallet.
- property pool_handle
Accessor for the ledger pool handle.
- async register_nym(did: str, verkey: str, alias: Optional[str] = None, role: Optional[str] = None, write_ledger: bool = True, endorser_did: Optional[str] = None) Tuple[bool, dict] [source]
Register a nym on the ledger.
- Parameters
did – DID to register on the ledger.
verkey – The verification key of the keypair.
alias – Human-friendly alias to assign to the DID.
role – For permissioned ledgers, what role should the new DID have.
- async rotate_public_did_keypair(next_seed: Optional[str] = None) None [source]
Rotate keypair for public DID: create new key, submit to ledger, update wallet.
- Parameters
next_seed – seed for incoming ed25519 keypair (default random)
- async send_revoc_reg_def(revoc_reg_def: dict, issuer_did: Optional[str] = None, write_ledger: bool = True, endorser_did: Optional[str] = None)[source]
Publish a revocation registry definition to the ledger.
- async send_revoc_reg_entry(revoc_reg_id: str, revoc_def_type: str, revoc_reg_entry: dict, issuer_did: Optional[str] = None, write_ledger: bool = True, endorser_did: Optional[str] = None)[source]
Publish a revocation registry entry to the ledger.
- async submit_get_nym_request(request_json: str) str [source]
Submit GET_NYM request to ledger and return response_json.
- taa_rough_timestamp() int [source]
Get a timestamp accurate to the day.
Anything more accurate is a privacy concern.
- async txn_endorse(request_json: str, endorse_did: Optional[aries_cloudagent.wallet.did_info.DIDInfo] = None) str [source]
Endorse (sign) the provided transaction.
- async txn_submit(request_json: str, sign: bool, taa_accept: bool, sign_did: aries_cloudagent.wallet.did_info.DIDInfo = <object object>) str [source]
Write the provided (signed and possibly endorsed) transaction to the ledger.
- async update_endpoint_for_did(did: str, endpoint: str, endpoint_type: Optional[aries_cloudagent.ledger.endpoint_type.EndpointType] = None, write_ledger: bool = True, endorser_did: Optional[str] = None) bool [source]
Check and update the endpoint on the ledger.
- Parameters
did – The ledger DID
endpoint – The endpoint address
endpoint_type – The type of the endpoint
- class aries_cloudagent.ledger.indy_vdr.IndyVdrLedgerPool(name: str, *, keepalive: int = 0, cache: Optional[aries_cloudagent.cache.base.BaseCache] = None, cache_duration: int = 600, genesis_transactions: Optional[str] = None, read_only: bool = False, socks_proxy: Optional[str] = None)[source]
Bases:
object
Indy-VDR ledger pool manager.
- property cfg_path: pathlib.Path
Get the path to the configuration file, ensuring it’s created.
- async context_open()[source]
Open the ledger if necessary and increase the number of active references.
aries_cloudagent.ledger.routes module
aries_cloudagent.ledger.util module
Ledger utilities.
- async aries_cloudagent.ledger.util.notify_register_did_event(profile: aries_cloudagent.core.profile.Profile, did: str, meta_data: dict)[source]
Send notification for a DID post-process event.
aries_cloudagent.messaging package
Subpackages
Contains the functions needed to produce and verify a json-ld signature.
This file was ported from https://github.com/transmute-industries/Ed25519Signature2018/blob/master/src/createVerifyData/index.js
JSON-LD messaging Exceptions.
- exception aries_cloudagent.messaging.jsonld.error.BadJWSHeaderError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.messaging.jsonld.error.BaseJSONLDMessagingError
Exception indicating invalid JWS header.
- exception aries_cloudagent.messaging.jsonld.error.BaseJSONLDMessagingError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.core.error.BaseError
Base exception class for JSON-LD messaging.
- exception aries_cloudagent.messaging.jsonld.error.DroppedAttributeError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.messaging.jsonld.error.BaseJSONLDMessagingError
Exception used to track that an attribute was removed.
- exception aries_cloudagent.messaging.jsonld.error.InvalidVerificationMethod(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.messaging.jsonld.error.BaseJSONLDMessagingError
Exception indicating an invalid verification method in doc to verify.
- exception aries_cloudagent.messaging.jsonld.error.MissingVerificationMethodError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.messaging.jsonld.error.BaseJSONLDMessagingError
Exception indicating missing verification method from signature options.
- exception aries_cloudagent.messaging.jsonld.error.SignatureTypeError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.messaging.jsonld.error.BaseJSONLDMessagingError
Exception indicating Signature type error.
Common code for messaging models.
Submodules
aries_cloudagent.messaging.agent_message module
aries_cloudagent.messaging.base_handler module
aries_cloudagent.messaging.base_message module
Base message.
- class aries_cloudagent.messaging.base_message.BaseMessage[source]
Bases:
abc.ABC
Abstract base class for messages.
This formally defines a “minimum viable message” and provides an unopinionated class for plugins to extend in whatever way makes sense in the context of the plugin.
- abstract property Handler: Type[BaseHandler]
Return reference to handler class.
- abstract classmethod deserialize(value: dict, msg_format: aries_cloudagent.messaging.base_message.DIDCommVersion = DIDCommVersion.v1)[source]
Return message object deserialized from value in format specified.
- abstract serialize(msg_format: aries_cloudagent.messaging.base_message.DIDCommVersion = DIDCommVersion.v1) dict [source]
Return serialized message in format specified.
aries_cloudagent.messaging.error module
Messaging-related error classes and codes.
- exception aries_cloudagent.messaging.error.MessageParseError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.core.error.BaseError
Message parse error.
- error_code = 'message_parse_error'
- exception aries_cloudagent.messaging.error.MessagePrepareError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.core.error.BaseError
Message preparation error.
- error_code = 'message_prepare_error'
aries_cloudagent.messaging.request_context module
aries_cloudagent.messaging.responder module
aries_cloudagent.messaging.util module
Utils for messages.
- aries_cloudagent.messaging.util.canon(raw_attr_name: str) str [source]
Canonicalize input attribute name for indy proofs and credential offers.
- Parameters
raw_attr_name – raw attribute name
- Returns
canonicalized attribute name
- aries_cloudagent.messaging.util.datetime_now() datetime.datetime [source]
Timestamp in UTC.
- aries_cloudagent.messaging.util.datetime_to_str(dt: Union[str, datetime.datetime]) str [source]
Convert a datetime object to an indy-standard datetime string.
- Parameters
dt – May be a string or datetime to allow automatic conversion
- aries_cloudagent.messaging.util.encode(orig: Any) str [source]
Encode a credential value as an int.
Encode credential attribute value, purely stringifying any int32 and leaving numeric int32 strings alone, but mapping any other input to a stringified 256-bit (but not 32-bit) integer. Predicates in indy-sdk operate on int32 values properly only when their encoded values match their raw values.
- Parameters
orig – original value to encode
- Returns
encoded value
- aries_cloudagent.messaging.util.epoch_to_str(epoch: int) str [source]
Convert epoch seconds to indy-standard datetime string.
- Parameters
epoch – epoch seconds
- aries_cloudagent.messaging.util.str_to_datetime(dt: Union[str, datetime.datetime]) datetime.datetime [source]
Convert an indy-standard datetime string to a datetime.
Using a fairly lax regex pattern to match slightly different formats. In Python 3.7 datetime.fromisoformat might be used.
- Parameters
dt – May be a string or datetime to allow automatic conversion
- aries_cloudagent.messaging.util.str_to_epoch(dt: Union[str, datetime.datetime]) int [source]
Convert an indy-standard datetime string to epoch seconds.
- Parameters
dt – May be a string or datetime to allow automatic conversion
aries_cloudagent.messaging.valid module
aries_cloudagent.multitenant package
Subpackages
Submodules
aries_cloudagent.multitenant.askar_profile_manager module
aries_cloudagent.multitenant.base module
aries_cloudagent.multitenant.cache module
Cache for multitenancy profiles.
- class aries_cloudagent.multitenant.cache.ProfileCache(capacity: int)[source]
Bases:
object
Profile cache that caches based on LRU strategy.
- get(key: str) Optional[aries_cloudagent.core.profile.Profile] [source]
Get profile with associated key from cache.
If a profile is open but has been evicted from the cache, this will reinsert the profile back into the cache. This prevents attempting to open a profile that is already open. Triggers clean up.
- Parameters
key (str) – the key to get the profile for.
- Returns
Profile if found in cache.
- Return type
Optional[Profile]
- put(key: str, value: aries_cloudagent.core.profile.Profile) None [source]
Add profile with associated key to the cache.
If new profile exceeds the cache capacity least recently used profiles that are not used will be removed from the cache.
- Parameters
key (str) – the key to set
value (Profile) – the profile to set
aries_cloudagent.multitenant.error module
Multitenant error classes.
- exception aries_cloudagent.multitenant.error.WalletKeyMissingError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.core.error.BaseError
Wallet key missing exception.
aries_cloudagent.multitenant.manager module
aries_cloudagent.multitenant.manager_provider module
Profile manager for multitenancy.
- class aries_cloudagent.multitenant.manager_provider.MultitenantManagerProvider(root_profile)[source]
Bases:
aries_cloudagent.config.base.BaseProvider
Multitenant manager provider.
Decides which manager to use based on the settings.
- MANAGER_TYPES = {'askar-profile': 'aries_cloudagent.multitenant.askar_profile_manager.AskarProfileMultitenantManager', 'basic': 'aries_cloudagent.multitenant.manager.MultitenantManager'}
- askar_profile_manager_path = 'aries_cloudagent.multitenant.askar_profile_manager.AskarProfileMultitenantManager'
- provide(settings: aries_cloudagent.config.base.BaseSettings, injector: aries_cloudagent.config.base.BaseInjector)[source]
Create the multitenant manager instance.
aries_cloudagent.protocols package
Subpackages
Message type identifiers for Connections.
Version definitions for this protocol.
Message type identifiers for Connections.
Version definitions for this protocol.
Protocol controller for coordinate mediation.
Message type identifiers for Coordinate Mediation protocol.
Version definitions for this protocol.
Storage management for configuration-provided mediation invite.
Handle storage and retrieval of mediation invites provided through arguments. Enables having the mediation invite config be the same for provision and starting commands.
- class aries_cloudagent.protocols.coordinate_mediation.mediation_invite_store.MediationInviteRecord(invite: str, used: bool)[source]
Bases:
tuple
A record to store mediation invites and their freshness.
- static from_json(json_invite_record: str) aries_cloudagent.protocols.coordinate_mediation.mediation_invite_store.MediationInviteRecord [source]
- Returns
a mediation invite record deserialized from a json string.
- property invite
Alias for field number 0
- static unused(invite: str) aries_cloudagent.protocols.coordinate_mediation.mediation_invite_store.MediationInviteRecord [source]
- Parameters
invite – invite string as provided by the mediator.
- Returns
An unused mediation invitation for the given invite string
- property used
Alias for field number 1
- class aries_cloudagent.protocols.coordinate_mediation.mediation_invite_store.MediationInviteStore(storage: aries_cloudagent.storage.base.BaseStorage)[source]
Bases:
object
Store and retrieve mediation invite configuration.
- INVITE_RECORD_CATEGORY = 'config'
- MEDIATION_INVITE_ID = 'mediation_invite'
- async get_mediation_invite_record(provided_mediation_invitation: Optional[str]) Optional[aries_cloudagent.protocols.coordinate_mediation.mediation_invite_store.MediationInviteRecord] [source]
Provide the MediationInviteRecord to use/that was used for mediation.
Returned record may have been used already.
Stored record is updated if provided_mediation_invitation has changed. Updated record is marked as unused.
- Parameters
provided_mediation_invitation – mediation invite provided by user
- Returns
mediation invite to use/that was used to connect to the mediator. None if no invitation was provided/provisioned.
- async mark_default_invite_as_used()[source]
Mark the currently stored invitation as used if one exists.
- Raises
NoDefaultMediationInviteException – if trying to mark invite as used when there is no invite stored.
- async store(mediation_invite: aries_cloudagent.protocols.coordinate_mediation.mediation_invite_store.MediationInviteRecord) aries_cloudagent.protocols.coordinate_mediation.mediation_invite_store.MediationInviteRecord [source]
Store the mediator’s invite for further use when starting the agent.
Update the currently stored invite if one already exists. This assumes a new invite and as such, marks it as unused.
- Parameters
mediation_invite – mediation invite url
- Returns
stored mediation invite
DID Exchange problem report reasons.
- class aries_cloudagent.protocols.didexchange.v1_0.messages.problem_report_reason.ProblemReportReason(value)[source]
Bases:
enum.Enum
Supported reason codes.
- COMPLETE_NOT_ACCEPTED = 'complete_not_accepted'
- INVITATION_NOT_ACCEPTED = 'invitation_not_accepted'
- REQUEST_NOT_ACCEPTED = 'request_not_accepted'
- REQUEST_PROCESSING_ERROR = 'request_processing_error'
- RESPONSE_NOT_ACCEPTED = 'response_not_accepted'
- RESPONSE_PROCESSING_ERROR = 'response_processing_error'
Message type identifiers for Connections.
Version definitions for this protocol.
Package-wide code and data.
Message type identifiers for Feature Discovery.
Package-wide code and data.
Message type identifiers for Feature Discovery.
Version definitions for this protocol.
Protocol controller for endorse transaction.
Message type identifiers for Transactions.
Class to manage jobs in Connection Record.
Version definitions for this protocol.
Message type identifiers for Introductions.
Version definitions for this protocol.
Version definitions for this protocol.
Version definitions for this protocol.
Protocol controller for out-of-band.
Version definitions for this protocol.
Version definitions for this protocol.
Version definitions for this protocol.
Message type identifiers for Revocation Notification protocol.
Message type identifiers for Revocation Notification protocol.
Version definitions for this protocol.
Message type identifiers for Routing.
Version definitions for this protocol.
Message type identifiers for Trust Pings.
Version definitions for this protocol.
Submodules
aries_cloudagent.protocols.didcomm_prefix module
DIDComm prefix management.
- class aries_cloudagent.protocols.didcomm_prefix.DIDCommPrefix(value)[source]
Bases:
enum.Enum
Enum for DIDComm Prefix, old or new style, per Aries RFC 384.
- NEW = 'https://didcomm.org'
- OLD = 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec'
- qualify(msg_type: Optional[str] = None) str [source]
Qualify input message type with prefix and separator.
- classmethod qualify_all(messages: dict) dict [source]
Apply all known prefixes to a dictionary of message types.
aries_cloudagent.resolver package
Interfaces and base classes for DID Resolution.
- async aries_cloudagent.resolver.setup(context: aries_cloudagent.config.injection_context.InjectionContext)[source]
Set up default resolvers.
Subpackages
Resolvers included in ACA-Py by Default.
HTTP Universal DID Resolver.
- class aries_cloudagent.resolver.default.universal.UniversalResolver(*, endpoint: Optional[str] = None, supported_did_regex: Optional[Pattern] = None)[source]
Bases:
aries_cloudagent.resolver.base.BaseDIDResolver
Universal DID Resolver with HTTP bindings.
- async setup(context: aries_cloudagent.config.injection_context.InjectionContext)[source]
Preform setup, populate supported method list, configuration.
- property supported_did_regex: Pattern
Return supported methods regex.
Submodules
aries_cloudagent.resolver.base module
Base Class for DID Resolvers.
- class aries_cloudagent.resolver.base.BaseDIDResolver(type_: Optional[aries_cloudagent.resolver.base.ResolverType] = None)[source]
Bases:
abc.ABC
Base Class for DID Resolvers.
- property native
Return if this resolver is native.
- async resolve(profile: aries_cloudagent.core.profile.Profile, did: Union[str, pydid.DID], service_accept: Optional[Sequence[str]] = None) dict [source]
Resolve a DID using this resolver.
- abstract async setup(context: aries_cloudagent.config.injection_context.InjectionContext)[source]
Do asynchronous resolver setup.
- property supported_did_regex: Pattern
Supported DID regex for matching this resolver to DIDs it can resolve.
Override this property with a class var or similar to use regex matching on DIDs to determine if this resolver supports a given DID.
- property supported_methods: Sequence[str]
Return supported methods.
DEPRECATED: Use supported_did_regex instead.
- async supports(profile: aries_cloudagent.core.profile.Profile, did: str) bool [source]
Return if this resolver supports the given DID.
Override this method to determine if this resolver supports a DID based on information other than just a regular expression; i.e. check a value in storage, query a resolver connection record, etc.
- exception aries_cloudagent.resolver.base.DIDMethodNotSupported(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.resolver.base.ResolverError
Raised when no resolver is registered for a given did method.
- exception aries_cloudagent.resolver.base.DIDNotFound(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.resolver.base.ResolverError
Raised when DID is not found in verifiable data registry.
- class aries_cloudagent.resolver.base.ResolutionMetadata(resolver_type: aries_cloudagent.resolver.base.ResolverType, resolver: str, retrieved_time: str, duration: int)[source]
Bases:
tuple
Resolution Metadata.
- property duration
Alias for field number 3
- property resolver
Alias for field number 1
- property resolver_type
Alias for field number 0
- property retrieved_time
Alias for field number 2
- class aries_cloudagent.resolver.base.ResolutionResult(did_document: dict, metadata: aries_cloudagent.resolver.base.ResolutionMetadata)[source]
Bases:
object
Resolution Class to pack the DID Doc and the resolution information.
- exception aries_cloudagent.resolver.base.ResolverError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.core.error.BaseError
Base class for resolver exceptions.
aries_cloudagent.resolver.did_resolver module
the did resolver.
responsible for keeping track of all resolvers. more importantly retrieving did’s from different sources provided by the method type.
- class aries_cloudagent.resolver.did_resolver.DIDResolver(resolvers: Optional[List[aries_cloudagent.resolver.base.BaseDIDResolver]] = None)[source]
Bases:
object
did resolver singleton.
- async dereference(profile: aries_cloudagent.core.profile.Profile, did_url: str, *, cls: Type[aries_cloudagent.resolver.did_resolver.ResourceType] = pydid.Resource) aries_cloudagent.resolver.did_resolver.ResourceType [source]
Dereference a DID URL to its corresponding DID Doc object.
- register_resolver(resolver: aries_cloudagent.resolver.base.BaseDIDResolver)[source]
Register a new resolver.
- async resolve(profile: aries_cloudagent.core.profile.Profile, did: Union[str, pydid.DID], service_accept: Optional[Sequence[str]] = None) dict [source]
Resolve a DID.
- async resolve_with_metadata(profile: aries_cloudagent.core.profile.Profile, did: Union[str, pydid.DID]) aries_cloudagent.resolver.base.ResolutionResult [source]
Resolve a DID and return the ResolutionResult.
aries_cloudagent.resolver.routes module
aries_cloudagent.revocation package
Subpackages
Classes for managing a revocation registry.
- class aries_cloudagent.revocation.models.revocation_registry.RevocationRegistry(registry_id: Optional[str] = None, *, cred_def_id: Optional[str] = None, issuer_did: Optional[str] = None, max_creds: Optional[int] = None, reg_def_type: Optional[str] = None, tag: Optional[str] = None, tails_local_path: Optional[str] = None, tails_public_uri: Optional[str] = None, tails_hash: Optional[str] = None, reg_def: Optional[dict] = None)[source]
Bases:
object
Manage a revocation registry and tails file.
- MAX_SIZE = 32768
- MIN_SIZE = 4
- classmethod from_definition(revoc_reg_def: dict, public_def: bool) aries_cloudagent.revocation.models.revocation_registry.RevocationRegistry [source]
Initialize a revocation registry instance from a definition.
- async get_or_fetch_local_tails_path()[source]
Get the local tails path, retrieving from the remote if necessary.
Submodules
aries_cloudagent.revocation.error module
Revocation error classes.
- exception aries_cloudagent.revocation.error.RevocationError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.core.error.BaseError
Base exception for revocation-related errors.
- exception aries_cloudagent.revocation.error.RevocationNotSupportedError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.revocation.error.RevocationError
Attempted to perform revocation-related operation where inapplicable.
- exception aries_cloudagent.revocation.error.RevocationRegistryBadSizeError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.revocation.error.RevocationError
Attempted to create registry with maximum credentials too large or too small.
aries_cloudagent.revocation.indy module
aries_cloudagent.revocation.manager module
aries_cloudagent.revocation.recover module
Recover a revocation registry.
- aries_cloudagent.revocation.recover.LOGGER = <Logger aries_cloudagent.revocation.recover (WARNING)>
This module calculates a new ledger accumulator, based on the revocation status on the ledger vs revocations recorded in the wallet. The calculated transaction can be written to the ledger to get the ledger back in sync with the wallet. This function can be used if there were previous revocation errors (i.e. the credential revocation was successfully written to the wallet but the ledger write failed.)
- exception aries_cloudagent.revocation.recover.RevocRecoveryException[source]
Bases:
Exception
Raise exception generating the recovery transaction.
aries_cloudagent.revocation.routes module
aries_cloudagent.revocation.util module
aries_cloudagent.storage package
Subpackages
Submodules
aries_cloudagent.storage.askar module
aries_cloudagent.storage.base module
Abstract base classes for non-secrets storage.
- class aries_cloudagent.storage.base.BaseStorage[source]
Bases:
abc.ABC
Abstract stored records interface.
- abstract async add_record(record: aries_cloudagent.storage.record.StorageRecord)[source]
Add a new record to the store.
- Parameters
record – StorageRecord to be stored
- abstract async delete_all_records(type_filter: str, tag_query: Optional[Mapping] = None)[source]
Remove all records matching a particular type filter and tag query.
- abstract async delete_record(record: aries_cloudagent.storage.record.StorageRecord)[source]
Delete an existing record.
- Parameters
record – StorageRecord to delete
- abstract async find_all_records(type_filter: str, tag_query: Optional[Mapping] = None, options: Optional[Mapping] = None)[source]
Retrieve all records matching a particular type filter and tag query.
- async find_record(type_filter: str, tag_query: Optional[Mapping] = None, options: Optional[Mapping] = None) aries_cloudagent.storage.record.StorageRecord [source]
Find a record using a unique tag filter.
- Parameters
type_filter – Filter string
tag_query – Tags to query
options – Dictionary of backend-specific options
- abstract async get_record(record_type: str, record_id: str, options: Optional[Mapping] = None) aries_cloudagent.storage.record.StorageRecord [source]
Fetch a record from the store by type and ID.
- Parameters
record_type – The record type
record_id – The record id
options – A dictionary of backend-specific options
- Returns
A StorageRecord instance
- abstract async update_record(record: aries_cloudagent.storage.record.StorageRecord, value: str, tags: Mapping)[source]
Update an existing stored record’s value and tags.
- Parameters
record – StorageRecord to update
value – The new value
tags – The new tags
- class aries_cloudagent.storage.base.BaseStorageSearch[source]
Bases:
abc.ABC
Abstract stored records search interface.
- abstract search_records(type_filter: str, tag_query: Optional[Mapping] = None, page_size: Optional[int] = None, options: Optional[Mapping] = None) aries_cloudagent.storage.base.BaseStorageSearchSession [source]
Create a new record query.
- Parameters
type_filter – Filter string
tag_query – Tags to query
page_size – Page size
options – Dictionary of backend-specific options
- Returns
An instance of BaseStorageSearchSession
- class aries_cloudagent.storage.base.BaseStorageSearchSession[source]
Bases:
abc.ABC
Abstract stored records search session interface.
- abstract async fetch(max_count: Optional[int] = None) Sequence[aries_cloudagent.storage.record.StorageRecord] [source]
Fetch the next list of results from the store.
- Parameters
max_count – Max number of records to return. If not provided, defaults to the backend’s preferred page size
- Returns
A list of StorageRecord instances
- class aries_cloudagent.storage.base.IterSearch(search: aries_cloudagent.storage.base.BaseStorageSearchSession, page_size: Optional[int] = None)[source]
Bases:
object
A generic record search async iterator.
- aries_cloudagent.storage.base.validate_record(record: aries_cloudagent.storage.record.StorageRecord, *, delete=False)[source]
Ensure that a record is ready to be saved/updated/deleted.
aries_cloudagent.storage.error module
Storage-related exceptions.
- exception aries_cloudagent.storage.error.StorageDuplicateError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.storage.error.StorageError
Duplicate record found in storage.
- exception aries_cloudagent.storage.error.StorageError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.core.error.BaseError
Base class for Storage errors.
- exception aries_cloudagent.storage.error.StorageNotFoundError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.storage.error.StorageError
Record not found in storage.
- exception aries_cloudagent.storage.error.StorageSearchError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.storage.error.StorageError
General exception during record search.
aries_cloudagent.storage.in_memory module
aries_cloudagent.storage.indy module
Indy implementation of BaseStorage interface.
- class aries_cloudagent.storage.indy.IndySdkStorage(wallet: aries_cloudagent.indy.sdk.wallet_setup.IndyOpenWallet)[source]
Bases:
aries_cloudagent.storage.base.BaseStorage
,aries_cloudagent.storage.base.BaseStorageSearch
Indy Non-Secrets interface.
- async add_record(record: aries_cloudagent.storage.record.StorageRecord)[source]
Add a new record to the store.
- Parameters
record – StorageRecord to be stored
- async delete_all_records(type_filter: str, tag_query: Optional[Mapping] = None)[source]
Remove all records matching a particular type filter and tag query.
- async delete_record(record: aries_cloudagent.storage.record.StorageRecord)[source]
Delete a record.
- Parameters
record – StorageRecord to delete
- Raises
StorageNotFoundError – If record not found
StorageError – If a libindy error occurs
- async find_all_records(type_filter: str, tag_query: Optional[Mapping] = None, options: Optional[Mapping] = None)[source]
Retrieve all records matching a particular type filter and tag query.
- async get_record(record_type: str, record_id: str, options: Optional[Mapping] = None) aries_cloudagent.storage.record.StorageRecord [source]
Fetch a record from the store by type and ID.
- Parameters
record_type – The record type
record_id – The record id
options – A dictionary of backend-specific options
- Returns
A StorageRecord instance
- Raises
StorageError – If the record is not provided
StorageError – If the record ID not provided
StorageNotFoundError – If the record is not found
StorageError – If record not found
- search_records(type_filter: str, tag_query: Optional[Mapping] = None, page_size: Optional[int] = None, options: Optional[Mapping] = None) aries_cloudagent.storage.indy.IndySdkStorageSearch [source]
Search stored records.
- Parameters
type_filter – Filter string
tag_query – Tags to query
page_size – Page size
options – Dictionary of backend-specific options
- Returns
An instance of IndySdkStorageSearch
- async update_record(record: aries_cloudagent.storage.record.StorageRecord, value: str, tags: Mapping)[source]
Update an existing stored record’s value and tags.
- Parameters
record – StorageRecord to update
value – The new value
tags – The new tags
- Raises
StorageNotFoundError – If record not found
StorageError – If a libindy error occurs
- property wallet: aries_cloudagent.indy.sdk.wallet_setup.IndyOpenWallet
Accessor for IndyOpenWallet instance.
- class aries_cloudagent.storage.indy.IndySdkStorageSearch(store: aries_cloudagent.storage.indy.IndySdkStorage, type_filter: str, tag_query: Mapping, page_size: Optional[int] = None, options: Optional[Mapping] = None)[source]
Bases:
aries_cloudagent.storage.base.BaseStorageSearchSession
Represent an active stored records search.
- async fetch(max_count: Optional[int] = None) Sequence[aries_cloudagent.storage.record.StorageRecord] [source]
Fetch the next list of results from the store.
- Parameters
max_count – Max number of records to return. If not provided, defaults to the backend’s preferred page size
- Returns
A list of StorageRecord instances
- Raises
StorageSearchError – If the search query has not been opened
aries_cloudagent.storage.record module
Record instance stored and searchable by BaseStorage implementation.
- class aries_cloudagent.storage.record.StorageRecord(type, value, tags: Optional[dict] = None, id: Optional[str] = None)[source]
Bases:
aries_cloudagent.storage.record.StorageRecord
Storage record class.
aries_cloudagent.tails package
Submodules
aries_cloudagent.tails.base module
Tails server interface base class.
- class aries_cloudagent.tails.base.BaseTailsServer[source]
Bases:
abc.ABC
Base class for tails server interface.
- abstract async upload_tails_file(context: aries_cloudagent.config.injection_context.InjectionContext, rev_reg_id: str, tails_file_path: str, interval: float = 1.0, backoff: float = 0.25, max_attempts: int = 5) Tuple[bool, str] [source]
Upload tails file to tails server.
- Parameters
rev_reg_id – The revocation registry identifier
tails_file – The path to the tails file to upload
interval – initial interval between attempts
backoff – exponential backoff in retry interval
max_attempts – maximum number of attempts to make
aries_cloudagent.tails.error module
Tails server related errors.
- exception aries_cloudagent.tails.error.TailsServerNotConfiguredError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.core.error.BaseError
Error indicating the tails server plugin hasn’t been configured.
aries_cloudagent.tails.indy_tails_server module
aries_cloudagent.transport package
Subpackages
Classes representing inbound messages.
- class aries_cloudagent.transport.inbound.message.InboundMessage(payload: Union[str, bytes], receipt: aries_cloudagent.transport.inbound.receipt.MessageReceipt, *, connection_id: Optional[str] = None, session_id: Optional[str] = None, transport_type: Optional[str] = None)[source]
Bases:
object
Container class linking a message payload with its receipt details.
Classes for representing message receipt details.
- class aries_cloudagent.transport.inbound.receipt.MessageReceipt(*, connection_id: Optional[str] = None, direct_response_mode: Optional[str] = None, in_time: Optional[datetime.datetime] = None, raw_message: Optional[str] = None, recipient_verkey: Optional[str] = None, recipient_did: Optional[str] = None, recipient_did_public: Optional[bool] = None, sender_did: Optional[str] = None, sender_verkey: Optional[str] = None, thread_id: Optional[str] = None, parent_thread_id: Optional[str] = None)[source]
Bases:
object
Properties of an agent message’s delivery.
- REPLY_MODE_ALL = 'all'
- REPLY_MODE_NONE = 'none'
- REPLY_MODE_THREAD = 'thread'
- property connection_id: str
Accessor for the pairwise connection identifier.
- Returns
This context’s connection identifier
- property direct_response_mode: str
Accessor for the requested direct response mode.
- Returns
This context’s requested direct response mode
- property direct_response_requested: str
Accessor for the the state of the direct response mode.
- Returns
This context’s requested direct response mode
- property in_time: str
Accessor for the datetime the message was received.
- Returns
This context’s received time
- property parent_thread_id: Optional[str]
Accessor for the identifier of the message parent thread.
- Returns
The delivery parent thread ID
- property recipient_did: str
Accessor for the recipient DID which corresponds with the verkey.
- Returns
The recipient DID
- property recipient_did_public: bool
Check if the recipient did is public.
Indicates whether the message is associated with a public (ledger) recipient DID.
- Returns
True if the recipient’s DID is public, else false
- property recipient_verkey: str
Accessor for the recipient verkey key used to pack the incoming request.
- Returns
The recipient verkey
- property sender_did: str
Accessor for the sender DID which corresponds with the verkey.
- Returns
The sender did
Base outbound transport.
- class aries_cloudagent.transport.outbound.base.BaseOutboundTransport(wire_format: Optional[aries_cloudagent.transport.wire_format.BaseWireFormat] = None, root_profile: Optional[aries_cloudagent.core.profile.Profile] = None)[source]
Bases:
abc.ABC
Base outbound transport class.
- property collector: aries_cloudagent.utils.stats.Collector
Accessor for the stats collector instance.
- abstract async handle_message(profile: aries_cloudagent.core.profile.Profile, payload: Union[str, bytes], endpoint: str, metadata: Optional[dict] = None)[source]
Handle message.
- Parameters
profile – the profile that produced the message
payload – message payload in string or byte format
endpoint – URI endpoint for delivery
metadata – Additional metadata associated with the payload
- property wire_format: aries_cloudagent.transport.wire_format.BaseWireFormat
Accessor for a custom wire format for the transport.
- exception aries_cloudagent.transport.outbound.base.OutboundDeliveryError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.transport.outbound.base.OutboundTransportError
Base exception when a message cannot be delivered via an outbound transport.
- exception aries_cloudagent.transport.outbound.base.OutboundTransportError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.transport.error.TransportError
Generic outbound transport error.
- exception aries_cloudagent.transport.outbound.base.OutboundTransportRegistrationError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.transport.outbound.base.OutboundTransportError
Outbound transport registration error.
Http outbound transport.
- class aries_cloudagent.transport.outbound.http.HttpTransport(**kwargs)[source]
Bases:
aries_cloudagent.transport.outbound.base.BaseOutboundTransport
Http outbound transport class.
- async handle_message(profile: aries_cloudagent.core.profile.Profile, payload: Union[str, bytes], endpoint: str, metadata: Optional[dict] = None, api_key: Optional[str] = None)[source]
Handle message from queue.
- Parameters
profile – the profile that produced the message
payload – message payload in string or byte format
endpoint – URI endpoint for delivery
metadata – Additional metadata associated with the payload
- is_external = False
- schemes = ('http', 'https')
Enum representing captured send status of outbound messages.
- class aries_cloudagent.transport.outbound.status.OutboundSendStatus(value)[source]
Bases:
enum.Enum
Send status of outbound messages.
- QUEUED_FOR_DELIVERY = 'queued_for_delivery'
- SENT_TO_EXTERNAL_QUEUE = 'sent_to_external_queue'
- SENT_TO_SESSION = 'sent_to_session'
- UNDELIVERABLE = 'undeliverable'
- WAITING_FOR_PICKUP = 'waiting_for_pickup'
- property topic
Return an event topic associated with a given status.
Websockets outbound transport.
- class aries_cloudagent.transport.outbound.ws.WsTransport(**kwargs)[source]
Bases:
aries_cloudagent.transport.outbound.base.BaseOutboundTransport
Websockets outbound transport class.
- async handle_message(profile: aries_cloudagent.core.profile.Profile, payload: Union[str, bytes], endpoint: str, metadata: Optional[dict] = None, api_key: Optional[str] = None)[source]
Handle message from queue.
- Parameters
profile – the profile that produced the message
payload – message payload in string or byte format
endpoint – URI endpoint for delivery
metadata – Additional metadata associated with the payload
- is_external = False
- schemes = ('ws', 'wss')
Abstract message queue.
- class aries_cloudagent.transport.queue.base.BaseMessageQueue[source]
Bases:
abc.ABC
Abstract message queue class.
- abstract async dequeue(*, timeout: Optional[int] = None)[source]
Dequeue a message.
- Returns
The dequeued message, or None if a timeout occurs
- Raises
asyncio.CancelledError if the queue has been stopped –
asyncio.TimeoutError if the timeout is reached –
Basic in memory queue.
- class aries_cloudagent.transport.queue.basic.BasicMessageQueue[source]
Bases:
aries_cloudagent.transport.queue.base.BaseMessageQueue
Basic in memory queue implementation class.
- async dequeue(*, timeout: Optional[int] = None)[source]
Dequeue a message.
- Returns
The dequeued message, or None if a timeout occurs
- Raises
asyncio.CancelledError if the queue has been stopped –
asyncio.TimeoutError if the timeout is reached –
Submodules
aries_cloudagent.transport.error module
Transport-related error classes and codes.
- exception aries_cloudagent.transport.error.RecipientKeysError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.transport.error.WireFormatError
Extract recipient keys error.
- exception aries_cloudagent.transport.error.TransportError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.core.error.BaseError
Base class for all transport errors.
- exception aries_cloudagent.transport.error.WireFormatEncodeError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.transport.error.WireFormatError
Encoding error when packing the wire format.
- error_code = 'message_encode_error'
- exception aries_cloudagent.transport.error.WireFormatError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.transport.error.TransportError
Base class for wire-format errors.
- exception aries_cloudagent.transport.error.WireFormatParseError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.transport.error.WireFormatError
Parse error when unpacking the wire format.
- error_code = 'message_parse_error'
aries_cloudagent.transport.pack_format module
aries_cloudagent.transport.stats module
aiohttp stats collector support.
- class aries_cloudagent.transport.stats.StatsTracer(*args: Any, **kwargs: Any)[source]
Bases:
aiohttp.
Attach hooks to client session events and report statistics.
- async connection_queued_end(session, context, params)[source]
Handle the end of a queued connection.
- async connection_queued_start(session, context, params)[source]
Handle the start of a queued connection.
aries_cloudagent.transport.wire_format module
Abstract wire format classes.
- class aries_cloudagent.transport.wire_format.BaseWireFormat[source]
Bases:
object
Abstract messaging wire format.
- abstract async encode_message(session: aries_cloudagent.core.profile.ProfileSession, message_json: Union[str, bytes], recipient_keys: Sequence[str], routing_keys: Sequence[str], sender_key: str) Union[str, bytes] [source]
Encode an outgoing message for transport.
- Parameters
session – The profile session for providing wallet access
message_json – The message body to serialize
recipient_keys – A sequence of recipient verkeys
routing_keys – A sequence of routing verkeys
sender_key – The verification key of the sending agent
- Returns
The encoded message
- Raises
MessageEncodeError – If the message could not be encoded
- abstract get_recipient_keys(message_body: Union[str, bytes]) List[str] [source]
Get all recipient keys from a wire message.
- Parameters
message_body – The body of the message
- Returns
List of recipient keys from the message body
- Raises
RecipientKeysError – If the recipient keys could not be extracted
- abstract async parse_message(session: aries_cloudagent.core.profile.ProfileSession, message_body: Union[str, bytes]) Tuple[dict, aries_cloudagent.transport.inbound.receipt.MessageReceipt] [source]
Deserialize an incoming message and further populate the request context.
- Parameters
session – The profile session for providing wallet access
message_body – The body of the message
- Returns
A tuple of the parsed message and a message receipt instance
- Raises
WireFormatParseError – If the message can’t be parsed
- class aries_cloudagent.transport.wire_format.JsonWireFormat[source]
Bases:
aries_cloudagent.transport.wire_format.BaseWireFormat
Unencrypted wire format.
- abstract async encode_message(session: aries_cloudagent.core.profile.ProfileSession, message_json: Union[str, bytes], recipient_keys: Sequence[str], routing_keys: Sequence[str], sender_key: str) Union[str, bytes] [source]
Encode an outgoing message for transport.
- Parameters
session – The profile session for providing wallet access
message_json – The message body to serialize
recipient_keys – A sequence of recipient verkeys
routing_keys – A sequence of routing verkeys
sender_key – The verification key of the sending agent
- Returns
The encoded message
- Raises
MessageEncodeError – If the message could not be encoded
- get_recipient_keys(message_body: Union[str, bytes]) List[str] [source]
Get all recipient keys from a wire message.
- Parameters
message_body – The body of the message
- Returns
List of recipient keys from the message body
- Raises
RecipientKeysError – If the recipient keys could not be extracted
- abstract async parse_message(session: aries_cloudagent.core.profile.ProfileSession, message_body: Union[str, bytes]) Tuple[dict, aries_cloudagent.transport.inbound.receipt.MessageReceipt] [source]
Deserialize an incoming message and further populate the request context.
- Parameters
session – The profile session for providing wallet access
message_body – The body of the message
- Returns
A tuple of the parsed message and a message receipt instance
- Raises
WireFormatParseError – If the JSON parsing failed
aries_cloudagent.utils package
Submodules
aries_cloudagent.utils.classloader module
The classloader provides utilties to dynamically load classes and modules.
- class aries_cloudagent.utils.classloader.ClassLoader[source]
Bases:
object
Class used to load classes from modules dynamically.
- classmethod load_class(class_name: str, default_module: Optional[str] = None, package: Optional[str] = None)[source]
Resolve a complete class path (ie. typing.Dict) to the class itself.
- Parameters
class_name – the class name
default_module – the default module to load, if not part of in the class name
package – the parent package to search for the module
- Returns
The resolved class
- Raises
ClassNotFoundError – If the class could not be resolved at path
ModuleLoadError – If there was an error loading the module
- classmethod load_module(mod_path: str, package: Optional[str] = None) module [source]
Load a module by its absolute path.
- Parameters
mod_path – the absolute or relative module path
package – the parent package to search for the module
- Returns
The resolved module or None if the module cannot be found
- Raises
ModuleLoadError – If there was an error loading the module
- classmethod load_subclass_of(base_class: Type, mod_path: str, package: Optional[str] = None)[source]
Resolve an implementation of a base path within a module.
- Parameters
base_class – the base class being implemented
mod_path – the absolute module path
package – the parent package to search for the module
- Returns
The resolved class
- Raises
ClassNotFoundError – If the module or class implementation could not be found
ModuleLoadError – If there was an error loading the module
- exception aries_cloudagent.utils.classloader.ClassNotFoundError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.core.error.BaseError
Class not found error.
- class aries_cloudagent.utils.classloader.DeferLoad(cls_path: str)[source]
Bases:
object
Helper to defer loading of a class definition.
- property resolved
Accessor for the resolved class instance.
- exception aries_cloudagent.utils.classloader.ModuleLoadError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.core.error.BaseError
Module load error.
aries_cloudagent.utils.dependencies module
Dependency related util methods.
- aries_cloudagent.utils.dependencies.assert_ursa_bbs_signatures_installed()[source]
Assert ursa_bbs_signatures module is installed.
aries_cloudagent.utils.env module
Environment utility methods.
- aries_cloudagent.utils.env.storage_path(*subpaths, create: bool = False) pathlib.Path [source]
Get the default aca-py home directory.
aries_cloudagent.utils.http module
aries_cloudagent.utils.jwe module
aries_cloudagent.utils.outofband module
aries_cloudagent.utils.repeat module
aries_cloudagent.utils.stats module
Classes for tracking performance and timing.
- class aries_cloudagent.utils.stats.Collector(*, enabled: bool = True, log_path: Optional[str] = None)[source]
Bases:
object
Collector for a set of statistics.
- extract(groups: Optional[Sequence[str]] = None) dict [source]
Extract statistics for a specific set of groups.
- log(name: str, duration: float, start: Optional[float] = None)[source]
Log an entry in the statistics if the collector is enabled.
- wrap(obj, prop_name: Union[str, Sequence[str]], groups: Optional[Sequence[str]] = None, *, ignore_missing: bool = False)[source]
Wrap a method on a class or class instance.
- class aries_cloudagent.utils.stats.Timer(collector: aries_cloudagent.utils.stats.Collector, groups: Sequence[str])[source]
Bases:
object
Timer instance for a running task.
- start() aries_cloudagent.utils.stats.Timer [source]
Start the timer.
aries_cloudagent.utils.task_queue module
Classes for managing a set of asyncio tasks.
- class aries_cloudagent.utils.task_queue.CompletedTask(task: _asyncio.Task, exc_info: Tuple, ident: Optional[str] = None, timing: Optional[dict] = None)[source]
Bases:
object
Represent the result of a queued task.
- class aries_cloudagent.utils.task_queue.PendingTask(coro: Coroutine, complete_hook: Optional[Callable] = None, ident: Optional[str] = None, task_future: Optional[_asyncio.Future] = None, queued_time: Optional[float] = None)[source]
Bases:
object
Represent a task in the queue.
- property cancelled
Accessor for the cancelled property.
- property task: _asyncio.Task
Accessor for the task.
- class aries_cloudagent.utils.task_queue.TaskQueue(max_active: int = 0, timed: bool = False, trace_fn: Optional[Callable] = None)[source]
Bases:
object
A class for managing a set of asyncio tasks.
- add_active(task: _asyncio.Task, task_complete: Optional[Callable] = None, ident: Optional[str] = None, timing: Optional[dict] = None) _asyncio.Task [source]
Register an active async task with an optional completion callback.
- Parameters
task – The asyncio task instance
task_complete – An optional callback to run on completion
ident – A string identifer for the task
timing – An optional dictionary of timing information
- add_pending(pending: aries_cloudagent.utils.task_queue.PendingTask)[source]
Add a task to the pending queue.
- Parameters
pending – The PendingTask to add to the task queue
- async complete(timeout: Optional[float] = None, cleanup: bool = True)[source]
Cancel any pending tasks and wait for, or cancel active tasks.
- completed_task(task: _asyncio.Task, task_complete: Callable, ident: str, timing: Optional[dict] = None)[source]
Clean up after a task has completed and run callbacks.
- put(coro: Coroutine, task_complete: Optional[Callable] = None, ident: Optional[str] = None) aries_cloudagent.utils.task_queue.PendingTask [source]
Add a new task to the queue, delaying execution if busy.
- Parameters
coro – The coroutine to run
task_complete – A callback to run on completion
ident – A string identifier for the task
Returns: a future resolving to the asyncio task instance once queued
- run(coro: Coroutine, task_complete: Optional[Callable] = None, ident: Optional[str] = None, timing: Optional[dict] = None) _asyncio.Task [source]
Start executing a coroutine as an async task, bypassing the pending queue.
- Parameters
coro – The coroutine to run
task_complete – An optional callback to run on completion
ident – A string identifier for the task
timing – An optional dictionary of timing information
Returns: the new asyncio task instance
- aries_cloudagent.utils.task_queue.coro_ident(coro: Coroutine)[source]
Extract an identifier for a coroutine.
aries_cloudagent.utils.tracing module
aries_cloudagent.vc package
Subpackages
Assertion proof purpose class.
- class aries_cloudagent.vc.ld_proofs.purposes.assertion_proof_purpose.AssertionProofPurpose(*, date: Optional[datetime.datetime] = None, max_timestamp_delta: Optional[datetime.timedelta] = None)[source]
Bases:
aries_cloudagent.vc.ld_proofs.purposes.controller_proof_purpose.ControllerProofPurpose
Assertion proof purpose class.
- term = 'assertionMethod'
Authentication proof purpose class.
- class aries_cloudagent.vc.ld_proofs.purposes.authentication_proof_purpose.AuthenticationProofPurpose(*, challenge: str, domain: Optional[str] = None, date: Optional[datetime.datetime] = None, max_timestamp_delta: Optional[datetime.timedelta] = None)[source]
Bases:
aries_cloudagent.vc.ld_proofs.purposes.controller_proof_purpose.ControllerProofPurpose
Authentication proof purpose.
- term = 'authentication'
Controller proof purpose class.
- class aries_cloudagent.vc.ld_proofs.purposes.controller_proof_purpose.ControllerProofPurpose(*, term: str, date: Optional[datetime.datetime] = None, max_timestamp_delta: Optional[datetime.timedelta] = None)[source]
Bases:
aries_cloudagent.vc.ld_proofs.purposes.proof_purpose.ProofPurpose
Controller proof purpose class.
Credential Issuance proof purpose class.
- class aries_cloudagent.vc.ld_proofs.purposes.credential_issuance_purpose.CredentialIssuancePurpose(*, date: Optional[datetime.datetime] = None, max_timestamp_delta: Optional[datetime.timedelta] = None)[source]
Bases:
aries_cloudagent.vc.ld_proofs.purposes.assertion_proof_purpose.AssertionProofPurpose
Credential Issuance proof purpose.
Base Proof Purpose class.
- class aries_cloudagent.vc.ld_proofs.purposes.proof_purpose.ProofPurpose(*, term: str, date: Optional[datetime.datetime] = None, max_timestamp_delta: Optional[datetime.timedelta] = None)[source]
Bases:
object
Base proof purpose class.
JSON-LD, Linked Data Proof and Verifiable Credential constants.
JSON-LD document loader methods.
- class aries_cloudagent.vc.ld_proofs.document_loader.DocumentLoader(profile: aries_cloudagent.core.profile.Profile, cache_ttl: int = 300)[source]
Bases:
object
JSON-LD document loader.
Linked data proof exception classes.
Proof verification and validation result classes.
- class aries_cloudagent.vc.ld_proofs.validation_result.DocumentVerificationResult(*, verified: bool, document: Optional[dict] = None, results: Optional[List[aries_cloudagent.vc.ld_proofs.validation_result.ProofResult]] = None, errors: Optional[List[Exception]] = None)[source]
Bases:
object
Domain verification result class.
aries_cloudagent.wallet package
Abstract and Indy wallet handling.
Subpackages
Submodules
aries_cloudagent.wallet.askar module
aries_cloudagent.wallet.base module
Wallet base class.
- class aries_cloudagent.wallet.base.BaseWallet[source]
Bases:
abc.ABC
Abstract wallet interface.
- abstract async create_local_did(method: aries_cloudagent.wallet.did_method.DIDMethod, key_type: aries_cloudagent.wallet.key_type.KeyType, seed: Optional[str] = None, did: Optional[str] = None, metadata: Optional[dict] = None) aries_cloudagent.wallet.did_info.DIDInfo [source]
Create and store a new local DID.
- Parameters
method – The method to use for the DID
key_type – The key type to use for the DID
seed – Optional seed to use for DID
did – The DID to use
metadata – Metadata to store with DID
- Returns
The created DIDInfo
- async create_public_did(method: aries_cloudagent.wallet.did_method.DIDMethod, key_type: aries_cloudagent.wallet.key_type.KeyType, seed: Optional[str] = None, did: Optional[str] = None, metadata: dict = {}) aries_cloudagent.wallet.did_info.DIDInfo [source]
Create and store a new public DID.
- Parameters
seed – Optional seed to use for DID
did – The DID to use
metadata – Metadata to store with DID
- Returns
The created DIDInfo
- abstract async create_signing_key(key_type: aries_cloudagent.wallet.key_type.KeyType, seed: Optional[str] = None, metadata: Optional[dict] = None) aries_cloudagent.wallet.did_info.KeyInfo [source]
Create a new public/private signing keypair.
- Parameters
key_type – Key type to create
seed – Optional seed allowing deterministic key creation
metadata – Optional metadata to store with the keypair
- Returns
A KeyInfo representing the new record
- abstract async get_local_did(did: str) aries_cloudagent.wallet.did_info.DIDInfo [source]
Find info for a local DID.
- Parameters
did – The DID for which to get info
- Returns
A DIDInfo instance for the DID
- abstract async get_local_did_for_verkey(verkey: str) aries_cloudagent.wallet.did_info.DIDInfo [source]
Resolve a local DID from a verkey.
- Parameters
verkey – Verkey for which to get DID info
- Returns
A DIDInfo instance for the DID
- abstract async get_local_dids() Sequence[aries_cloudagent.wallet.did_info.DIDInfo] [source]
Get list of defined local DIDs.
- Returns
A list of DIDInfo instances
- async get_posted_dids() Sequence[aries_cloudagent.wallet.did_info.DIDInfo] [source]
Get list of defined posted DIDs.
- Returns
A list of DIDInfo instances
- abstract async get_public_did() aries_cloudagent.wallet.did_info.DIDInfo [source]
Retrieve the public DID.
- Returns
The currently public DIDInfo, if any
- abstract async get_signing_key(verkey: str) aries_cloudagent.wallet.did_info.KeyInfo [source]
Fetch info for a signing keypair.
- Parameters
verkey – The verification key of the keypair
- Returns
A KeyInfo representing the keypair
- abstract async pack_message(message: str, to_verkeys: Sequence[str], from_verkey: Optional[str] = None) bytes [source]
Pack a message for one or more recipients.
- Parameters
message – The message to pack
to_verkeys – The verkeys to pack the message for
from_verkey – The sender verkey
- Returns
The packed message
- abstract async replace_local_did_metadata(did: str, metadata: dict)[source]
Replace the metadata associated with a local DID.
Prefer set_did_endpoint() to set endpoint in metadata.
- Parameters
did – DID for which to replace metadata
metadata – The new metadata
- abstract async replace_signing_key_metadata(verkey: str, metadata: dict)[source]
Replace the metadata associated with a signing keypair.
- Parameters
verkey – The verification key of the keypair
metadata – The new metadata to store
- abstract async rotate_did_keypair_apply(did: str) None [source]
Apply temporary keypair as main for DID that wallet owns.
- Parameters
did – signing DID
- Raises
WalletNotFoundError – if wallet does not own DID
WalletError – if wallet has not started key rotation
- abstract async rotate_did_keypair_start(did: str, next_seed: Optional[str] = None) str [source]
Begin key rotation for DID that wallet owns: generate new keypair.
- Parameters
did – signing DID
next_seed – seed for incoming ed25519 key pair (default random)
- Returns
The new verification key
- Raises
WalletNotFoundError – if wallet does not own DID
- async set_did_endpoint(did: str, endpoint: str, _ledger: aries_cloudagent.ledger.base.BaseLedger, endpoint_type: Optional[aries_cloudagent.ledger.endpoint_type.EndpointType] = None, write_ledger: bool = True, endorser_did: Optional[str] = None)[source]
Update the endpoint for a DID in the wallet, send to ledger if public or posted.
- Parameters
did – DID for which to set endpoint
endpoint – the endpoint to set, None to clear
ledger – the ledger to which to send endpoint update if DID is public or posted
endpoint_type – the type of the endpoint/service. Only endpoint_type ‘endpoint’ affects local wallet
- abstract async set_public_did(did: Union[str, aries_cloudagent.wallet.did_info.DIDInfo]) aries_cloudagent.wallet.did_info.DIDInfo [source]
Assign the public DID.
- Returns
The updated DIDInfo
- abstract async sign_message(message: Union[List[bytes], bytes], from_verkey: str) bytes [source]
Sign message(s) using the private key associated with a given verkey.
- Parameters
message – The message(s) to sign
from_verkey – Sign using the private key related to this verkey
- Returns
The signature
- abstract async unpack_message(enc_message: bytes) Tuple[str, str, str] [source]
Unpack a message.
- Parameters
enc_message – The encrypted message
- Returns
(message, from_verkey, to_verkey)
- Return type
A tuple
- abstract async verify_message(message: Union[List[bytes], bytes], signature: bytes, from_verkey: str, key_type: aries_cloudagent.wallet.key_type.KeyType) bool [source]
Verify a signature against the public key of the signer.
- Parameters
message – The message to verify
signature – The signature to verify
from_verkey – Verkey to use in verification
key_type – The key type to derive the signature verification algorithm from
- Returns
True if verified, else False
aries_cloudagent.wallet.bbs module
BBS+ crypto.
- exception aries_cloudagent.wallet.bbs.BbsException(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.core.error.BaseError
Base BBS exception.
- aries_cloudagent.wallet.bbs.create_bls12381g2_keypair(seed: Optional[bytes] = None) Tuple[bytes, bytes] [source]
Create a public and private bls12381g2 keypair from a seed value.
- Parameters
seed – Seed for keypair
- Returns
A tuple of (public key, secret key)
- aries_cloudagent.wallet.bbs.sign_messages_bls12381g2(messages: List[bytes], secret: bytes)[source]
Sign messages using a bls12381g2 private signing key.
- aries_cloudagent.wallet.bbs.verify_signed_messages_bls12381g2(messages: List[bytes], signature: bytes, public_key: bytes) bool [source]
Verify an ed25519 signed message according to a public verification key.
- Parameters
signed – The signed messages
public_key – The public key to use in verification
- Returns
True if verified, else False
aries_cloudagent.wallet.crypto module
aries_cloudagent.wallet.did_info module
KeyInfo, DIDInfo.
- class aries_cloudagent.wallet.did_info.DIDInfo(did, verkey, metadata, method, key_type)
Bases:
tuple
- property did
Alias for field number 0
- property key_type
Alias for field number 4
- property metadata
Alias for field number 2
- property method
Alias for field number 3
- property verkey
Alias for field number 1
aries_cloudagent.wallet.did_method module
Did method enum.
- class aries_cloudagent.wallet.did_method.DIDMethod(value)[source]
Bases:
enum.Enum
DID Method class specifying DID methods with supported key types.
- KEY = DIDMethodSpec(method_name='key', supported_key_types=[<KeyType.ED25519: KeySpec(key_type='ed25519', multicodec_name='ed25519-pub', multicodec_prefix=b'\xed\x01')>, <KeyType.BLS12381G2: KeySpec(key_type='bls12381g2', multicodec_name='bls12_381-g2-pub', multicodec_prefix=b'\xeb\x01')>], supports_rotation=False)
- SOV = DIDMethodSpec(method_name='sov', supported_key_types=[<KeyType.ED25519: KeySpec(key_type='ed25519', multicodec_name='ed25519-pub', multicodec_prefix=b'\xed\x01')>], supports_rotation=True)
- classmethod from_did(did: str) aries_cloudagent.wallet.did_method.DIDMethod [source]
Get DID method instance from the method name.
- classmethod from_metadata(metadata: Mapping) aries_cloudagent.wallet.did_method.DIDMethod [source]
Get DID method instance from metadata object.
Returns SOV if no metadata was found for backwards compatability.
- classmethod from_method(method: str) Optional[aries_cloudagent.wallet.did_method.DIDMethod] [source]
Get DID method instance from the method name.
- property supported_key_types: List[aries_cloudagent.wallet.key_type.KeyType]
Getter for supported key types of method.
- supports_key_type(key_type: aries_cloudagent.wallet.key_type.KeyType) bool [source]
Check whether the current method supports the key type.
aries_cloudagent.wallet.did_posture module
Ledger utilities.
- class aries_cloudagent.wallet.did_posture.DIDPosture(value)[source]
Bases:
enum.Enum
Enum for DID postures: public, posted but not public, or in wallet only.
- POSTED = DIDPostureSpec(moniker='posted', ordinal=1, public=False, posted=True)
- PUBLIC = DIDPostureSpec(moniker='public', ordinal=0, public=True, posted=True)
- WALLET_ONLY = DIDPostureSpec(moniker='wallet_only', ordinal=2, public=False, posted=False)
- static get(posture: Union[str, Mapping]) aries_cloudagent.wallet.did_posture.DIDPosture [source]
Return enum instance corresponding to input string or DID metadata.
- property metadata: Mapping
DID metadata for DID posture.
- property ordinal: Mapping
public first, then posted and wallet-only.
- Type
Ordinal for presentation
aries_cloudagent.wallet.error module
Wallet-related exceptions.
- exception aries_cloudagent.wallet.error.WalletDuplicateError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.wallet.error.WalletError
Duplicate record exception.
- exception aries_cloudagent.wallet.error.WalletError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.core.error.BaseError
General wallet exception.
- exception aries_cloudagent.wallet.error.WalletNotFoundError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.wallet.error.WalletError
Record not found exception.
- exception aries_cloudagent.wallet.error.WalletSettingsError(*args, error_code: Optional[str] = None, **kwargs)[source]
Bases:
aries_cloudagent.wallet.error.WalletError
Invalid settings exception.
aries_cloudagent.wallet.in_memory module
aries_cloudagent.wallet.indy module
aries_cloudagent.wallet.key_pair module
Key pair storage manager.
- class aries_cloudagent.wallet.key_pair.KeyPairStorageManager(store: aries_cloudagent.storage.base.BaseStorage)[source]
Bases:
object
Key pair storage manager.
- async delete_key_pair(verkey: str)[source]
Remove a previously-stored key pair record.
- Raises
StorageNotFoundError – If the record is not found
- async find_key_pairs(tag_query: Optional[Mapping] = None) List[dict] [source]
Find key pairs by tag query.
- async get_key_pair(verkey: str) dict [source]
Retrieve signing key pair from storage by verkey.
- Parameters
storage (BaseStorage) – The storage to use for querying
verkey (str) – The verkey to query for
- Raises
StorageDuplicateError – If more than one key pair is found for this verkey
StorageNotFoundError – If no key pair is found for this verkey
- Returns
dict: The key pair data
aries_cloudagent.wallet.key_type module
Key type enum.
- class aries_cloudagent.wallet.key_type.KeySpec(key_type, multicodec_name, multicodec_prefix)
Bases:
tuple
- property key_type
Alias for field number 0
- property multicodec_name
Alias for field number 1
- property multicodec_prefix
Alias for field number 2
- class aries_cloudagent.wallet.key_type.KeyType(value)[source]
Bases:
enum.Enum
KeyType Enum specifying key types with multicodec name.
- BLS12381G1 = KeySpec(key_type='bls12381g1', multicodec_name='bls12_381-g1-pub', multicodec_prefix=b'\xea\x01')
- BLS12381G1G2 = KeySpec(key_type='bls12381g1g2', multicodec_name='bls12_381-g1g2-pub', multicodec_prefix=b'\xee\x01')
- BLS12381G2 = KeySpec(key_type='bls12381g2', multicodec_name='bls12_381-g2-pub', multicodec_prefix=b'\xeb\x01')
- ED25519 = KeySpec(key_type='ed25519', multicodec_name='ed25519-pub', multicodec_prefix=b'\xed\x01')
- X25519 = KeySpec(key_type='x25519', multicodec_name='x25519-pub', multicodec_prefix=b'\xec\x01')
- classmethod from_key_type(key_type: str) Optional[aries_cloudagent.wallet.key_type.KeyType] [source]
Get KeyType instance from the key type identifier.
- classmethod from_multicodec_name(multicodec_name: str) Optional[aries_cloudagent.wallet.key_type.KeyType] [source]
Get KeyType instance based on multicodec name. Returns None if not found.
- classmethod from_multicodec_prefix(multicodec_prefix: bytes) Optional[aries_cloudagent.wallet.key_type.KeyType] [source]
Get KeyType instance based on multicodec prefix. Returns None if not found.
- classmethod from_prefixed_bytes(prefixed_bytes: bytes) Optional[aries_cloudagent.wallet.key_type.KeyType] [source]
Get KeyType instance based on prefix in bytes. Returns None if not found.
- exception aries_cloudagent.wallet.key_type.KeyTypeException[source]
Bases:
BaseException
Key type exception.
aries_cloudagent.wallet.routes module
aries_cloudagent.wallet.util module
Wallet utility functions.
- aries_cloudagent.wallet.util.abbr_verkey(full_verkey: str, did: Optional[str] = None) str [source]
Given a full verkey and DID, return the abbreviated verkey.
- aries_cloudagent.wallet.util.b58_to_bytes(val: str) bytes [source]
Convert a base 58 string to bytes.
- aries_cloudagent.wallet.util.b64_to_bytes(val: str, urlsafe=False) bytes [source]
Convert a base 64 string to bytes.
- aries_cloudagent.wallet.util.b64_to_str(val: str, urlsafe=False, encoding=None) str [source]
Convert a base 64 string to string on input encoding (default utf-8).
- aries_cloudagent.wallet.util.bytes_to_b58(val: bytes) str [source]
Convert a byte string to base 58.
- aries_cloudagent.wallet.util.bytes_to_b64(val: bytes, urlsafe=False, pad=True, encoding: str = 'ascii') str [source]
Convert a byte string to base 64.
- aries_cloudagent.wallet.util.default_did_from_verkey(verkey: str) str [source]
Given a verkey, return the default indy did.
By default the did is the first 16 bytes of the verkey.
- aries_cloudagent.wallet.util.full_verkey(did: str, abbr_verkey: str) str [source]
Given a DID and abbreviated verkey, return the full verkey.
- async aries_cloudagent.wallet.util.notify_endorse_did_attrib_event(profile: aries_cloudagent.core.profile.Profile, did: str, meta_data: dict)[source]
Send notification for a DID ATTRIB post-process event.
- async aries_cloudagent.wallet.util.notify_endorse_did_event(profile: aries_cloudagent.core.profile.Profile, did: str, meta_data: dict)[source]
Send notification for a DID post-process event.
- aries_cloudagent.wallet.util.pad(val: str) str [source]
Pad base64 values if need be: JWT calls to omit trailing padding.
- aries_cloudagent.wallet.util.random_seed() bytes [source]
Generate a random seed value.
- Returns
A new random seed
- aries_cloudagent.wallet.util.set_urlsafe_b64(val: str, urlsafe: bool = True) str [source]
Set URL safety in base64 encoding.
Submodules
aries_cloudagent.version module
Library version information.