1
package org.bouncycastle.asn1.x509;
3
import org.bouncycastle.asn1.ASN1Encodable;
4
import org.bouncycastle.asn1.ASN1EncodableVector;
5
import org.bouncycastle.asn1.ASN1Sequence;
6
import org.bouncycastle.asn1.DERGeneralizedTime;
7
import org.bouncycastle.asn1.DERObject;
8
import org.bouncycastle.asn1.DERSequence;
10
public class AttCertValidityPeriod
13
DERGeneralizedTime notBeforeTime;
14
DERGeneralizedTime notAfterTime;
16
public static AttCertValidityPeriod getInstance(
19
if (obj instanceof AttCertValidityPeriod)
21
return (AttCertValidityPeriod)obj;
23
else if (obj instanceof ASN1Sequence)
25
return new AttCertValidityPeriod((ASN1Sequence)obj);
28
throw new IllegalArgumentException("unknown object in factory: " + obj.getClass().getName());
31
public AttCertValidityPeriod(
36
throw new IllegalArgumentException("Bad sequence size: "
40
notBeforeTime = DERGeneralizedTime.getInstance(seq.getObjectAt(0));
41
notAfterTime = DERGeneralizedTime.getInstance(seq.getObjectAt(1));
45
* @param notBeforeTime
48
public AttCertValidityPeriod(
49
DERGeneralizedTime notBeforeTime,
50
DERGeneralizedTime notAfterTime)
52
this.notBeforeTime = notBeforeTime;
53
this.notAfterTime = notAfterTime;
56
public DERGeneralizedTime getNotBeforeTime()
61
public DERGeneralizedTime getNotAfterTime()
67
* Produce an object suitable for an ASN1OutputStream.
69
* AttCertValidityPeriod ::= SEQUENCE {
70
* notBeforeTime GeneralizedTime,
71
* notAfterTime GeneralizedTime
75
public DERObject toASN1Object()
77
ASN1EncodableVector v = new ASN1EncodableVector();
82
return new DERSequence(v);