use AdventureWorks;
go
backup certificate myCert_19 to file='d:\myCert_19.cer'
with private key(decryption by password='123456',file='d:\myCert_pvt',encryption by password='654321')
7.在AdventureWorks中创建表table_学号(a int identity(1,1),b varbinary(max)),然后向table_学号插入记录,插入记录时对b字段的内容采用4题创建的证书进行加密。然后使用查询语句分别查询加密前和使用解密函数对b字段解密后的数据
create table table_19
(a int identity(1,1),b varbinary(max))
insert into table_19 (a,b) values(EncryptByCert(Cert_ID('myCert_19 '),C123))