001
014
015 package com.liferay.portal.security.ntlm.msrpc;
016
017 import jcifs.dcerpc.ndr.NdrBuffer;
018 import jcifs.dcerpc.ndr.NdrObject;
019
020
023 public class NetlogonAuthenticator extends NdrObject {
024
025 public NetlogonAuthenticator() {
026 _credential = new byte[8];
027 }
028
029 public NetlogonAuthenticator(byte[] credential, int timestamp) {
030 _credential = credential;
031 _timestamp = timestamp;
032 }
033
034 public void decode(NdrBuffer ndrBuffer) {
035 ndrBuffer.align(4);
036
037 int index = ndrBuffer.index;
038
039 ndrBuffer.advance(8);
040
041 _timestamp = ndrBuffer.dec_ndr_long();
042
043 ndrBuffer = ndrBuffer.derive(index);
044
045 for (int i = 0; i < 8; i++) {
046 _credential[i] = (byte) ndrBuffer.dec_ndr_small();
047 }
048 }
049 public void encode(NdrBuffer ndrBuffer) {
050 ndrBuffer.align(4);
051
052 int index = ndrBuffer.index;
053
054 ndrBuffer.advance(8);
055
056 ndrBuffer.enc_ndr_long(_timestamp);
057
058 ndrBuffer = ndrBuffer.derive(index);
059
060 for (int i = 0; i < 8; i++) {
061 ndrBuffer.enc_ndr_small(_credential[i]);
062 }
063 }
064
065 private byte[] _credential;
066 private int _timestamp;
067
068 }