Information

1
Story Points

Technologies

Decompiled Java File
package iaik.x509.extensions;

import iaik.asn1.ASN;
import iaik.asn1.ASN1Object;
import iaik.asn1.CON_SPEC;
import iaik.asn1.ObjectID;
import iaik.asn1.SEQUENCE;
import iaik.asn1.structures.ChoiceOfTime;
import iaik.x509.V3Extension;
import iaik.x509.X509ExtensionException;
import java.util.Date;

public class PrivateKeyUsagePeriod extends V3Extension {
   private ChoiceOfTime b;
   private ChoiceOfTime a;
   public static final ObjectID oid = new ObjectID("2.5.29.16", "PrivateKeyUsagePeriod");

   public String toString() {
      StringBuffer var1 = new StringBuffer();
      var1.append("not before: " + this.a + "\n");
      var1.append("not after : " + this.b);
      return var1.toString();
   }

   public ASN1Object toASN1Object() {
      SEQUENCE var1 = new SEQUENCE();
      if(this.a != null) {
         var1.addComponent(new CON_SPEC(0, this.a.toASN1Object(), true));
      }

      if(this.b != null) {
         var1.addComponent(new CON_SPEC(1, this.b.toASN1Object(), true));
      }

      return var1;
   }

   public void init(ASN1Object var1) throws X509ExtensionException {
      try {
         for(int var2 = 0; var2 < var1.countComponents(); ++var2) {
            CON_SPEC var3 = (CON_SPEC)var1.getComponentAt(var2);
            var3.forceImplicitlyTagged(ASN.GeneralizedTime);
            ASN1Object var4 = (ASN1Object)var3.getValue();
            switch(var3.getAsnType().getTag()) {
            case 0:
               this.a = new ChoiceOfTime(var4);
               break;
            case 1:
               this.b = new ChoiceOfTime(var4);
            }
         }

      } catch (Exception var5) {
         throw new X509ExtensionException(var5.toString());
      }
   }

   public int hashCode() {
      return oid.hashCode();
   }

   public ObjectID getObjectID() {
      return oid;
   }

   public Date getNotBefore() {
      return this.a.getDate();
   }

   public Date getNotAfter() {
      return this.b.getDate();
   }

   public PrivateKeyUsagePeriod(Date var1, Date var2) {
      if(var1 != null) {
         this.a = new ChoiceOfTime(var1);
         this.a.setEncodingType(ASN.GeneralizedTime);
      }

      if(var2 != null) {
         this.b = new ChoiceOfTime(var2);
         this.b.setEncodingType(ASN.GeneralizedTime);
      }

   }

   public PrivateKeyUsagePeriod() {
   }
}
Page generated: Oct 19, 2017 2:34:21 PM