public class CSRBuilder extends Object
Requires Bouncy Castle
. This class is part of the acme4j-utils
module.
Constructor and Description |
---|
CSRBuilder() |
Modifier and Type | Method and Description |
---|---|
void |
addDomain(String domain)
Adds a domain name to the CSR.
|
void |
addDomains(Collection<String> domains)
Adds a
Collection of domains. |
void |
addDomains(String... domains)
Adds multiple domain names.
|
org.bouncycastle.pkcs.PKCS10CertificationRequest |
getCSR()
Gets the PKCS#10 certification request.
|
byte[] |
getEncoded()
Gets an encoded PKCS#10 certification request.
|
void |
setCountry(String c)
Sets the country.
|
void |
setLocality(String l)
Sets the city or locality.
|
void |
setOrganization(String o)
Sets the organization.
|
void |
setOrganizationalUnit(String ou)
Sets the organizational unit.
|
void |
setState(String st)
Sets the state or province.
|
void |
sign(KeyPair keypair)
Signs the completed CSR.
|
String |
toString() |
void |
write(OutputStream out)
Writes the signed certificate request to an
OutputStream . |
void |
write(Writer w)
Writes the signed certificate request to a
Writer . |
public CSRBuilder()
public void addDomain(String domain)
IDN domain names are ACE encoded automatically.
Note that ACME servers may not accept wildcard domains!
domain
- Domain name to addpublic void addDomains(Collection<String> domains)
Collection
of domains.
IDN domain names are ACE encoded automatically.
domains
- Collection of domain names to addpublic void addDomains(String... domains)
IDN domain names are ACE encoded automatically.
domains
- Domain names to addpublic void setOrganization(String o)
Note that it is at the discretion of the ACME server to accept this parameter.
public void setOrganizationalUnit(String ou)
Note that it is at the discretion of the ACME server to accept this parameter.
public void setLocality(String l)
Note that it is at the discretion of the ACME server to accept this parameter.
public void setState(String st)
Note that it is at the discretion of the ACME server to accept this parameter.
public void setCountry(String c)
Note that it is at the discretion of the ACME server to accept this parameter.
public void sign(KeyPair keypair) throws IOException
keypair
- KeyPair
to sign the CSR withIOException
public org.bouncycastle.pkcs.PKCS10CertificationRequest getCSR()
public byte[] getEncoded() throws IOException
IOException
public void write(Writer w) throws IOException
Writer
.w
- Writer
to write the PEM file to. The Writer
is closed
after use.IOException
public void write(OutputStream out) throws IOException
OutputStream
.out
- OutputStream
to write the PEM file to. The OutputStream
is closed after use.IOException
Copyright © 2015–2019. All rights reserved.