File tree 3 files changed +17
-1
lines changed
System.Security.Cryptography.Pkcs/src/Internal/Cryptography
System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -364,11 +364,16 @@ public static string ToSerialString(this byte[] serialBytes)
364
364
return ToUpperHexString ( serialBytes ) ;
365
365
}
366
366
367
- #if NETCOREAPP || NETSTANDARD2_1
367
+ #if NET5_0_OR_GREATER
368
368
private static string ToUpperHexString ( ReadOnlySpan < byte > ba )
369
369
{
370
370
return Convert . ToHexString ( ba ) ;
371
371
}
372
+ #elif NETCOREAPP || NETSTANDARD2_1
373
+ private static string ToUpperHexString ( ReadOnlySpan < byte > ba )
374
+ {
375
+ return HexConverter . ToString ( ba , HexConverter . Casing . Upper ) ;
376
+ }
372
377
#else
373
378
private static string ToUpperHexString ( ReadOnlySpan < byte > ba )
374
379
{
Original file line number Diff line number Diff line change @@ -197,7 +197,11 @@ private static string FormatBytes(byte[]? bytes)
197
197
if ( bytes == null )
198
198
return NullString ;
199
199
200
+ #if NET9_0_OR_GREATER
200
201
return Convert . ToHexStringLower ( bytes ) ;
202
+ #else
203
+ return HexConverter . ToString ( bytes , HexConverter . Casing . Lower ) ;
204
+ #endif
201
205
}
202
206
203
207
/// <summary>
Original file line number Diff line number Diff line change @@ -720,10 +720,17 @@ internal static X509Certificate2Collection BuildBagOfCerts(KeyInfoX509Data keyIn
720
720
return collection ;
721
721
}
722
722
723
+ #if NET5_0_OR_GREATER
723
724
internal static string EncodeHexString ( byte [ ] sArray )
724
725
{
725
726
return Convert . ToHexString ( sArray ) ;
726
727
}
728
+ #else
729
+ internal static string EncodeHexString ( byte [ ] sArray )
730
+ {
731
+ return HexConverter . ToString ( sArray ) ;
732
+ }
733
+ #endif
727
734
728
735
internal static byte [ ] DecodeHexString ( string s )
729
736
{
You can’t perform that action at this time.
0 commit comments