Share via


SymmetricKey.Create Method (SymmetricKeyEncryption, SymmetricKeyEncryptionAlgorithm, String, String)

Creates a symmetric key on the database with the specified encryption type and method.

Namespace:  Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)

Syntax

'Declaration
Public Sub Create ( _
    keyEncryption As SymmetricKeyEncryption, _
    keyEncryptionAlgorithm As SymmetricKeyEncryptionAlgorithm, _
    passPhrase As String, _
    identityPhrase As String _
)
'Usage
Dim instance As SymmetricKey
Dim keyEncryption As SymmetricKeyEncryption
Dim keyEncryptionAlgorithm As SymmetricKeyEncryptionAlgorithm
Dim passPhrase As String
Dim identityPhrase As String

instance.Create(keyEncryption, keyEncryptionAlgorithm, _
    passPhrase, identityPhrase)
public void Create(
    SymmetricKeyEncryption keyEncryption,
    SymmetricKeyEncryptionAlgorithm keyEncryptionAlgorithm,
    string passPhrase,
    string identityPhrase
)
public:
void Create(
    SymmetricKeyEncryption^ keyEncryption, 
    SymmetricKeyEncryptionAlgorithm keyEncryptionAlgorithm, 
    String^ passPhrase, 
    String^ identityPhrase
)
member Create : 
        keyEncryption:SymmetricKeyEncryption * 
        keyEncryptionAlgorithm:SymmetricKeyEncryptionAlgorithm * 
        passPhrase:string * 
        identityPhrase:string -> unit 
public function Create(
    keyEncryption : SymmetricKeyEncryption, 
    keyEncryptionAlgorithm : SymmetricKeyEncryptionAlgorithm, 
    passPhrase : String, 
    identityPhrase : String
)

Parameters

  • passPhrase
    Type: System.String
    A String value that specifies the pass phrase from which the symmetric key can be derived.
  • identityPhrase
    Type: System.String
    A String value that specifies the identity phrase used to tag data that is encrypted with the key. Either passPhrase or identityPhrase can be null, but at least one needs to be set.

Examples

Using Encryption