Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 17 » SQL Anywhere Server - SQL Reference » SQL statements » Alphabetical list of SQL statements

CREATE CERTIFICATE statement

Adds or replaces a certificate in the database from the given file or string. To create a certificate, use the Certificate Creation utility (createcert).

Syntax
CREATE [ OR REPLACE ] CERTIFICATE certificate-name
FROM { certificate-string | variable-name | FILE file-name }
Parameters
  • FROM clause

    This clause specifies a file, string, or variable containing a certificate.

Remarks

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.

Privileges

You must have the MANAGE CERTIFICATES system privilege.

Side effects

Automatic commit.

Standards
  • ANSI/ISO SQL Standard

    Not in the standard.

Example

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';