Пример #1
0
 def PublicKeyVerifyAndDecode(
     self, request: testing_api_pb2.JwtVerifyRequest,
     context: grpc.ServicerContext) -> testing_api_pb2.JwtVerifyResponse:
   """Verifies the validity of the signed compact JWT token."""
   try:
     keyset_handle = cleartext_keyset_handle.read(
         tink.BinaryKeysetReader(request.keyset))
     validator = validator_from_proto(request.validator)
     p = keyset_handle.primitive(jwt.JwtPublicKeyVerify)
     verified_jwt = p.verify_and_decode(request.signed_compact_jwt, validator)
     return testing_api_pb2.JwtVerifyResponse(
         verified_jwt=verifiedjwt_to_proto(verified_jwt))
   except tink.TinkError as e:
     return testing_api_pb2.JwtVerifyResponse(err=str(e))
Пример #2
0
 def PublicKeyVerifyAndDecode(
         self, request: testing_api_pb2.JwtVerifyRequest,
         context: grpc.ServicerContext
 ) -> testing_api_pb2.JwtVerifyResponse:
     """Verifies the validity of the signed compact JWT token."""
     return testing_api_pb2.JwtVerifyResponse(err='Not yet implemented.')