code: protected Object readObject(BufferedReader in, byte[] password) throws IOException, GeneralSecurityException
      {
          String line;
          Object obj = null;
  
          while ((line = in.readLine()) != null) {
              obj = processObject(in, line, password);
              if (obj != null) {
                  break;
              }
          }
  
          return obj;
      }
docs: Read an object from a PEM like file.
  
  @param in the input reader to read from.
  @param password a password to decrypt encrypted objects. May be null if the object is not encrypted.
  @return the object read.
  @throws IOException on I/O error.
  @throws GeneralSecurityException on decryption error.