def testPKFromToDict(): pk = PublicKey(N=cmod.integer(11), Rms=cmod.integer(12), Rctxt=cmod.integer(13), R={'a': cmod.integer(1), 'b': cmod.integer(2)}, S=cmod.integer(14), Z=cmod.integer(15)) assert pk == PublicKey.fromStrDict(pk.toStrDict())
async def getPublicKey(self, id: ID, signatureType='CL') -> PublicKey: op = { TXN_TYPE: GET_CLAIM_DEF, REF: id.schemaId, ORIGIN: id.schemaKey.issuerId, SIGNATURE_TYPE: signatureType } data, seqNo = await self._sendGetReq(op) data = data[DATA][PRIMARY] pk = PublicKey.fromStrDict(data)._replace(seqId=seqNo) return pk
async def getPublicKey(self, id: ID) -> PublicKey: op = { TXN_TYPE: GET_ISSUER_KEY, REF: id.schemaId, ORIGIN: id.schemaKey.issuerId } data, seqNo = await self._sendGetReq(op) data = data[DATA][PRIMARY] pk = PublicKey.fromStrDict(data)._replace(seqId=seqNo) return pk
async def getPublicKey(self, id: ID) -> PublicKey: op = { TXN_TYPE: GET_ISSUER_KEY, REF: id.schemaId, ORIGIN: id.schemaKey.issuerId } try: data, seqNo = await self._sendGetReq(op) except TimeoutError: logger.error('Operation timed out {}'.format(op)) return None if not data: return None data = data[DATA][PRIMARY] pk = PublicKey.fromStrDict(data)._replace(seqId=seqNo) return pk