EncryptByCert Problem
- From: "Mike C#" <xyz@xxxxxxx>
- Date: Thu, 24 Aug 2006 01:01:54 -0400
I posted this message to the wrong group (sqlserver.programming), so I'm
reposting here. Sorry for the repost... it's late... so here goes:
OK, so I'm testing EncryptByCert with some code like the following:
DECLARE @v varchar(8000);
SELECT @v = REPLICATE('A', 117);
SELECT @v;
DECLARE @e varbinary(8000);
SELECT @e = EncryptByCert(Cert_ID(N'TestCertificate'), @v);
SELECT @e;
The function encrypts fine and I'm able to use DecryptByCert to get the
result. Problem is if I change the line SELECT @v = REPLICATE('A', 117) to:
SELECT @v = REPLICATE('A', 118);
The EncryptByCert function returns NULL every time with 118 or higher. BOL
states that the result is returned as a varbinary with a max length of
8,000. I keep getting a varbinary with a max length of 128. Can anyone
else reproduce this, or am I doing something wrong?
Thanks
.
- Follow-Ups:
- Re: EncryptByCert Problem
- From: Laurentiu Cristofor [MSFT]
- Re: EncryptByCert Problem
- Prev by Date: Re: Cannot generate SSPI Context
- Next by Date: Re: "Access denied" with xp_cmdshell (!)
- Previous by thread: Re: Cannot generate SSPI Context
- Next by thread: Re: EncryptByCert Problem
- Index(es):