예제 #1
0
    async def submitPublicKeys(self,
                               id: ID,
                               pk: PublicKey,
                               pkR: RevocationPublicKey = None,
                               signatureType='CL') -> \
            (PublicKey, RevocationPublicKey):

        data = {}
        if pk is not None:
            data[PRIMARY] = pk.to_str_dict()
        if pkR is not None:
            data[REVOCATION] = pkR.toStrDict()

        op = {
            TXN_TYPE: CLAIM_DEF,
            REF: id.schemaId,
            DATA: data,
            SIGNATURE_TYPE: signatureType
        }

        _, seqNo = await self._sendSubmitReq(op)

        if seqNo:
            pk = pk._replace(seqId=seqNo)

            if pkR is not None:
                pkR = pkR._replace(seqId=seqNo)

            return pk, pkR
예제 #2
0
    async def submitPublicKeys(self,
                               id: ID,
                               pk: PublicKey,
                               pkR: RevocationPublicKey = None,
                               signatureType='CL') -> \
            (PublicKey, RevocationPublicKey):

        data = {}
        if pk is not None:
            data[PRIMARY] = pk.to_str_dict()
        if pkR is not None:
            data[REVOCATION] = pkR.toStrDict()

        op = {
            TXN_TYPE: CLAIM_DEF,
            REF: id.schemaId,
            DATA: data,
            SIGNATURE_TYPE: signatureType
        }

        _, seqNo = await self._sendSubmitReq(op)

        if seqNo:
            pk = pk._replace(seqId=seqNo)

            if pkR is not None:
                pkR = pkR._replace(seqId=seqNo)

            return pk, pkR
예제 #3
0
    async def submitPublicKeys(self,
                               id: ID,
                               pk: PublicKey,
                               pkR: RevocationPublicKey = None
                               ) -> (PublicKey, RevocationPublicKey):
        pkData = pk.toStrDict()
        pkRData = pkR.toStrDict()
        op = {
            TXN_TYPE: ISSUER_KEY,
            REF: id.schemaId,
            DATA: {
                PRIMARY: pkData,
                REVOCATION: pkRData
            }
        }

        try:
            data, seqNo = await self._sendSubmitReq(op)
        except TimeoutError:
            logger.error('Operation timed out {}'.format(op))
            return None

        if not seqNo:
            return None
        pk = pk._replace(seqId=seqNo)
        pkR = pkR._replace(seqId=seqNo)
        return pk, pkR
예제 #4
0
    async def submitPublicKeys(self,
                               schemaId: ID,
                               pk: PublicKey,
                               pkR: RevocationPublicKey = None
                               ) -> (PublicKey, RevocationPublicKey):
        pk = pk._replace(seqId=self._pkId)
        self._pkId += 1
        await self._cacheValueForId(self._pks, schemaId, pk)

        if pkR:
            pkR = pkR._replace(seqId=self._pkRId)
            self._pkRId += 1
            await self._cacheValueForId(self._pkRs, schemaId, pkR)

        return pk, pkR
    async def submitPublicKeys(self, id: ID, pk: PublicKey,
                               pkR: RevocationPublicKey = None) -> (
            PublicKey, RevocationPublicKey):
        pkData = pk.toStrDict()
        pkRData = pkR.toStrDict()
        op = {
            TXN_TYPE: ISSUER_KEY,
            REF: id.schemaId,
            DATA: {PRIMARY: pkData, REVOCATION: pkRData}
        }

        data, seqNo = await self._sendSubmitReq(op)

        if not seqNo:
            return None
        pk = pk._replace(seqId=seqNo)
        pkR = pkR._replace(seqId=seqNo)
        return pk, pkR