How to use stored certificate in Jenkins declarative pipeline?
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']]
               ])