You can get error when importing wildcard certificate or certificate from Public certification Authority.
Import-ExchangeCertificate : The source data is corrupted or not properly Base64 encoded.
At line:1 char:27
+ Import-ExchangeCertificate <<<< -Path “C:\cert\certs\www.mydomain.crt.csr”
+ CategoryInfo : ReadError: (:) [Import-ExchangeCertificate], InvalidOperationException
+ FullyQualifiedErrorId : 76D5CB03,Microsoft.Exchange.Management.SystemConfigurationTasks.ImportExchangeCertificate
This is happening because the certificate is missing private key.
Import the certificate in Personal store and export it in cer format form mmc. Delete the certificate from mmc.
In Exchange Power shell run :
Import-ExchangeCertificate -FileData ([Byte]$(Get-Content -Path “<Path of the certificate>.cer” -Encoding Byte -ReadCount 0))
This imports the certificate in mmc but it will not be visible in ECP or IIS.
Certutil -repairstore my “xx xx xx 02 03 1b c9 fd c5 40 xx a6 55 0a 91 xx”
Where “xx xx xx 02 03 1b c9 fd c5 40 xx a6 55 0a 91 xx” is the Serial number of the newly certificate.
Now the certificate will be visible in ECP and IIS and you can assign services to it.