mirror of https://github.com/shred/acme4j
Make the Common Name optional in CSRs
This change doesn't set it by default when adding domains, and adds a method to explicitly set it if desired.pull/147/head
parent
e26f8fc572
commit
1cf53b6cf4
|
@ -78,11 +78,7 @@ public class CSRBuilder {
|
||||||
* Domain name to add
|
* Domain name to add
|
||||||
*/
|
*/
|
||||||
public void addDomain(String domain) {
|
public void addDomain(String domain) {
|
||||||
var ace = toAce(requireNonNull(domain));
|
namelist.add(toAce(requireNonNull(domain)));
|
||||||
if (namelist.isEmpty()) {
|
|
||||||
namebuilder.addRDN(BCStyle.CN, ace);
|
|
||||||
}
|
|
||||||
namelist.add(ace);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -222,6 +218,15 @@ public class CSRBuilder {
|
||||||
namebuilder.addRDN(oid, requireNonNull(value, "attribute value must not be null"));
|
namebuilder.addRDN(oid, requireNonNull(value, "attribute value must not be null"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the common name
|
||||||
|
* <p>
|
||||||
|
* Note that it is at the discretion of the ACME server to accept this parameter.
|
||||||
|
*/
|
||||||
|
public void setCommonName(String cn) {
|
||||||
|
namebuilder.addRDN(BCStyle.CN, toAce(requireNonNull(cn)));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the organization.
|
* Sets the organization.
|
||||||
* <p>
|
* <p>
|
||||||
|
|
Loading…
Reference in New Issue