Adds or replaces a certificate in the database from the given file or string. To create a certificate, use the Certificate Creation utility (createcert).
CREATE [ OR REPLACE ] CERTIFICATE certificate-name FROM { certificate-string | variable-name | FILE file-name }
This clause specifies a file, string, or variable containing a certificate.
The CREATE CERTIFICATE statement adds or replaces a certificate in the database from the given file, string, or variable. The file, string, or variable should contain either a binary DER-format certificate or a text PEM-format certificate. DER-format certificates are converted and stored as PEM certificates.
Certificates that are stored in the database can be used by web service procedures and functions that make secure HTTPS connections to a web server. They can also be used to send secure messages using the xp_startsmtp system procedure.
When you add a certificate, it is added to the ISYSCERTIFICATE system table. Use the corresponding system view SYSCERTIFICATE to view the table.
The CREATE CERTIFICATE statement is not used to create an actual certificate. Use the Certificate Creation utility (createcert) to do this.
You must have the MANAGE CERTIFICATES system privilege.
Automatic commit.
Not in the standard.
The following example creates a certificate called mycert in the database using the contents of the specified certificate file.
CREATE CERTIFICATE mycert
FROM FILE 'C:\\Users\\Public\\Documents\\SQL Anywhere
17\\Samples\\Certificates\\rsaroot.crt';