NonceUtil { public static void validateNonce(ByteString nonce, SecurityPolicy securityPolicy) throws UaException { validateNonce(nonce, getNonceLength(securityPolicy)); }  static void enableSecureRandom(); static void disableSecureRandom(); static boolean isSecureRandomEnabled(); static ByteString generateNonce(int length); static ByteString generateNonce(SecurityPolicy securityPolicy); static void validateNonce(ByteString nonce, SecurityPolicy securityPolicy); static void validateNonce(ByteString nonce); static void validateNonce(ByteString nonce, int minimumLength); static final int MINIMUM_NONCE_LENGTH; }
@Test public void testZeroLengthNonceValidation() throws UaException { NonceUtil.validateNonce(ByteString.of(new byte[0]), 0); }