Listing 5: Using Dynamic Management Views and Functions to Obtain EKM Information
-- List all providers currently being used
--Value of 1 will list all connections
--Value of 0 will list only the current session
SELECT * FROM sys.dm_cryptographic_provider_sessions(1)
-- List all EKM providers installed on your server
SELECT * FROM sys.cryptographic_providers
-- Determine which credentials use EKM
SELECT * FROM sys.credentials
WHERE target_type = 'CRYPTOGRAPHIC PROVIDER'
OR
target_id <> 0
-- List all keys for each given provider ID
--This catalog view is not fully functional
-- in CTP5 or earlier
SELECT * FROM dm_cryptographic_provider_keys (1)
-- View provider information
-- This catalog view is not fully functional
-- in CTP5 or earlier
SELECT * FROM sys.dm_provider_properties
-- List all encryption algorithms for each
-- given provider ID
-- This catalog view is not fully functional
-- in CTP5 or earlier
SELECT * FROM sys.dm_provider_algorithms (1)