PasswordPolicyControl extends AbstractControl implements RequestControl, ResponseControl { @Override public void decode(final DERBuffer encoded) { final DERParser parser = new DERParser(); parser.registerHandler(TimeBeforeExpirationHandler.PATH, new TimeBeforeExpirationHandler(this)); parser.registerHandler(GraceAuthnsRemainingHandler.PATH, new GraceAuthnsRemainingHandler(this)); parser.registerHandler(ErrorHandler.PATH, new ErrorHandler(this)); parser.parse(encoded); } PasswordPolicyControl();  PasswordPolicyControl(final boolean critical); @Override boolean hasValue(); int getTimeBeforeExpiration(); void setTimeBeforeExpiration(final int time); int getGraceAuthNsRemaining(); void setGraceAuthNsRemaining(final int count); Error getError(); void setError(final Error e); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); @Override byte[] encode(); @Override void decode(final DERBuffer encoded); static final String OID; }
@Test(groups = "control", dataProvider = "response") public void decode(final DERBuffer berValue, final PasswordPolicyControl expected) throws Exception { final PasswordPolicyControl actual = new PasswordPolicyControl(expected.getCriticality()); actual.decode(berValue); Assert.assertEquals(actual, expected); }