parameters: (clrtxt, **kw)
return_statement: return output
docstring: Encrypt a message with raw string data.
  
      :Parameters:
          - `clrtxt`: cleartext string to encrypt
  
      :Keywords:
          - `passphrase`: string symmetrical encryption passphrase
          - `keys`: native OpenPGP or ASCII-armored string containing public keys
          - `use_key`: [(primary, keyid), ..] specific encryption key(s)
          - `use_userid`: [(primary, userid), ..] encryption key(s) by user ID(s)
          - `lit_filename`: name of literal cleartext (NOT output)
          - `lit_modified`: modification time of literal cleartext (NOT output)
          - `armor`: set to True to armor encrypted string output
  
      :Returns: str ciphertext
  
      Be sure to use one of either `target_key`, `target_userid`, or `passphrase`
      to prevent unintentional encryption (a PGPError is raised if neither of
      these are given).
docstring_summary: Encrypt a message with raw string data.
docstring_tokens: Encrypt a message with raw string data .
function: def encrypt_str(clrtxt, **kw):
      """Encrypt a message with raw string data.
  
      :Parameters:
          - `clrtxt`: cleartext string to encrypt
  
      :Keywords:
          - `passphrase`: string symmetrical encryption passphrase
          - `keys`: native OpenPGP or ASCII-armored string containing public keys
          - `use_key`: [(primary, keyid), ..] specific encryption key(s)
          - `use_userid`: [(primary, userid), ..] encryption key(s) by user ID(s)
          - `lit_filename`: name of literal cleartext (NOT output)
          - `lit_modified`: modification time of literal cleartext (NOT output)
          - `armor`: set to True to armor encrypted string output
  
      :Returns: str ciphertext
  
      Be sure to use one of either `target_key`, `target_userid`, or `passphrase`
      to prevent unintentional encryption (a PGPError is raised if neither of
      these are given).
      """
      keystring = kw.pop('keys', '')
      encrypting_key = kw.pop('use_key', None)
      encrypting_userid = kw.pop('use_userid', None)
      # kw['passphrase'] passed to encrypt_msg()
      lit_filename = kw.pop('lit_filename', 'cleartext')
      lit_modified = kw.pop('lit_modified', 0)
      armor = kw.pop('armor', False)
  
      keys = _filter_msgs(list_as_signed(keystring), MSG_KEYS)
  
      opts = {}
  
      if encrypting_key:
          opts['keyids'] = encrypting_key
  
      elif encrypting_userid:
          opts['userids'] = encrypting_userid
  
      elif 'passphrase' not in kw:
          raise PGPError("Please specify encryption key by user ID, key ID or fingerprint.")
  
      keytargets = find_keys(keys, action='encrypt', **opts)
  
      literal = {'data': clrtxt, 'format': "b",
                 'filename': lit_filename,
                 'modified': lit_modified}
  
      msg = create_LiteralMsg([literal])
  
      cphmsg = encrypt_msg(msg, keys=keytargets, **kw)
  
      if armor:
          output = apply_armor(cphmsg)
  
      else:
          output = cphmsg.rawstr()
  
      return output
function_tokens: def encrypt_str ( clrtxt , * * kw ) : keystring = kw . pop ( 'keys' , '' ) encrypting_key = kw . pop ( 'use_key' , None ) encrypting_userid = kw . pop ( 'use_userid' , None ) # kw['passphrase'] passed to encrypt_msg() lit_filename = kw . pop ( 'lit_filename' , 'cleartext' ) lit_modified = kw . pop ( 'lit_modified' , 0 ) armor = kw . pop ( 'armor' , False ) keys = _filter_msgs ( list_as_signed ( keystring ) , MSG_KEYS ) opts = { } if encrypting_key : opts [ 'keyids' ] = encrypting_key elif encrypting_userid : opts [ 'userids' ] = encrypting_userid elif 'passphrase' not in kw : raise PGPError ( "Please specify encryption key by user ID, key ID or fingerprint." ) keytargets = find_keys ( keys , action = 'encrypt' , * * opts ) literal = { 'data' : clrtxt , 'format' : "b" , 'filename' : lit_filename , 'modified' : lit_modified } msg = create_LiteralMsg ( [ literal ] ) cphmsg = encrypt_msg ( msg , keys = keytargets , * * kw ) if armor : output = apply_armor ( cphmsg ) else : output = cphmsg . rawstr ( ) return output