mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
fix bug
This commit is contained in:
parent
8c0fb77421
commit
1bca825fff
@ -32,6 +32,13 @@ public class CoordinateUtilTest {
|
||||
Assert.assertEquals(39.922698713521726D, coordinate.getLat(), 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void wgs84toBd09Test2(){
|
||||
final CoordinateUtil.Coordinate coordinate = CoordinateUtil.wgs84ToBd09(122.99395597, 44.99804071);
|
||||
Assert.assertEquals(123.00636516028885D, coordinate.getLng(), 0);
|
||||
Assert.assertEquals(45.00636909189589D, coordinate.getLat(), 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void bd09toWgs84Test(){
|
||||
final CoordinateUtil.Coordinate coordinate = CoordinateUtil.bd09toWgs84(116.404, 39.915);
|
||||
|
@ -244,6 +244,9 @@ public class ECKeyUtil {
|
||||
* @return ECPrivateKeyParameters
|
||||
*/
|
||||
public static ECPrivateKeyParameters toPrivateParams(final String d, final ECDomainParameters domainParameters) {
|
||||
if (null == d) {
|
||||
return null;
|
||||
}
|
||||
return toPrivateParams(BigIntegers.fromUnsignedByteArray(SecureUtil.decode(d)), domainParameters);
|
||||
}
|
||||
|
||||
@ -255,6 +258,9 @@ public class ECKeyUtil {
|
||||
* @return ECPrivateKeyParameters
|
||||
*/
|
||||
public static ECPrivateKeyParameters toPrivateParams(final byte[] d, final ECDomainParameters domainParameters) {
|
||||
if (null == d) {
|
||||
return null;
|
||||
}
|
||||
return toPrivateParams(BigIntegers.fromUnsignedByteArray(d), domainParameters);
|
||||
}
|
||||
|
||||
|
@ -311,7 +311,13 @@ public class SM2Test {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void issuesI5PWQ4Test(){
|
||||
|
||||
public void sm2WithNullPriPointTest() {
|
||||
final String x = "9EF573019D9A03B16B0BE44FC8A5B4E8E098F56034C97B312282DD0B4810AFC3";
|
||||
final String y = "CC759673ED0FC9B9DC7E6FA38F0E2B121E02654BF37EA6B63FAF2A0D6013EADF";
|
||||
final String q = "04" + x + y;
|
||||
final SM2 sm1 = new SM2(null, x, y);
|
||||
final SM2 sm2 = new SM2(null, q);
|
||||
Assert.assertNotNull(sm1);
|
||||
Assert.assertNotNull(sm2);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user