This function creates a X.509v3 certificate from a public key and sign the certificate with CA private key
This function can generate the following errors:
The example bellow decode a public key sent from client and then issue a certificate and sign it with CA's key 'id_rsa'. The client's key is create as temp key.
declare kname, cvalue varchar; kname := xenc_SPKI_read (null, replace (get_keyword ('key', params), '\r\n', '')); xenc_x509_generate ('id_rsa', kname, sequence_next ('ca_id_rsa'), 365, vector ( 'CN', get_keyword ('name', params, name), 'C', get_keyword ('c', params, name), 'O', get_keyword ('o', params, name), 'OU', get_keyword ('ou', params, name), 'emailAddress', get_keyword ('email', params) ), vector ('subjectAltName', 'URI:'||webid, 'nsComment', 'Virtuoso Generated Certificate', 'authorityKeyIdentifier', 'keyid,issuer:always'));