aries_cloudagent.did package

Submodules

aries_cloudagent.did.did_key module

DID Key class and resolver methods.

class aries_cloudagent.did.did_key.DIDKey(public_key: bytes, key_type: KeyType)[source]

Bases: object

DID Key parser and resolver.

property did: str

key string.

Type

Getter for full did

property did_doc: dict

key.

Type

Getter for did document associated with did

property fingerprint: str

Getter for did key fingerprint.

classmethod from_did(did: str) DIDKey[source]

Initialize a new DIDKey instance from a fully qualified did:key string.

Extracts the fingerprint from the did:key and uses that to constrcut the did:key.

classmethod from_fingerprint(fingerprint: str, key_types=None) DIDKey[source]

Initialize new DIDKey instance from multibase encoded fingerprint.

The fingerprint contains both the public key and key type.

classmethod from_public_key(public_key: bytes, key_type: KeyType) DIDKey[source]

Initialize new DIDKey instance from public key and key type.

classmethod from_public_key_b58(public_key: str, key_type: KeyType) DIDKey[source]

Initialize new DIDKey instance from base58 encoded public key and key type.

property key_id: str

Getter for key id.

property key_type: KeyType

Getter for key type.

property prefixed_public_key: bytes

Getter for multicodec prefixed public key.

property public_key: bytes

Getter for public key.

property public_key_b58: str

Getter for base58 encoded public key.

aries_cloudagent.did.did_key.construct_did_key_bls12381g1(did_key: DIDKey) dict[source]

Construct BLS12381G1 did:key.

Parameters

did_key (DIDKey) – did key instance to parse bls12381g1 did:key document from

Returns

The bls12381g1 did:key did document

Return type

dict

aries_cloudagent.did.did_key.construct_did_key_bls12381g1g2(did_key: DIDKey) dict[source]

Construct BLS12381G1G2 did:key.

Parameters

did_key (DIDKey) – did key instance to parse bls12381g1g2 did:key document from

Returns

The bls12381g1g2 did:key did document

Return type

dict

aries_cloudagent.did.did_key.construct_did_key_bls12381g2(did_key: DIDKey) dict[source]

Construct BLS12381G2 did:key.

Parameters

did_key (DIDKey) – did key instance to parse bls12381g2 did:key document from

Returns

The bls12381g2 did:key did document

Return type

dict

aries_cloudagent.did.did_key.construct_did_key_ed25519(did_key: DIDKey) dict[source]

Construct Ed25519 did:key.

Parameters

did_key (DIDKey) – did key instance to parse ed25519 did:key document from

Returns

The ed25519 did:key did document

Return type

dict

aries_cloudagent.did.did_key.construct_did_key_x25519(did_key: DIDKey) dict[source]

Construct X25519 did:key.

Parameters

did_key (DIDKey) – did key instance to parse x25519 did:key document from

Returns

The x25519 did:key did document

Return type

dict

aries_cloudagent.did.did_key.construct_did_signature_key_base(*, id: str, key_id: str, verification_method: dict)[source]

Create base did key structure to use for most signature keys.

May not be suitable for all did key types