public void setSecureRandom(SecureRandom random) throws NullPointerException {
        if (random == null) {
            throw new NullPointerException("SecureRandom argument cannot be null.");
        }
        this.secureRandom = random;
    }
Sets the {@link SecureRandom SecureRandom} to back this instance.

@param random the {@link SecureRandom SecureRandom} to back this instance.
@throws NullPointerException if the method argument is null
crypto/core/src/main/java/org/apache/shiro/crypto/SecureRandomNumberGenerator.java