Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/pkix
diff options
context:
space:
mode:
authorDavid Hook <dgh@cryptoworkshop.com>2014-03-22 08:34:57 +0400
committerDavid Hook <dgh@cryptoworkshop.com>2014-03-22 08:34:57 +0400
commitefba0a8666bfbbe4fdb7fd85f1812943dffacb2d (patch)
treed68c080b0b4558ba5fba30f7c531e9d91fd5fa4a /pkix
parent596d5ddd20752f24d842085ba4e7edcd26c6d214 (diff)
added support for ASN.1 time setting
Diffstat (limited to 'pkix')
-rw-r--r--pkix/src/main/java/org/bouncycastle/cert/X509v3CertificateBuilder.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/pkix/src/main/java/org/bouncycastle/cert/X509v3CertificateBuilder.java b/pkix/src/main/java/org/bouncycastle/cert/X509v3CertificateBuilder.java
index 2d31f744..0a0aa50a 100644
--- a/pkix/src/main/java/org/bouncycastle/cert/X509v3CertificateBuilder.java
+++ b/pkix/src/main/java/org/bouncycastle/cert/X509v3CertificateBuilder.java
@@ -36,11 +36,26 @@ public class X509v3CertificateBuilder
*/
public X509v3CertificateBuilder(X500Name issuer, BigInteger serial, Date notBefore, Date notAfter, X500Name subject, SubjectPublicKeyInfo publicKeyInfo)
{
+ this(issuer, serial, new Time(notBefore), new Time(notAfter), subject, publicKeyInfo);
+ }
+
+ /**
+ * Create a builder for a version 3 certificate.
+ *
+ * @param issuer the certificate issuer
+ * @param serial the certificate serial number
+ * @param notBefore the Time before which the certificate is not valid
+ * @param notAfter the Time after which the certificate is not valid
+ * @param subject the certificate subject
+ * @param publicKeyInfo the info structure for the public key to be associated with this certificate.
+ */
+ public X509v3CertificateBuilder(X500Name issuer, BigInteger serial, Time notBefore, Time notAfter, X500Name subject, SubjectPublicKeyInfo publicKeyInfo)
+ {
tbsGen = new V3TBSCertificateGenerator();
tbsGen.setSerialNumber(new ASN1Integer(serial));
tbsGen.setIssuer(issuer);
- tbsGen.setStartDate(new Time(notBefore));
- tbsGen.setEndDate(new Time(notAfter));
+ tbsGen.setStartDate(notBefore);
+ tbsGen.setEndDate(notAfter);
tbsGen.setSubject(subject);
tbsGen.setSubjectPublicKeyInfo(publicKeyInfo);