Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit b18dd7d

Browse files
authored
Merge pull request #1976 from srutzky/patch-5
Fix missing / misleading statements, and formatting for BACKUP CERTIFICATE
2 parents f850c87 + 99cfc4b commit b18dd7d

1 file changed

Lines changed: 25 additions & 11 deletions

File tree

docs/t-sql/statements/backup-certificate-transact-sql.md

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "BACKUP CERTIFICATE (Transact-SQL) | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "10/04/2018"
4+
ms.date: "04/23/2019"
55
ms.prod: sql
66
ms.prod_service: "sql-data-warehouse, pdw, sql-database"
77
ms.reviewer: ""
@@ -64,24 +64,34 @@ BACKUP CERTIFICATE certname TO FILE ='path_to_file'
6464
```
6565

6666
## Arguments
67-
*path_to_file*
68-
Specifies the complete path, including file name, of the file in which the certificate is to be saved. This path can be a local path or a UNC path to a network location. The default is the path of the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] DATA folder.
69-
70-
*path_to_private_key_file*
71-
Specifies the complete path, including file name, of the file in which the private key is to be saved. This path can be a local path or a UNC path to a network location. The default is the path of the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] DATA folder.
67+
*certname*
68+
Is the name of the certificate to backup.
69+
70+
TO FILE = '*path_to_file*'
71+
Specifies the complete path, including file name, of the file in which the certificate is to be saved. This path can be a local path or a UNC path to a network location. If only a file name is specified, the file will be saved in the instance's default user data folder (which may or may not be the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] DATA folder). For SQL Server Express LocalDB, the instance's default user data folder is the path specified by the `%USERPROFILE%` environment variable for the account that created the instance.
72+
73+
WITH PRIVATE KEY
74+
Specifies that the private key of the certificate is to be saved to a file. This clause is optional.
75+
76+
FILE = '*path_to_private_key_file*'
77+
Specifies the complete path, including file name, of the file in which the private key is to be saved. This path can be a local path or a UNC path to a network location. If only a file name is specified, the file will be saved in the instance's default user data folder (which may or may not be the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] DATA folder). For SQL Server Express LocalDB, the instance's default user data folder is the path specified by the `%USERPROFILE%` environment variable for the account that created the instance.
7278

73-
*encryption_password*
79+
ENCRYPTION BY PASSWORD = '*encryption_password*'
7480
Is the password that is used to encrypt the private key before writing the key to the backup file. The password is subject to complexity checks.
7581

76-
*decryption_password*
82+
DECRYPTION BY PASSWORD = '*decryption_password*'
7783
Is the password that is used to decrypt the private key before backing up the key. This argument is not necessary if the certificate is encrypted by the master key.
7884

7985
## Remarks
8086
If the private key is encrypted with a password in the database, the decryption password must be specified.
8187

82-
When you back up the private key to a file, encryption is required. The password used to protect the certificate is not the same password that is used to encrypt the private key of the certificate.
83-
84-
To restore a backed up certificate, use the [CREATE CERTIFICATE](../../t-sql/statements/create-certificate-transact-sql.md)statement.
88+
When you back up the private key to a file, encryption is required. The password used to protect the private key in the file is not the same password that is used to encrypt the private key of the certificate in the database.
89+
90+
Private keys are saved in the PVK file format.
91+
92+
To restore a backed up certificate, with or without the private key, use the [CREATE CERTIFICATE](../../t-sql/statements/create-certificate-transact-sql.md) statement.
93+
94+
To restore a private key to an existing certificate in the database, use the [ALTER CERTIFICATE](../../t-sql/statements/alter-certificate-transact-sql.md) statement.
8595

8696
When performing a backup, the files will be ACLd to the service account of the SQL Server instance. If you need to restore the certificate to a server running under a different account, you will need to adjust the permissions on the files so that they are able to be read by the new account.
8797

@@ -123,6 +133,10 @@ GO
123133
[CREATE CERTIFICATE (Transact-SQL)](../../t-sql/statements/create-certificate-transact-sql.md)
124134
[ALTER CERTIFICATE (Transact-SQL)](../../t-sql/statements/alter-certificate-transact-sql.md)
125135
[DROP CERTIFICATE (Transact-SQL)](../../t-sql/statements/drop-certificate-transact-sql.md)
136+
[CERTENCODED (Transact-SQL)](../../t-sql/functions/certencoded-transact-sql.md)
137+
[CERTPRIVATEKEY (Transact-SQL)](../../t-sql/functions/certprivatekey-transact-sql.md)
138+
[CERT_ID (Transact-SQL)](../../t-sql/functions/cert-id-transact-sql.md)
139+
[CERTPROPERTY (Transact-SQL)](../../t-sql/functions/certproperty-transact-sql.md)
126140

127141

128142

0 commit comments

Comments
 (0)