fix algorithm id for ECDSA auth keys on security keys
This commit is contained in:
parent
48f0bdcf75
commit
fb0651eda1
|
@ -42,10 +42,10 @@ public class SecurityTokenUtils {
|
||||||
byte[] oid = new ASN1ObjectIdentifier(secretKey.getCurveOid()).getEncoded();
|
byte[] oid = new ASN1ObjectIdentifier(secretKey.getCurveOid()).getEncoded();
|
||||||
byte[] attrs = new byte[1 + (oid.length - 2) + 1];
|
byte[] attrs = new byte[1 + (oid.length - 2) + 1];
|
||||||
|
|
||||||
if (slot.equals(KeyType.SIGN))
|
if (slot.equals(KeyType.ENCRYPT))
|
||||||
attrs[0] = ECKeyFormat.ECAlgorithmFormat.ECDSA_WITH_PUBKEY.getAlgorithmId();
|
|
||||||
else {
|
|
||||||
attrs[0] = ECKeyFormat.ECAlgorithmFormat.ECDH_WITH_PUBKEY.getAlgorithmId();
|
attrs[0] = ECKeyFormat.ECAlgorithmFormat.ECDH_WITH_PUBKEY.getAlgorithmId();
|
||||||
|
else { // SIGN and AUTH is ECDSA
|
||||||
|
attrs[0] = ECKeyFormat.ECAlgorithmFormat.ECDSA_WITH_PUBKEY.getAlgorithmId();
|
||||||
}
|
}
|
||||||
|
|
||||||
System.arraycopy(oid, 2, attrs, 1, (oid.length - 2));
|
System.arraycopy(oid, 2, attrs, 1, (oid.length - 2));
|
||||||
|
|
Loading…
Reference in New Issue