@@ -20,7 +20,7 @@ public static class CertificateFileStore
20
20
/// <param name="cert">A certificate to save.</param>
21
21
/// <param name="path">
22
22
/// The path to the destination file. The file extension is important and defines the format
23
- /// of the encoding (currently we support only PKCS12 (.pfx) and PEM (.pem) formats). If it's PEM
23
+ /// of the encoding (currently we support only PKCS12 (.pfx) and PEM (.pem, .cer ) formats). If it's PEM
24
24
/// a new file will be created next to the certificate file with a .key extension.
25
25
/// </param>
26
26
/// <param name="chain">
@@ -126,7 +126,7 @@ private static void SavePemCertificate(CertificateChainWithPrivateKey certChainW
126
126
/// </summary>
127
127
/// <param name="path">
128
128
/// A path to the certificate file. The format of the encoding is guessed from
129
- /// the file extension. Only PKCS12 (.pfx) and PEM (.pem) formats are recognized.
129
+ /// the file extension. Only PKCS12 (.pfx) and PEM (.pem, .cer ) formats are recognized.
130
130
/// </param>
131
131
/// <returns>The certificate representation.</returns>
132
132
public static CertificateChainWithPrivateKey LoadCertificate ( string path )
@@ -138,6 +138,7 @@ public static CertificateChainWithPrivateKey LoadCertificate(string path)
138
138
139
139
return Path . GetExtension ( path ) switch {
140
140
var s when string . IsNullOrEmpty ( s ) || string . Equals ( ".pem" , s , StringComparison . OrdinalIgnoreCase )
141
+ || string . Equals ( ".cer" , s , StringComparison . OrdinalIgnoreCase )
141
142
=> LoadPemCertificate ( path ) ,
142
143
var s when string . Equals ( ".pfx" , s , StringComparison . OrdinalIgnoreCase ) => LoadPfxCertificate ( path ) ,
143
144
var s => throw new ArgumentException (
0 commit comments