views:

32

answers:

1

I have following table

CREATE TABLE User (
    email sysname NOT NULL,
    sign varbinary(256) NULL
);

sysname in SQL Server 2005/2008 has the same size as nvarchar(128) - which I'm assuming is 256 bytes.

I'm using SignByCert(..., email, ...) function to produce a signature of 'email' column.

Can I make any assumptions about the max size of [sign] column ?

+1  A: 

Found it.

According to the book "Accelerated SQL Server 2008" page 160 - the size of the siganture depends on the size of the private key in certificate.

If size is 2048-bit then signature size will be 256-byte. If size is 1024-bit then signature size will be 128-byte.

In my case I was creating certificates using CREATE CERTIFICATE TSQL statement and - according to SQL Server Books Online:

Private keys generated by SQL Server are 1024 bits long

so my max size for sign column is 128 bytes.

SeeR