public class CertificateSigningRequest extends Object
CertificateAuthority
who will signed this
request
These values may be optionally set:
Modifier and Type | Field and Description |
---|---|
protected org.joda.time.DateTime |
notAfter |
protected org.joda.time.DateTime |
notBefore |
protected BigInteger |
serialNumber |
protected KeyPair |
subjectKeyPair |
static int |
VALID_YEARS |
Constructor and Description |
---|
CertificateSigningRequest() |
Modifier and Type | Method and Description |
---|---|
void |
addSubjectAlternativeNames(String... names)
Adds subject alternative names.
|
org.joda.time.DateTime |
getNotAfter() |
org.joda.time.DateTime |
getNotBefore() |
long |
getSerialNumber() |
Set<org.bouncycastle.asn1.x509.GeneralName> |
getSubjectAlternativeNames()
Gets the subject alternative names.
|
org.bouncycastle.asn1.x500.X500Name |
getSubjectName() |
PrivateKey |
getSubjectPrivateKey() |
PublicKey |
getSubjectPublicKey() |
void |
setCommonName(String name)
Create a distinguished name for the certificate's subject.
|
void |
setDistinguishedName(String... name) |
void |
setNotAfter(org.joda.time.DateTime date)
The validity period for a certificate is the period of time from notBefore through notAfter,
inclusive.
|
void |
setNotBefore(org.joda.time.DateTime date)
The validity period for a certificate is the period of time from notBefore through notAfter,
inclusive.
|
void |
setSerialNumber(BigInteger serialNumber) |
void |
setSerialNumber(long number)
Set the serial number of the certificate.
|
void |
setSubjectKeyPair(KeyPair keyPair)
Set the subject's public and private keypair.
|
void |
setSubjectName(org.bouncycastle.asn1.x500.X500Name subjectName) |
public static final int VALID_YEARS
protected org.joda.time.DateTime notBefore
protected org.joda.time.DateTime notAfter
protected KeyPair subjectKeyPair
protected BigInteger serialNumber
public PrivateKey getSubjectPrivateKey()
public PublicKey getSubjectPublicKey()
public void setCommonName(String name)
name
- subject's common name attribute (public void setDistinguishedName(String... name)
public void setSerialNumber(long number)
number
- arbitrary serial numberpublic void setSubjectKeyPair(KeyPair keyPair)
keyPair
- RSA public/private keyspublic org.joda.time.DateTime getNotBefore()
public void setNotBefore(org.joda.time.DateTime date)
date
- expiration date of the certificatepublic org.joda.time.DateTime getNotAfter()
public void setNotAfter(org.joda.time.DateTime date)
date
- effective datepublic org.bouncycastle.asn1.x500.X500Name getSubjectName()
public void setSubjectName(org.bouncycastle.asn1.x500.X500Name subjectName)
public long getSerialNumber()
public void setSerialNumber(BigInteger serialNumber)
public void addSubjectAlternativeNames(String... names)
names
- a set of alternative names to add in a format similar to OpenSSL X509
configurationIllegalArgumentException
- if the list or any elements are null
or again if
any elements failed to be properly parsedpublic Set<org.bouncycastle.asn1.x509.GeneralName> getSubjectAlternativeNames()
This work is licensed under a Creative Commons Attribution 4.0 International License.