SignByCert and maximum sign size

I have the following table

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

      

sysname in SQL Server 2005/2008 is the same size as nvarchar (128), which I assume is 256 bytes.

I am using the SignByCert (..., email, ...) function to create a signature for the "email" column.

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

0


a source to share


1 answer


Found.

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

If the size is 2048 bits, then the size of the signature will be 256 bytes. If the size is 1024-bits, then the signature size will be 128-bytes.



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

Private keys generated by SQL Server 1024 bit long

so my max size for a sign column is 128 bytes.

+2


a source







All Articles