MasterKey Class

The MasterKey object represents a SQL Server database master key.

Espace de noms: Microsoft.SqlServer.Management.Smo
Assembly: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Syntaxe

'Déclaration
Public NotInheritable Class MasterKey
    Inherits SqlSmoObject
    Implements IDroppable
public sealed class MasterKey : SqlSmoObject, IDroppable
public ref class MasterKey sealed : public SqlSmoObject, IDroppable
public final class MasterKey extends SqlSmoObject implements IDroppable
public final class MasterKey extends SqlSmoObject implements IDroppable

Notes

Texte mis à jour :

A database master key is used to symmetrically encrypt keys and certificates that are stored in the database. A database master key can be encrypted by using the service master key or by using a user-specified password. When a database master key is created, a password must be supplied to encrypt and decrypt it.

When a database is being attached to an instance of SQL Server, the database administrator must either supply the master key password or make an unencrypted copy of the master key that is available for encryption with the service master key.

The service master key is the lop layer in the encryption hierarchy that is used to encrypt lower layers in the encryption hierarchy. The service master key is generated automatically by Windows. It can be opened only by the Windows service account under which it was created, or by a user who knows both the service account name and its password.

Cet espace de noms, cette classe ou ce membre est pris en charge uniquement par la version 2.0 de Microsoft .NET Framework.

To get MasterKey object properties, users can be a member of the public fixed server role.

To set MasterKey object properties, users must have CONTROL permission on the database or be a member of the db_owner fixed database role.

To create or drop a master key, users must have CONTROL permission on the database or be a member of the db_owner fixed database role.

To open or regenerate a master key, users must have CONTROL permission on the database or be a member of the db_owner fixed database role.

To add or drop service key encryption, users must have CONTROL permission on the database or be a member of the db_owner fixed database role.

To drop a master key, users can be a member of the public fixed server role.

Inheritance Hierarchy

System.Object
   Microsoft.SqlServer.Management.Smo.SmoObjectBase
     Microsoft.SqlServer.Management.Smo.SqlSmoObject
      Microsoft.SqlServer.Management.Smo.MasterKey

Sécurité des threads

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Plateformes

Plateformes de développement

Pour obtenir la liste des plateformes prises en charge, consultez Configuration matérielle et logicielle requise pour l'installation de SQL Server 2005.

Plateformes cibles

Pour obtenir la liste des plateformes prises en charge, consultez Configuration matérielle et logicielle requise pour l'installation de SQL Server 2005.

Voir aussi

Référence

MasterKey Members
Microsoft.SqlServer.Management.Smo Namespace

Autres ressources

Hiérarchie de chiffrement
CREATE MASTER KEY (Transact-SQL)