if (hostnameRequirement != null) {
List<DomainSpecification> specs = new ArrayList<DomainSpecification>();
specs.add(
new HostnameSpecification(hostnameRequirement.getHostname(), null));
if (schemeRequirement != null) {
specs.add(new SchemeSpecification(schemeRequirement.getScheme()));
}
domain = new Domain(hostnameRequirement.getHostname(), null, specs);
if (store.addDomain(domain, credential)) {
return credential;
}