public PolicyConstraintsExtension(Boolean critical,Object value) throws IOException {
  this.extensionId=PKIXExtensions.PolicyConstraints_Id;
  this.critical=critical.booleanValue();
  this.extensionValue=(byte[])value;
  DerValue val=new DerValue(this.extensionValue);
  if (val.tag != DerValue.tag_Sequence) {
    throw new IOException("Sequence tag missing for PolicyConstraint.");
  }
  DerInputStream in=val.data;
  while (in != null && in.available() != 0) {
    DerValue next=in.getDerValue();
    if (next.isContextSpecific(TAG_REQUIRE) && !next.isConstructed()) {
      if (this.require != -1)       throw new IOException("Duplicate requireExplicitPolicy" + "found in the PolicyConstraintsExtension");
      next.resetTag(DerValue.tag_Integer);
      this.require=next.getInteger();
    }
 else     if (next.isContextSpecific(TAG_INHIBIT) && !next.isConstructed()) {
      if (this.inhibit != -1)       throw new IOException("Duplicate inhibitPolicyMapping" + "found in the PolicyConstraintsExtension");
      next.resetTag(DerValue.tag_Integer);
      this.inhibit=next.getInteger();
    }
 else     throw new IOException("Invalid encoding of PolicyConstraint");
  }
}

public PolicyConstraintsExtension ( Boolean critical , Object value ) throws IOException { this . extensionId = PKIXExtensions . PolicyConstraints_Id ; this . critical = critical . booleanValue ( ) ; this . extensionValue = ( byte [ ] ) value ; DerValue val = new DerValue ( this . extensionValue ) ; if ( val . tag != DerValue . tag_Sequence ) { throw new IOException ( "Sequence tag missing for PolicyConstraint." ) ; } DerInputStream in = val . data ; while ( in != null && in . available ( ) != 0 ) { DerValue next = in . getDerValue ( ) ; if ( next . isContextSpecific ( TAG_REQUIRE ) && ! next . isConstructed ( ) ) { if ( this . require != - 1 ) throw new IOException ( "Duplicate requireExplicitPolicy" + "found in the PolicyConstraintsExtension" ) ; next . resetTag ( DerValue . tag_Integer ) ; this . require = next . getInteger ( ) ; } else if ( next . isContextSpecific ( TAG_INHIBIT ) && ! next . isConstructed ( ) ) { if ( this . inhibit != - 1 ) throw new IOException ( "Duplicate inhibitPolicyMapping" + "found in the PolicyConstraintsExtension" ) ; next . resetTag ( DerValue . tag_Integer ) ; this . inhibit = next . getInteger ( ) ; } else throw new IOException ( "Invalid encoding of PolicyConstraint" ) ; } }
create the extension from its der encoded value and criticality .
