TokenBindingExtensionParser extends ExtensionParser<TokenBindingExtensionMessage> { @Override public void parseExtensionMessageContent(TokenBindingExtensionMessage msg) { msg.setTokenbindingVersion(parseByteArrayField(ExtensionByteLength.TOKENBINDING_VERSION)); LOGGER.debug("The token binding extension parser parsed the version: " + msg.getTokenbindingVersion().toString()); msg.setParameterListLength(parseByteField(ExtensionByteLength.TOKENBINDING_KEYPARAMETER_LENGTH)); LOGGER.debug("The token binding extension parser parsed the KeyParameterLength : " + msg.getParameterListLength()); msg.setTokenbindingKeyParameters(parseByteArrayField(msg.getParameterListLength().getValue())); LOGGER.debug("The token binding extension parser parsed the KeyParameters : " + msg.getTokenbindingKeyParameters().toString()); } TokenBindingExtensionParser(int startposition, byte[] array); @Override void parseExtensionMessageContent(TokenBindingExtensionMessage msg);  }
@Test public void testParseExtensionMessageContent() { message = parser.parse(); assertArrayEquals(extensionType.getValue(), message.getExtensionType().getValue()); assertArrayEquals(tokenbindingVersion.getByteValue(), message.getTokenbindingVersion().getValue()); assertEquals(parameterLength, (long) message.getParameterListLength().getValue()); assertArrayEquals(keyParameter, message.getTokenbindingKeyParameters().getValue()); assertTrue(extensionLength == message.getExtensionLength().getValue()); }