fix algorithm id for ECDSA auth keys on security keys
This commit is contained in:
parent
48f0bdcf75
commit
fb0651eda1
1 changed files with 3 additions and 3 deletions
|
@ -42,10 +42,10 @@ public class SecurityTokenUtils {
|
|||
byte[] oid = new ASN1ObjectIdentifier(secretKey.getCurveOid()).getEncoded();
|
||||
byte[] attrs = new byte[1 + (oid.length - 2) + 1];
|
||||
|
||||
if (slot.equals(KeyType.SIGN))
|
||||
attrs[0] = ECKeyFormat.ECAlgorithmFormat.ECDSA_WITH_PUBKEY.getAlgorithmId();
|
||||
else {
|
||||
if (slot.equals(KeyType.ENCRYPT))
|
||||
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));
|
||||
|
|
Loading…
Reference in a new issue