def sign_message(privkey_path, message):
 log.debug('salt.crypt.sign_message: Loading private key')
 with salt.utils.fopen(privkey_path) as f:
  key = RSA.importKey(f.read())
 log.debug('salt.crypt.sign_message: Signing message.')
 signer = PKCS1_v1_5.new(key)
 return signer.sign(SHA.new(message))

def sign_message ( privkey_path , message ) : log . debug ( 'salt.crypt.sign_message: Loading private key' ) with salt . utils . fopen ( privkey_path ) as f : key = RSA . importKey ( f . read ( ) ) log . debug ( 'salt.crypt.sign_message: Signing message.' ) signer = PKCS1_v1_5 . new ( key ) return signer . sign ( SHA . new ( message ) )
use crypto .