private void init(File publicKeyFile)
      throws OpenShiftException, FileNotFoundException, IOException {
    String keyWithIdAndComment = StreamUtils.readToString(new FileReader(publicKeyFile));
    Matcher matcher = PUBLICKEY_PATTERN.matcher(keyWithIdAndComment);
    if (!matcher.find() || matcher.groupCount() < 1) {
      throw new OpenShiftException(
          "Could not load public key from file \"{0}\": unknown key format.",
          publicKeyFile.getAbsolutePath());
    }

    setKeyType(matcher.group(1));
    this.publicKey = matcher.group(2);
  }