Skip to content

Commit 8ac0aa3

Browse files
authored
Merge pull request #44 from jimsch/master
Change algorithm name
2 parents 63c0857 + 3609a07 commit 8ac0aa3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/COSE/ECPublicKey.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public ECPublicKey(OneKey oneKey) throws CoseException
4141
point = new ECPoint(new BigInteger(1, oneKey.get(KeyKeys.EC2_X).GetByteString()), new BigInteger(1, oneKey.get(KeyKeys.EC2_Y).GetByteString()));
4242
}
4343

44+
/*
4445
switch (AlgorithmID.FromCBOR(oneKey.get(KeyKeys.Algorithm))) {
4546
case ECDH_ES_HKDF_256:
4647
case ECDH_ES_HKDF_512:
@@ -70,6 +71,10 @@ public ECPublicKey(OneKey oneKey) throws CoseException
7071
default:
7172
throw new CoseException("No algorithm specified");
7273
}
74+
*/
75+
algorithm = "EC"; // This seems wrong to me asit returns the KeyFactory name and
76+
// there is no distinction between ECDH and ECDSA while there
77+
// is for DSA vs DiffieHellman.
7378

7479
ECField field = new ECFieldFp(p.getCurve().getField().getCharacteristic());
7580
EllipticCurve crv = new EllipticCurve(field, p.getCurve().getA().toBigInteger(), p.getCurve().getB().toBigInteger());

0 commit comments

Comments
 (0)