File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
tests/unit/Yubico/YubiKey/Cryptography Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ public static KeyDefinition GetByKeyType(KeyType type)
91
91
/// <exception cref="InvalidOperationException">
92
92
/// When the curve type is not supported.
93
93
/// </exception>
94
- public static KeyDefinition GetByCoseCurveType ( CoseEcCurve curve ) =>
94
+ public static KeyDefinition GetByCoseCurve ( CoseEcCurve curve ) =>
95
95
_allDefinitions . Values . SingleOrDefault (
96
96
d => d . CoseKeyDefinition != null && d . CoseKeyDefinition . CurveIdentifier == curve )
97
97
?? throw new InvalidOperationException (
Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ private CoseEcPublicKey()
152
152
/// </exception>
153
153
public CoseEcPublicKey ( CoseEcCurve curve , ReadOnlyMemory < byte > xCoordinate , ReadOnlyMemory < byte > yCoordinate )
154
154
{
155
- var keyDefinition = KeyDefinitions . GetByCoseCurveType ( curve ) ??
155
+ var keyDefinition = KeyDefinitions . GetByCoseCurve ( curve ) ??
156
156
throw new ArgumentException ( nameof ( curve ) , "Unknown curve" ) ;
157
157
158
158
var coseDefinition = keyDefinition . CoseKeyDefinition ??
@@ -266,7 +266,7 @@ public CoseEcPublicKey(ECParameters ecParameters)
266
266
/// </returns>
267
267
public ECParameters ToEcParameters ( )
268
268
{
269
- var definition = KeyDefinitions . GetByCoseCurveType ( _curve ) ;
269
+ var definition = KeyDefinitions . GetByCoseCurve ( _curve ) ;
270
270
271
271
var ecParams = new ECParameters
272
272
{
Original file line number Diff line number Diff line change @@ -30,8 +30,8 @@ public void GetByKeyType_InvalidType_ThrowsException()
30
30
public void GetByCoseCurveType_ValidCurves_ReturnsCorrectDefinitions ( )
31
31
{
32
32
// Act & Assert
33
- Assert . Equal ( KeyDefinitions . P256 , KeyDefinitions . GetByCoseCurveType ( CoseEcCurve . P256 ) ) ;
34
- Assert . Equal ( KeyDefinitions . Ed25519 , KeyDefinitions . GetByCoseCurveType ( CoseEcCurve . Ed25519 ) ) ;
33
+ Assert . Equal ( KeyDefinitions . P256 , KeyDefinitions . GetByCoseCurve ( CoseEcCurve . P256 ) ) ;
34
+ Assert . Equal ( KeyDefinitions . Ed25519 , KeyDefinitions . GetByCoseCurve ( CoseEcCurve . Ed25519 ) ) ;
35
35
}
36
36
37
37
[ Fact ]
@@ -41,7 +41,7 @@ public void GetByCoseCurveType_InvalidCurve_ThrowsException()
41
41
CoseEcCurve invalidCurve = ( CoseEcCurve ) 999 ;
42
42
43
43
// Act & Assert
44
- Assert . Throws < InvalidOperationException > ( ( ) => KeyDefinitions . GetByCoseCurveType ( invalidCurve ) ) ;
44
+ Assert . Throws < InvalidOperationException > ( ( ) => KeyDefinitions . GetByCoseCurve ( invalidCurve ) ) ;
45
45
}
46
46
47
47
[ Fact ]
You can’t perform that action at this time.
0 commit comments