client.keys.did module¶
-
class
factom_did.client.keys.did.DIDKey(alias, purpose, key_type, controller, priority_requirement=None, public_key=None, private_key=None)¶ Bases:
factom_did.client.keys.abstract.AbstractDIDKeyApplication-level key, which can be used for authentication, signing requests, encryption, decryption, etc.
-
alias¶ Type: str
-
purpose¶ Shows what purpose(s) the key serves. (PublicKey, AuthenticationKey or both)
Type: DIDKeyPurpose or DIDKeyPurpose[]
-
controller¶ Type: str
-
priority_requirement¶ Type: int, optional
-
public_key¶ Type: str, optional
-
private_key¶ Type: str, optional
-
static
from_entry_dict(entry_dict, version='1.0.0')¶ Creates an AbstractDIDKey object from an on-chain entry
Parameters: - entry_dict (dict) – The on-chain entry, represented as a Python dictionary
- version (str) – The entry schema version
Returns: Return type: Raises: NotImplementedError– If the supplied version is not supported
-
to_entry_dict(did, version='1.0.0')¶ Converts the object to a dictionary suitable for recording on-chain.
Parameters: - did (str) – The DID with which this key is associated. Note that this can be different from the key controller.
- version (str) – The entry schema version
Returns: Dictionary with id, type, controller and an optional priorityRequirement fields. In addition to those, there is one extra field for the public key: if the selected signature type is SignatureType.RSA, then this field is called publicKeyPem, otherwise it is called publicKeyBase58.
Return type: dict
-