@@ -201,20 +201,8 @@ public EcdsaVerify(CoseKey coseKey)
201
201
xCoordinate = ecKey . XCoordinate . ToArray ( ) ;
202
202
yCoordinate = ecKey . YCoordinate . ToArray ( ) ;
203
203
}
204
-
205
- ECDsa = ConvertPublicKey ( oid , xCoordinate , yCoordinate ) ;
206
- }
207
204
208
- private static string GetOidByAlgorithm ( CoseAlgorithmIdentifier algorithm )
209
- {
210
- return algorithm switch
211
- {
212
- CoseAlgorithmIdentifier . ES256 => KeyDefinitions . KeyOids . P256 ,
213
- CoseAlgorithmIdentifier . ECDHwHKDF256 => KeyDefinitions . KeyOids . P256 ,
214
- CoseAlgorithmIdentifier . ES384 => KeyDefinitions . KeyOids . P384 ,
215
- CoseAlgorithmIdentifier . ES512 => KeyDefinitions . KeyOids . P521 ,
216
- _ => "" ,
217
- } ;
205
+ ECDsa = ConvertPublicKey ( oid , xCoordinate , yCoordinate ) ;
218
206
}
219
207
220
208
/// <summary>
@@ -404,7 +392,7 @@ private static ECDsa CheckECDsa(ECDsa toCheck)
404
392
if ( ecParameters . Q . X . Length == 0 ||
405
393
ecParameters . Q . X . Length > coordinateLength ||
406
394
ecParameters . Q . Y . Length == 0 ||
407
- ecParameters . Q . Y . Length > coordinateLength )
395
+ ecParameters . Q . Y . Length > coordinateLength )
408
396
{
409
397
throw new ArgumentException ( ExceptionMessages . UnsupportedAlgorithm ) ;
410
398
}
@@ -466,6 +454,18 @@ private static bool TryCopyNextInteger(TlvReader tlvReader, Memory<byte> signatu
466
454
return false ;
467
455
}
468
456
457
+ private static string GetOidByAlgorithm ( CoseAlgorithmIdentifier algorithm )
458
+ {
459
+ return algorithm switch
460
+ {
461
+ CoseAlgorithmIdentifier . ES256 => KeyDefinitions . KeyOids . P256 ,
462
+ CoseAlgorithmIdentifier . ECDHwHKDF256 => KeyDefinitions . KeyOids . P256 ,
463
+ CoseAlgorithmIdentifier . ES384 => KeyDefinitions . KeyOids . P384 ,
464
+ CoseAlgorithmIdentifier . ES512 => KeyDefinitions . KeyOids . P521 ,
465
+ _ => "" ,
466
+ } ;
467
+ }
468
+
469
469
/// <summary>
470
470
/// Clean up
471
471
/// </summary>
0 commit comments