Requires Bouncy Castle. The
BouncyCastleProvider must be added as security
provider.
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidAdds a domain name to the CSR.voidaddDomains(String... domains) Adds multiple domain names.voidaddDomains(Collection<String> domains) Adds aCollectionof domains.voidAdds anIdentifier.voidAdds aCollectionofIdentifier.voidaddIdentifiers(Identifier... ids) Adds multipleIdentifier.voidaddIP(InetAddress address) Adds anInetAddress.voidaddIPs(InetAddress... ips) Adds multiple IP addresses.voidaddIPs(Collection<InetAddress> ips) Adds aCollectionof IP addresses.voidSets an entry of the subject used for the CSR.voidSets an entry of the subject used for the CSR.org.bouncycastle.pkcs.PKCS10CertificationRequestgetCSR()Gets the PKCS#10 certification request.byte[]Gets an encoded PKCS#10 certification request.voidsetCommonName(String cn) Sets the common name.voidsetCountry(String c) Sets the country.voidSets the city or locality.voidSets the organization.voidSets the organizational unit.voidSets the state or province.voidSigns the completed CSR.toString()voidwrite(OutputStream out) Writes the signed certificate request to anOutputStream.voidWrites the signed certificate request to aWriter.
-
Konstruktordetails
-
CSRBuilder
public CSRBuilder()
-
-
Methodendetails
-
addDomain
Adds a domain name to the CSR. All domain names will be added as Subject Alternative Name.IDN domain names are ACE encoded automatically.
For wildcard certificates, the domain name must be prefixed with
"*.".- Parameter:
domain- Domain name to add
-
addDomains
Adds aCollectionof domains.IDN domain names are ACE encoded automatically.
- Parameter:
domains- Collection of domain names to add
-
addDomains
Adds multiple domain names.IDN domain names are ACE encoded automatically.
- Parameter:
domains- Domain names to add
-
addIP
Adds anInetAddress. All IP addresses will be set as iPAddress Subject Alternative Name.- Parameter:
address-InetAddressto add- Seit:
- 2.4
-
addIPs
Adds aCollectionof IP addresses.- Parameter:
ips- Collection of IP addresses to add- Seit:
- 2.4
-
addIPs
Adds multiple IP addresses.- Parameter:
ips- IP addresses to add- Seit:
- 2.4
-
addIdentifier
Adds anIdentifier. Only DNS and IP types are supported.- Parameter:
id-Identifierto add- Seit:
- 2.7
-
addIdentifiers
Adds aCollectionofIdentifier.- Parameter:
ids- Collection of Identifiers to add- Seit:
- 2.7
-
addIdentifiers
Adds multipleIdentifier.- Parameter:
ids- Identifiers to add- Seit:
- 2.7
-
addValue
Sets an entry of the subject used for the CSR.This method is meant as "expert mode" for setting attributes that are not covered by the other methods. It is at the discretion of the ACME server to accept this parameter.
- Parameter:
attName- The BCStyle attribute namevalue- The value- Seit:
- 2.14
-
addValue
Sets an entry of the subject used for the CSR.This method is meant as "expert mode" for setting attributes that are not covered by the other methods. It is at the discretion of the ACME server to accept this parameter.
- Parameter:
oid- The OID of the attribute to be addedvalue- The value- Seit:
- 2.14
-
setCommonName
Sets the common name.Note that it is at the discretion of the ACME server to accept this parameter.
- Seit:
- 3.2.0
-
setOrganization
Sets the organization.Note that it is at the discretion of the ACME server to accept this parameter.
-
setOrganizationalUnit
Sets the organizational unit.Note that it is at the discretion of the ACME server to accept this parameter.
-
setLocality
Sets the city or locality.Note that it is at the discretion of the ACME server to accept this parameter.
-
setState
Sets the state or province.Note that it is at the discretion of the ACME server to accept this parameter.
-
setCountry
Sets the country.Note that it is at the discretion of the ACME server to accept this parameter.
-
sign
Signs the completed CSR.- Parameter:
keypair-KeyPairto sign the CSR with- Löst aus:
IOException
-
getCSR
Gets the PKCS#10 certification request. -
getEncoded
Gets an encoded PKCS#10 certification request.- Löst aus:
IOException
-
write
Writes the signed certificate request to aWriter.- Parameter:
w-Writerto write the PEM file to. TheWriteris closed after use.- Löst aus:
IOException
-
write
Writes the signed certificate request to anOutputStream.- Parameter:
out-OutputStreamto write the PEM file to. TheOutputStreamis closed after use.- Löst aus:
IOException
-
toString
-