#NEWLINE# def SignBuffer( self , in_buffer ) : #NEWLINE# #INDENT# "Sign a buffer via temp files.\n\n    Our signing tool can't sign a buffer, so we work around it using temporary\n    files.\n\n    Args:\n      in_buffer: data to sign\n    Returns:\n      signed data\n    " #NEWLINE# with tempfile . NamedTemporaryFile ( ) as temp_in : #NEWLINE# #INDENT# temp_in . write ( in_buffer ) #NEWLINE# temp_in . seek ( 0 ) #NEWLINE# outfile = self . SignFile ( temp_in . name ) #NEWLINE# return open ( outfile , 'r' ) . read ( )