1
14
15 package com.liferay.portal.security.ntlm.msrpc;
16
17 import jcifs.dcerpc.ndr.NdrBuffer;
18 import jcifs.dcerpc.ndr.NdrObject;
19
20
25 public class NetlogonAuthenticator extends NdrObject {
26
27 public NetlogonAuthenticator() {
28 _credential = new byte[8];
29 }
30
31 public NetlogonAuthenticator(byte[] credential, int timestamp) {
32 _credential = credential;
33 _timestamp = timestamp;
34 }
35
36 public void decode(NdrBuffer ndrBuffer) {
37 ndrBuffer.align(4);
38
39 int index = ndrBuffer.index;
40
41 ndrBuffer.advance(8);
42
43 _timestamp = ndrBuffer.dec_ndr_long();
44
45 ndrBuffer = ndrBuffer.derive(index);
46
47 for (int i = 0; i < 8; i++) {
48 _credential[i] = (byte) ndrBuffer.dec_ndr_small();
49 }
50 }
51 public void encode(NdrBuffer ndrBuffer) {
52 ndrBuffer.align(4);
53
54 int index = ndrBuffer.index;
55
56 ndrBuffer.advance(8);
57
58 ndrBuffer.enc_ndr_long(_timestamp);
59
60 ndrBuffer = ndrBuffer.derive(index);
61
62 for (int i = 0; i < 8; i++) {
63 ndrBuffer.enc_ndr_small(_credential[i]);
64 }
65 }
66
67 private byte[] _credential;
68 private int _timestamp;
69
70 }