Skip to content

Commit 9af41dd

Browse files
committed
refactor: rename GetByCoseCurveType method to GetByCoseCurve for consistency
1 parent 3565df7 commit 9af41dd

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Yubico.YubiKey/src/Yubico/YubiKey/Cryptography/KeyDefinitions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public static KeyDefinition GetByKeyType(KeyType type)
9191
/// <exception cref="InvalidOperationException">
9292
/// When the curve type is not supported.
9393
/// </exception>
94-
public static KeyDefinition GetByCoseCurveType(CoseEcCurve curve) =>
94+
public static KeyDefinition GetByCoseCurve(CoseEcCurve curve) =>
9595
_allDefinitions.Values.SingleOrDefault(
9696
d => d.CoseKeyDefinition != null && d.CoseKeyDefinition.CurveIdentifier == curve)
9797
?? throw new InvalidOperationException(

Yubico.YubiKey/src/Yubico/YubiKey/Fido2/Cose/CoseEcPublicKey.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ private CoseEcPublicKey()
152152
/// </exception>
153153
public CoseEcPublicKey(CoseEcCurve curve, ReadOnlyMemory<byte> xCoordinate, ReadOnlyMemory<byte> yCoordinate)
154154
{
155-
var keyDefinition = KeyDefinitions.GetByCoseCurveType(curve) ??
155+
var keyDefinition = KeyDefinitions.GetByCoseCurve(curve) ??
156156
throw new ArgumentException(nameof(curve), "Unknown curve");
157157

158158
var coseDefinition = keyDefinition.CoseKeyDefinition ??
@@ -266,7 +266,7 @@ public CoseEcPublicKey(ECParameters ecParameters)
266266
/// </returns>
267267
public ECParameters ToEcParameters()
268268
{
269-
var definition = KeyDefinitions.GetByCoseCurveType(_curve);
269+
var definition = KeyDefinitions.GetByCoseCurve(_curve);
270270

271271
var ecParams = new ECParameters
272272
{

Yubico.YubiKey/tests/unit/Yubico/YubiKey/Cryptography/KeyDefinitionsTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public void GetByKeyType_InvalidType_ThrowsException()
3030
public void GetByCoseCurveType_ValidCurves_ReturnsCorrectDefinitions()
3131
{
3232
// 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));
3535
}
3636

3737
[Fact]
@@ -41,7 +41,7 @@ public void GetByCoseCurveType_InvalidCurve_ThrowsException()
4141
CoseEcCurve invalidCurve = (CoseEcCurve)999;
4242

4343
// Act & Assert
44-
Assert.Throws<InvalidOperationException>(() => KeyDefinitions.GetByCoseCurveType(invalidCurve));
44+
Assert.Throws<InvalidOperationException>(() => KeyDefinitions.GetByCoseCurve(invalidCurve));
4545
}
4646

4747
[Fact]

0 commit comments

Comments
 (0)