def _create_openpgp_cipher(factory, **kwargs):
 iv = kwargs.pop('IV', None)
 IV = kwargs.pop('iv', None)
 if ((None, None) == (iv, IV)):
  iv = get_random_bytes(factory.block_size)
 if (iv is not None):
  if (IV is not None):
   raise TypeError("You must either use 'iv' or 'IV', not both")
 else:
  iv = IV
 try:
  key = kwargs.pop('key')
 except KeyError as e:
  raise TypeError(('Missing component: ' + str(e)))
 return OpenPgpMode(factory, key, iv, kwargs)

def _create_openpgp_cipher ( factory , ** kwargs ) : iv = kwargs . pop ( 'IV' , None ) IV = kwargs . pop ( 'iv' , None ) if ( ( None , None ) == ( iv , IV ) ) : iv = get_random_bytes ( factory . block_size ) if ( iv is not None ) : if ( IV is not None ) : raise TypeError ( "You must either use 'iv' or 'IV', not both" ) else : iv = IV try : key = kwargs . pop ( 'key' ) except KeyError as e : raise TypeError ( ( 'Missing component: ' + str ( e ) ) ) return OpenPgpMode ( factory , key , iv , kwargs )
create a new block cipher .