user2335: While looking through the options of the cardano-cli transaction build options I saw the options,
  --certificate-file CERTIFICATEFILE
                           Filepath of the certificate. This encompasses all
                           types of certificates (stake pool certificates, stake
                           key certificates etc). Optionally specify a script
                           witness.
  --certificate-script-file FILE
                           The file containing the script to witness the use of
                           the certificate.
  --certificate-redeemer-cbor-file CBOR FILE
                           The script redeemer, in the given JSON file. The file
                           must follow the special JSON schema for script data.
  --certificate-redeemer-file JSON FILE
                           The script redeemer, in the given JSON file. The file
                           must follow the special JSON schema for script data.
  --certificate-redeemer-value JSON VALUE
                           The script redeemer, in JSON syntax. There is no
                           schema: (almost) any JSON value is supported,
                           including top-level strings and numbers

I was wondering how and what type of scripts are allowed for these certificates? Can we also generate our own type of certificates with plutus? As stated after the --certificate-file flag these entail atleast stake pool certificates and stake key certificates. This would be a good lightweight option for on-chain voting.

user2335: I looked at the constructors in the Haddock files of the Certificates in the Plutus.V1.Ledger module. There the datatype DCert is defined as

I am not sure but answering my own question, currently only the above certificates are possible. It is still not clear to me what the --certificate-script-file flag does exactly.

2335: <p>While looking through the options of the <code>cardano-cli transaction build</code> options I saw the options,</p>
<pre><code>  --certificate-file CERTIFICATEFILE
                           Filepath of the certificate. This encompasses all
                           types of certificates (stake pool certificates, stake
                           key certificates etc). Optionally specify a script
                           witness.
  --certificate-script-file FILE
                           The file containing the script to witness the use of
                           the certificate.
  --certificate-redeemer-cbor-file CBOR FILE
                           The script redeemer, in the given JSON file. The file
                           must follow the special JSON schema for script data.
  --certificate-redeemer-file JSON FILE
                           The script redeemer, in the given JSON file. The file
                           must follow the special JSON schema for script data.
  --certificate-redeemer-value JSON VALUE
                           The script redeemer, in JSON syntax. There is no
                           schema: (almost) any JSON value is supported,
                           including top-level strings and numbers
</code></pre>
<p>I was wondering how and what type of scripts are allowed for these certificates? Can we also generate our own type of certificates with plutus? As stated after the <code>--certificate-file</code> flag these entail atleast stake pool certificates and stake key certificates. This would be a good lightweight option for on-chain voting.</p>
 2335: <p>I looked at the constructors in the Haddock files of the Certificates in the <code>Plutus.V1.Ledger</code> module. There the datatype <code>DCert</code> is defined as</p>
<p><a href="https://i.stack.imgur.com/HaHPq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HaHPq.png" alt="enter image description here" /></a></p>
<p>I am not sure but answering my own question, currently only the above certificates are possible. It is still not clear to me what the <code>--certificate-script-file</code> flag does exactly.</p>
