Create a certificate with a private key Reading this answer I have a question about it:

How can I create a certificate with a private key in my app database?
CREATE CERTIFICATE, see the first example Creating a self-signed certificate:

use &lt;mydb&gt;;
go

CREATE CERTIFICATE Shipping04 
   ENCRYPTION BY PASSWORD = 'mysecretpassword'
   WITH SUBJECT = 'Used to signed procedure usp_foo', 
   EXPIRY_DATE = '20181231';
GO


When you sign with it you need to specify again the password:

ADD SIGNATURE TO [usp_foo]
  BY CERTIFICATE &lt;certname&gt; WITH PASSWORD 'mysecretpassword';


See Signing an activated procedure for an example.