Support 'FROM BINARY' in CREATE CERTIFICATE
Support 'FROM BINARY' in CREATE CERTIFICATE
Since SQL Server 2012 there is an option to specify an ASN-encoded binary certificate when doing ‘CREATE CERTIFICATE’. Alongside CERTENCODED() and CERTPRIVATEKEY() this makes for a good way to transfer certificates generated on SQL server to other stages.
Your formatting engine however does not recognize the BINARY-parameter of said statement. Please include it as valid syntax.
Examples (non-working because the certifcates are fake – but you are free to generate your own; note that passwords are optional):
CREATE CERTIFICATE [TestCert] AUTHORIZATION [dbo]
FROM BINARY = 0x42
WITH PRIVATE KEY ( BINARY = 0x42, DECRYPTION BY PASSWORD='', ENCRYPTION BY PASSWORD='' )
ACTIVE FOR BEGIN_DIALOG = ON;
GO
CREATE CERTIFICATE [TestCert] AUTHORIZATION [dbo]
FROM BINARY = 0x42
ACTIVE FOR BEGIN_DIALOG = ON;
GO