DataStore implements DataCacheProvider, RolesProvider { @SuppressWarnings("rawtypes") String getCurveName(org.bouncycastle.jce.spec.ECParameterSpec ecParameterSpec, boolean rfc) { String curveName = null; for (Enumeration names = ECNamedCurveTable.getNames(); names.hasMoreElements();) { final String name = (String) names.nextElement(); final X9ECParameters params = ECNamedCurveTable.getByName(name); if (params.getN().equals(ecParameterSpec.getN()) && params.getH().equals(ecParameterSpec.getH()) && params.getCurve().equals(ecParameterSpec.getCurve()) && params.getG().equals(ecParameterSpec.getG())) { curveName = name; break; } } return rfc ? rfcEllipticCurveName(curveName) : curveName; } DataStore(ChangeLogStore clogStore, CloudStore cloudStore); JWKList getZtsJWKList(Boolean rfc); void init(); boolean processDomain(SignedDomain signedDomain, boolean saveInStore); boolean processDomainDeletes(); void processDomainChecks(); boolean processDomainUpdates(); DomainData getDomainData(String name); void addDomainToCache(String name, DataCache dataCache); @Override DataCache getDataCache(String domainName); List<GroupMember> getGroupMembers(final String groupName); void getAccessibleRoles(DataCache data, String domainName, String identity,
            String[] requestedRoleList, Set<String> accessibleRoles, boolean keepFullName); String getPublicKey(String domain, String service, String keyId); HostServices getHostServices(String host); CloudStore getCloudStore(); void setCloudStore(CloudStore cloudStore); Cache<String, DataCache> getCacheStore(); Map<String, String> getPublicKeyCache(); @Override List<Role> getRolesByDomain(String domain);  }
@Test public void testGetInvalidCurveName() { ChangeLogStore clogStore = new MockZMSFileChangeLogStore("/tmp/zts_server_unit_tests/zts_root", pkey, "0"); DataStore store = new DataStore(clogStore, null); ECParameterSpec spec = Mockito.mock(ECParameterSpec.class); when(spec.getCurve()).thenReturn(null); when(spec.getG()).thenReturn(null); when(spec.getH()).thenReturn(new BigInteger("100")); when(spec.getN()).thenReturn(new BigInteger("100")); assertNull(store.getCurveName(spec, false)); }