/**
  * Constructor for AlgorithmIdentifier.
  *
  * @param oid ObjectIdentifier
  * @param param AlgorithmParameters
  * @throws ASN1Exception
  */
 public AlgorithmIdentifier(ObjectIdentifier oid, AlgorithmParameters param) throws ASN1Exception {
   this.ident = ASN1Factory.encodeASN1Object(new Tag(Tag.OBJECTID), oid.getEncoded());
   this.ai.addComponent(this.ident);
   if (param == null) {
     try {
       this.param = new NULL();
     } catch (TLVEncodingException e) {
       throw new ASN1Exception(e);
     }
     this.ai.addComponent(this.param);
   }
 }
 /**
  * Method decode.
  *
  * @throws ASN1Exception
  */
 private void decode() throws ASN1Exception {
   Enumeration<ASN1Object> en = null;
   try {
     en = ASN1Factory.decodeASN1Object(this.ai.getValue());
   } catch (TLVEncodingException e) {
     throw new ASN1Exception(e);
   }
   if (en.hasMoreElements()) {
     this.ident = en.nextElement();
   }
   if (en.hasMoreElements()) {
     this.param = en.nextElement();
   }
 }