code: private String calculateSecretKey(byte[] secretKey)
      {
          switch (config.getKeyRepresentation())
          {
              case BASE32:
                  return new Base32().encodeToString(secretKey);
              case BASE64:
                  return new Base64().encodeToString(secretKey);
              default:
                  throw new IllegalArgumentException("Unknown key representation type.");
          }
      }
docs: This method calculates the secret key given a random byte buffer.
  
  @param secretKey a random byte buffer.
  @return the secret key.