AttCertValidityPeriod.java
上传用户:lior1029
上传日期:2013-05-07
资源大小:209k
文件大小:1k
源码类别:

CA认证

开发平台:

Java

  1. package org.bouncycastle.asn1.x509;
  2. import org.bouncycastle.asn1.ASN1Sequence;
  3. import org.bouncycastle.asn1.DERGeneralizedTime;
  4. import org.bouncycastle.asn1.DERSequence;
  5. import org.bouncycastle.asn1.DERObject;
  6. import org.bouncycastle.asn1.DEREncodable;
  7. import org.bouncycastle.asn1.ASN1EncodableVector;
  8. public class AttCertValidityPeriod
  9.     implements DEREncodable
  10. {
  11.     DERGeneralizedTime  notBeforeTime;
  12.     DERGeneralizedTime  notAfterTime;
  13.     public AttCertValidityPeriod(
  14.         ASN1Sequence    seq)
  15.     {
  16.         notBeforeTime = (DERGeneralizedTime)seq.getObjectAt(0);
  17.         notAfterTime = (DERGeneralizedTime)seq.getObjectAt(1);
  18.     }
  19.     public DERGeneralizedTime getNotBeforeTime()
  20.     {
  21.         return notBeforeTime;
  22.     }
  23.     public DERGeneralizedTime getNotAfterTime()
  24.     {
  25.         return notAfterTime;
  26.     }
  27.     /**
  28.      * <pre>
  29.      *  AttCertValidityPeriod  ::= SEQUENCE {
  30.      *       notBeforeTime  GeneralizedTime,
  31.      *       notAfterTime   GeneralizedTime
  32.      *  } 
  33.      * </pre>
  34.      */
  35.     public DERObject getDERObject()
  36.     {
  37.         ASN1EncodableVector  v = new ASN1EncodableVector();
  38.         v.add(notBeforeTime);
  39.         v.add(notAfterTime);
  40.         return new DERSequence(v);
  41.     }
  42. }