Package com.mku.salmon.win.sequencer
Class WinClientSequencer
java.lang.Object
com.mku.salmon.win.sequencer.WinClientSequencer
- All Implemented Interfaces:
INonceSequencer,Closeable,AutoCloseable
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the sequencer and any associated resources.voidcreateSequence(String driveId, String authId) Create a sequence.generateRequest(String driveId, String authId, WinClientSequencer.RequestType type, byte[] nextNonce, byte[] maxNonce) getSequence(String driveId) Get the sequence used for this drive.static StringgetSIDString(WinNT.PSID sid) voidinitializeSequence(String driveId, String authId, byte[] startNonce, byte[] maxNonce) Initialize the sequence.static booleanisServiceAdmin(String pipeName) byte[]Get the next nonce.voidrevokeSequence(String driveId) Revoke the sequencer.voidsetMaxNonce(String driveId, String authId, byte[] maxNonce) Set the max nonce
-
Constructor Details
-
WinClientSequencer
- Throws:
Exception
-
-
Method Details
-
isServiceAdmin
-
createSequence
Description copied from interface:INonceSequencerCreate a sequence.- Specified by:
createSequencein interfaceINonceSequencer- Parameters:
driveId- The drive ID.authId- The authorization ID of the drive.
-
getSequence
Description copied from interface:INonceSequencerGet the sequence used for this drive.- Specified by:
getSequencein interfaceINonceSequencer- Parameters:
driveId- The drive ID.- Returns:
- The current sequence.
-
initializeSequence
Description copied from interface:INonceSequencerInitialize the sequence.- Specified by:
initializeSequencein interfaceINonceSequencer- Parameters:
driveId- The drive ID.authId- The auth ID of the device for the drive.startNonce- The starting nonce.maxNonce- The maximum nonce.
-
nextNonce
Description copied from interface:INonceSequencerGet the next nonce.- Specified by:
nextNoncein interfaceINonceSequencer- Parameters:
driveId- The drive ID.- Returns:
- The next nonce.
-
revokeSequence
Description copied from interface:INonceSequencerRevoke the sequencer. This terminates the sequencer and de-authorizes the device- Specified by:
revokeSequencein interfaceINonceSequencer- Parameters:
driveId- The drive Id
-
setMaxNonce
Description copied from interface:INonceSequencerSet the max nonce- Specified by:
setMaxNoncein interfaceINonceSequencer- Parameters:
driveId- The drive ID.authId- The auth ID of the device for the drive.maxNonce- The maximum nonce.- Throws:
IOException- Thrown if there is an IO error.
-
generateRequest
public String generateRequest(String driveId, String authId, WinClientSequencer.RequestType type, byte[] nextNonce, byte[] maxNonce) throws IOException - Throws:
IOException
-
close
public void close()Description copied from interface:INonceSequencerClose the sequencer and any associated resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceINonceSequencer
-
getSIDString
-