/usr/lib/python3/dist-packages/axolotl/state/signedprekeyrecord.py is in python3-axolotl 0.1.39-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | # -*- coding; utf-8 -*-
from .storageprotos_pb2 import SignedPreKeyRecordStructure
from ..ecc.curve import Curve
from ..ecc.eckeypair import ECKeyPair
class SignedPreKeyRecord:
def __init__(self, _id=None, timestamp=None, ecKeyPair=None, signature=None, serialized=None):
self.structure = SignedPreKeyRecordStructure()
if serialized:
self.structure.ParseFromString(serialized)
else:
self.structure.id = _id
self.structure.publicKey = ecKeyPair.getPublicKey().serialize()
self.structure.privateKey = ecKeyPair.getPrivateKey().serialize()
self.structure.signature = signature
self.structure.timestamp = timestamp
def getId(self):
return self.structure.id
def getTimestamp(self):
return self.structure.timestamp
def getKeyPair(self):
publicKey = Curve.decodePoint(bytearray(self.structure.publicKey), 0)
privateKey = Curve.decodePrivatePoint(bytearray(self.structure.privateKey))
return ECKeyPair(publicKey, privateKey)
def getSignature(self):
return self.structure.signature
def serialize(self):
return self.structure.SerializeToString()
|