code: private byte[] getEncryptedKey(final String fileName,
                                   final int keyNum) throws PKIException {
      byte[] keys = getKeys(fileName);
  
      int foundKeys = 0;
      int keyStart = 0;
      for (int i = 0; i <keys.length; i++) {
        if (keys[i] != '\n') {
          continue;
        }
  
        if (keyNum != foundKeys) {
          keyStart = i + 1;
          foundKeys++;
          continue;
        }
  
        // At end of our key
  
        int keyLen = i - keyStart;
        byte[] key = new byte[keyLen];
        System.arraycopy(keys, keyStart, key, 0, keyLen);
  
        return key;
      }
  
      throw new PKIException("Invalid key number");
    }
docs: /* *************************************************************************
  Private methods
  ************************************************************************