Пример #1
0
 def PublicKeySignAndEncode(
     self, request: testing_api_pb2.JwtSignRequest,
     context: grpc.ServicerContext) -> testing_api_pb2.JwtSignResponse:
   """Computes a signed compact JWT token."""
   try:
     keyset_handle = cleartext_keyset_handle.read(
         tink.BinaryKeysetReader(request.keyset))
     p = keyset_handle.primitive(jwt.JwtPublicKeySign)
     raw_jwt = raw_jwt_from_proto(request.raw_jwt)
     signed_compact_jwt = p.sign_and_encode(raw_jwt)
     return testing_api_pb2.JwtSignResponse(
         signed_compact_jwt=signed_compact_jwt)
   except tink.TinkError as e:
     return testing_api_pb2.JwtSignResponse(err=str(e))
Пример #2
0
 def PublicKeySignAndEncode(
         self, request: testing_api_pb2.JwtSignRequest,
         context: grpc.ServicerContext) -> testing_api_pb2.JwtSignResponse:
     """Computes a signed compact JWT token."""
     return testing_api_pb2.JwtSignResponse(err='Not yet implemented.')