Share via


IS_OBJECTSIGNED (Transact-SQL)

オブジェクトが、指定した証明書または非対称キーで署名されているかどうかを示します。

トピック リンク アイコンTransact-SQL 構文表記規則

構文

IS_OBJECTSIGNED ( 
'OBJECT', @object_id, @class, @thumbprint
    ) 

引数

  • 'OBJECT'
    セキュリティ保護可能なクラスの型。

  • @object\_id
    テストされるオブジェクトの object_id。@object_id のデータ型は int です。

  • @class
    オブジェクトのクラス :

    • 'certificate'

    • 'asymmetric key'

    @class のデータ型は sysname です。

  • @thumbprint
    オブジェクトの SHA 拇印。@thumbprint のデータ型は varbinary(32) です。

戻り値の型

int

説明

IS_OBJECTSIGNED は、次の値を返します。

戻り値

説明

0

オブジェクトは署名されていません。

1

オブジェクトは署名されています。

NULL

オブジェクトが無効です。

権限

証明書または非対称キーに対する VIEW DEFINITION 権限が必要です。

A. データベースの拡張プロパティを表示する

次の例では、master データベースの spt_fallback_db テーブルがスキーマ署名証明書によって署名されているかどうかをテストします。

USE master
-- Declare a variable to hold a thumbprint and an object name
DECLARE @thumbprint varbinary(20), @objectname sysname;

-- Populate the thumbprint variable with the thumbprint of 
-- the master database schema signing certificate
SELECT @thumbprint = thumbprint 
FROM sys.certificates 
WHERE name LIKE '%SchemaSigningCertificate%';

-- Populate the object name variable with a table name in master
SELECT @objectname = 'spt_fallback_db';

-- Query to see if the table is signed by the thumbprint
SELECT @objectname AS [object name],
IS_OBJECTSIGNED(
'OBJECT', OBJECT_ID(@objectname), 'certificate', @thumbprint
) AS [Is the object signed?] ;