You can query the system tables directly, but this is a bit tough. A query like this will return all the index records for a given table:
SELECT * FROM X$Index
WHERE Xi$File IN (SELECT Xf$Id FROM X$File WHERE Xf$Name = 'tablename')
However, this will not give you the field names. If you want field names, you have to join in X$Field, and a second JOIN if you want index names, also.
A better solution is to use the system stored procedure, psp_indexes(). A command like this will work for you:
Finally, you can use the system catalog functions, such as dbo.fSQLForeignKeys and dbo.fSQLPrimaryKeys.