mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8225745: NoSuchAlgorithmException exception for SHA256withECDSA with RSASSA-PSS support
Fixed SignatureUtil and ECDSA signature impl to handle EC parameters Reviewed-by: weijun
This commit is contained in:
parent
27c77d3d29
commit
175faeeadf
5 changed files with 189 additions and 33 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -32,7 +32,7 @@ import java.security.interfaces.*;
|
|||
import java.security.spec.*;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class ECUtil {
|
||||
public final class ECUtil {
|
||||
|
||||
// Used by SunPKCS11 and SunJSSE.
|
||||
public static ECPoint decodePoint(byte[] data, EllipticCurve curve)
|
||||
|
@ -220,6 +220,21 @@ public class ECUtil {
|
|||
return nameSpec.getName();
|
||||
}
|
||||
|
||||
public static boolean equals(ECParameterSpec spec1, ECParameterSpec spec2) {
|
||||
if (spec1 == spec2) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (spec1 == null || spec2 == null) {
|
||||
return false;
|
||||
}
|
||||
return (spec1.getCofactor() == spec2.getCofactor() &&
|
||||
spec1.getOrder().equals(spec2.getOrder()) &&
|
||||
spec1.getCurve().equals(spec2.getCurve()) &&
|
||||
spec1.getGenerator().equals(spec2.getGenerator()));
|
||||
}
|
||||
|
||||
|
||||
// Convert the concatenation R and S in into their DER encoding
|
||||
public static byte[] encodeSignature(byte[] signature) throws SignatureException {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue