private Type2Message decodeType2Message(String challenge) throws NTLMEngineException { try { return new Type2Message(Base64.decode(challenge)); } catch (final IOException exception) { throw new NTLMEngineException("Invalid Type2 message", exception); } }
@Override public String generateType1Msg(String domain, String workstation) throws NTLMEngineException { CredHandle credentials = acquireCredentialsHandle(); try { byte[] token = nextToken(credentials, null); return Base64.encodeBase64String(token); } finally { dispose(credentials); } }
@Override public String generateType1Msg(final String domain, final String workstation) throws NTLMEngineException { final Type1Message type1Message = new Type1Message(TYPE_1_FLAGS, domain, workstation); return Base64.encode(type1Message.toByteArray()); }
public String generateType1Msg(String domain, String workstation) throws NTLMEngineException { Type1Message type1Message = new Type1Message(Type1Message.getDefaultFlags(), domain, workstation); return Base64.encode(type1Message.toByteArray()); }
public String generateType3Msg(String username, String password, String domain, String workstation, String challenge) throws NTLMEngineException { Type2Message type2Message = decodeType2Message(challenge); Type3Message type3Message = new Type3Message(type2Message, password, domain, username, workstation, Type3Message.getDefaultFlags()); return Base64.encode(type3Message.toByteArray()); }
public String generateType1Msg(final String domain, final String workstation) throws NTLMEngineException { final Type1Message type1Message = new Type1Message(TYPE_1_FLAGS, domain, workstation); return Base64.encode(type1Message.toByteArray()); }
@Test public void generateType1Msg() throws NTLMEngineException { JCIFSEngine engine = new JCIFSEngine(); String type1Msg = engine.generateType1Msg("DOMAIN", "16.77.60"); assertEquals("TlRMTVNTUAABAAAABbIIoAYABgAgAAAACAAIACYAAABET01BSU4xNi43Ny42MA==", type1Msg); }
@Override public String generateType3Msg(String username, String password, String domain, String workstation, String challenge) throws NTLMEngineException { byte[] token = Base64.decodeBase64(challenge); token = nextToken(null, token); return Base64.encodeBase64String(token); }
public String generateType1Msg(String domain, String workstation) throws NTLMEngineException { Type1Message t1m = new Type1Message(Type1Message.getDefaultFlags(), domain, workstation); return Base64.encode(t1m.toByteArray()); }