String algorithm = MessageConstants.AES_BLOCK_ENCRYPTION_256;
byte[] secret = "randombytes".getBytes();
long offset = 0;
long length = SecurityUtil.getLengthFromAlgorithm(algorithm);
DerivedKeyToken dkt = new DerivedKeyTokenImpl(offset, length, secret);
SecretKey sKey = dkt.generateSymmetricKey(algorithm);
assertEquals(sKey.getEncoded().length, length);