Module: signed_pre_key_pair
- class x3dh.signed_pre_key_pair.SignedPreKeyPair(priv, sig, timestamp)[source]
Bases:
NamedTupleA signed pre key, i.e. a pre key whose public key was encoded using an application-specific encoding format, then signed by the identity key, and stored together with a generation timestamp for periodic rotation.
- property model: SignedPreKeyPairModel
Returns: The internal state of this
SignedPreKeyPairas a pydantic model.
- property json: JSONObject
Returns: The internal state of this
SignedPreKeyPairas a JSON-serializable Python object.
- static from_model(model)[source]
- Parameters:
model (
SignedPreKeyPairModel) – The pydantic model holding the internal state of aSignedPreKeyPair, as produced bymodel.- Return type:
- Returns:
A configured instance of
SignedPreKeyPair, with internal state restored from the model.
Warning
Migrations are not provided via the
model/from_model()API. Usejson/from_json()instead. Refer to Serialization and Migration in the documentation for details.
- static from_json(serialized)[source]
- Parameters:
serialized (JSONObject) – A JSON-serializable Python object holding the internal state of a
SignedPreKeyPair, as produced byjson.- Return type:
- Returns:
A configured instance of
SignedPreKeyPair, with internal state restored from the serialized data.