def _uncompress_pkiz(token):
    # TypeError If the signed_text is not zlib compressed binascii.Error if
    # signed_text has incorrect base64 padding (py34)

    try:
        return cms.pkiz_uncompress(token)
    except (TypeError, binascii.Error):
        raise ksm_exceptions.InvalidToken(token)
Example #2
0
 def _verify_pkiz_token(self, signed_text, token_ids):
     self._revocations.check(token_ids)
     try:
         uncompressed = cms.pkiz_uncompress(signed_text)
         verified = self._cms_verify(uncompressed, inform=cms.PKIZ_CMS_FORM)
         return verified
     # TypeError If the signed_text is not zlib compressed
     except TypeError:
         raise exc.InvalidToken(signed_text)
Example #3
0
 def _verify_pkiz_token(self, signed_text, token_ids):
     self._revocations.check(token_ids)
     try:
         uncompressed = cms.pkiz_uncompress(signed_text)
         verified = self._cms_verify(uncompressed, inform=cms.PKIZ_CMS_FORM)
         return verified
     # TypeError If the signed_text is not zlib compressed
     # binascii.Error if signed_text has incorrect base64 padding (py34)
     except (TypeError, binascii.Error):
         raise exc.InvalidToken(signed_text)
Example #4
0
 def _verify_pkiz_token(self, signed_text, token_ids):
     self._revocations.check(token_ids)
     try:
         uncompressed = cms.pkiz_uncompress(signed_text)
         verified = self._cms_verify(uncompressed, inform=cms.PKIZ_CMS_FORM)
         return verified
     # TypeError If the signed_text is not zlib compressed
     # binascii.Error if signed_text has incorrect base64 padding (py34)
     except (TypeError, binascii.Error):
         raise ksm_exceptions.InvalidToken(signed_text)