docs: def read_private_key_file(pkey_file,
                                pkey_password=None,
                                key_type=None,
                                logger=None):
          """
          Get SSH Public key from a private key file, given an optional password
  
          Arguments:
              pkey_file (str):
                  File containing a private key (RSA, DSS or ECDSA)
          Keyword Arguments:
              pkey_password (Optional[str]):
                  Password to decrypt the private key
              logger (Optional[logging.Logger])
          Return:
              paramiko.Pkey
          """
          ssh_pkey = None
          for pkey_class in (key_type,) if key_type else (
              paramiko.RSAKey,
              paramiko.DSSKey,
              paramiko.ECDSAKey,
              paramiko.Ed25519Key
          ):
              try:
                  ssh_pkey = pkey_class.from_private_key_file(
                      pkey_file,
                      password=pkey_password
                  )
                  if logger:
                      logger.debug('Private key file ({0}, {1}) successfully '
                                   'loaded'.format(pkey_file, pkey_class))
                  break
              except paramiko.PasswordRequiredException:
                  if logger:
                      logger.error('Password is required for key {0}'
                                   .format(pkey_file))
                  break
              except paramiko.SSHException:
                  if logger:
                      logger.debug('Private key file ({0}) could not be loaded '
                                   'as type {1} or bad password'
                                   .format(pkey_file, pkey_class))
          return ssh_pkey