using HSM for random number generator

The random number services are designed to enable an application to access the random number source for its own purposes -for exmaple, generate One Time Password(OTP) for login verification. nCipher's hardware architecture provides a true hardware random number generator. This is used at module initialisation to create a truly random and externally unpredictable.
JCE inteface is commonly provided by HSM vendors, here is a example to call JCE sample

    //Initialize the secure random generator
        SecureRandom sec_rand= SecureRandom.getInstance(randomSPI,JCEProvider);
        //generate a random bytes
        byte bytes[] = new byte[byteslen];
        sec_rand.nextBytes(bytes);  
        return bytes;

posted @ 2013-12-03 16:29  GodDSZX  阅读(231)  评论(0)    收藏  举报