nxt.authentication

## Interface SecurityToken

-     public interface SecurityToken

  Security token

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `getBytes()` Get the serialized token
    `java.nio.ByteBuffer` | `getBytes(java.nio.ByteBuffer buffer)` Add the serialized token to a buffer
    `int` | `getLength()` Get the serialized token length
    `long` | `getPeerAccountId()` Get peer account identifier
    `byte[]` | `getPeerPublicKey()` Get peer public key
    `byte[]` | `getSessionKey(java.lang.String secretPhrase, byte[] peerPublicKey)` Get the session key
    `void` | `setSessionKey(java.lang.String secretPhrase, byte[] peerPublicKey, byte[] sessionKey)` Set the session key

- - ### Method Detail

    - #### getPeerAccountId

          long getPeerAccountId()

      Get peer account identifier
      Returns:
        Peer account identifier

    - #### getPeerPublicKey

          byte[] getPeerPublicKey()

      Get peer public key
      Returns:
        Peer public key

    - #### getSessionKey

          byte[] getSessionKey(java.lang.String secretPhrase,
                               byte[] peerPublicKey)

      Get the session key
      Parameters:
        `secretPhrase` - Server credentials secret phrase
        `peerPublicKey` - Peer public key
      Returns:
        Session key or null if there is no session key

    - #### setSessionKey

          void setSessionKey(java.lang.String secretPhrase,
                             byte[] peerPublicKey,
                             byte[] sessionKey)

      Set the session key
      Parameters:
        `secretPhrase` - Server credentials secret phrase
        `peerPublicKey` - Peer public key
        `sessionKey` - Session key

    - #### getLength

          int getLength()

      Get the serialized token length
      Returns:
        Serialized token length

    - #### getBytes

          byte[] getBytes()

      Get the serialized token
      Returns:
        Serialized token

    - #### getBytes

          java.nio.ByteBuffer getBytes(java.nio.ByteBuffer buffer)

      Add the serialized token to a buffer
      Parameters:
        `buffer` - Byte buffer
      Returns:
        Byte buffer