How to use stored certificate in Jenkins declarative pipeline? I have a stored certificate in Jenkins, and I need to use it in a pipelinebuild job, but the problem is it appears the Pipeline can't use certificates:

trying to use:

    environment {
        KEY = credentials('mycert')
    }


results in:

ERROR: No suitable binding handler could be found for type com.cloudbees.plugins.credentials.impl.CertificateCredentialsImpl. Supported types are StandardUsernamePasswordCredentials,FileCredentials,StringCredentials,SSHUserPrivateKey.


How do I get around this and use that stored cert in a pipeline? There has to be a way otherwise why would storing certs as credentials even be possible.. would be useless to store something without ever being able to use it.
I usually set the credential NAME into an environment variable

environment {
    CERT = 'mycert'
}


Then I can use that name where ever I need it

withCredentials([usernamePassword(credentialsId: "${env.CERT}",
                                  passwordVariable: 'CERT_PASSWORD',
                                  usernameVariable: 'CERT_USER')]) {
    // Do things needing environment variables
}


or

checkout(poll: false,
         scm: [
               $class: 'GitSCM',
               userRemoteConfigs: [[credentialsId: "${env.CERT}", 
                                   url: 'https://code.example.org/somerepo']]
               ])