1 /*
2  * @(#) $Id: Validity.java,v 1.3 2003/07/08 08:13:53 pankaj Exp $
3  *
4  * Copyright (c) 2002-03 by Pankaj Kumar (http://www.pankaj-k.net). 
5  * All rights reserved.
6  *
7  * The license governing the use of this file can be found in the 
8  * root directory of the containing software.
9  */
10package org.jstk.pki;
11
12import java.io.IOException;
13import org.jstk.asn1.*;
14
15/*
16 * Validity ::= SEQUENCE {
17 *   notBefore      UTCTime,
18 *   notAfter       UTCTime }
19 */
20public class Validity extends ASN1Seq {
21    private ASN1UTCTime notBefore = new ASN1UTCTime();
22    private ASN1UTCTime notAfter = new ASN1UTCTime();
23
24    public Validity(){
25        super();
26        add(notBefore);
27        add(notAfter);
28    }
29
30    public ASN1UTCTime getNotBefore(){
31        return notBefore;
32    }
33
34    public ASN1UTCTime getNotAfter(){
35        return notAfter;
36    }
37
38    public String toString(){
39        StringBuffer sb = new StringBuffer();
40        sb.append("Validity-SEQ(" + notBefore.toString() + ", ");
41        sb.append(notAfter.toString() + ")");
42        return sb.toString();
43    }
44}
45
46