com.amazon.redshift.util

## Class ExtensibleDigest

- java.lang.Object
- - com.amazon.redshift.util.ExtensibleDigest

    public class ExtensibleDigest
    extends Object

Extensible hashing utility function to obfuscate passwords before network transmission.

### Method Summary

Methods
`static byte[]` `encode(byte[] clientNonce, byte[] password, byte[] salt, String algoName, byte[] serverNonce)` Encodes user/password/salt information in the following way: SHA2(SHA2(password + user) + salt).

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### encode

    public static byte[] encode(byte[] clientNonce,
                byte[] password,
                byte[] salt,
                String algoName,
                byte[] serverNonce)

Encodes user/password/salt information in the following way: SHA2(SHA2(password + user) + salt).

Parameters:
  `clientNonce` - The client nonce.
  `password` - The connecting user's password.
  `salt` - salt sent by the server.
  `algoName` - Algorithm name such as "SHA-256" etc.
  `serverNonce` - random number generated by server
Returns:
  A byte array of the digest.