23 lines
661 B
Java
23 lines
661 B
Java
//package com.cscn;
|
||
//
|
||
//import javacard.security.RandomData;
|
||
//
|
||
//public class RandomGenerator {
|
||
// private final RandomData random;
|
||
//
|
||
// //构造函数
|
||
// public RandomGenerator()
|
||
// {
|
||
// //类当中有getInstance的都要先调用这个函数获取对象实例才能使用其他方法,不然6F00
|
||
// random = RandomData.getInstance(RandomData.ALG_SECURE_RANDOM);
|
||
// }
|
||
//
|
||
// //产生length长度的随机数并返回
|
||
// public final byte[] GenrateSecureRand(short length, byte[] out)
|
||
// {
|
||
// //生成4bit的随机数
|
||
// random.generateData(out, (short)0, (short)length);
|
||
// return out;
|
||
// }
|
||
//}
|