Get the certificate in the given slot.
public X509Certificate2 GetCertificate(byte slotNumber)
The slot containing the requested cert.
The cert residing in the slot specified.
The slot specified is not valid for getting a certificate.
The slot did not contain a cert, or the YubiKey had some other error, such as unreliable connection.
After obtaining a cert, you can install it into the slot containing the associated private key (ImportCertificate(Byte, X509Certificate2)). Later on, when you need the cert (e.g. to send it along with a signed message), call this method to retrieve it.
It is not necessary to authenticate the management key nor verify the PIN in order to obtain a certificate.
slotNumber given is for a slot that does not hold
asymmetric keys, or if there is no cert in the slot, this method will
throw an exception.
If you want to get the attestation cert, do not use this method, call
GetAttestationCertificate(). If you call this method with
PivSlot.Attestation) it will throw an