/usr/share/why/javacard_api/javacard/security/RandomData.java is in why 2.34-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | /*
* Copyright (c) 1999 Sun Microsystems, Inc. All Rights Reserved.
*
* This software is the confidential and proprietary information of Sun
* Microsystems, Inc. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
* with Sun.
*
* SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
* SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
* SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
* THIS SOFTWARE OR ITS DERIVATIVES.
*/
/*
// $Workfile: RandomData.java $
// $Revision: 1.1 $
// $Date: 2007-09-26 14:32:59 $
// $Author: marche $
// $Archive: /Products/Europa/api21/javacard/security/RandomData.java $
// $Modtime: 5/02/00 7:13p $
// Original author: Andy
// */
package javacard.security;
//
/**
* The <code>RandomData</code> abstract class is the base class for random number generation. Implementations of RandomData
* algorithms must extend this class and implement all the abstract methods.
*/
abstract public class RandomData{
// Random Number algorithm options
/**
* Utility pseudo random number generation algorithms.
*/
public static final byte ALG_PSEUDO_RANDOM = 1;
/**
* Cryptographically secure random number generation algorithms.
*/
public static final byte ALG_SECURE_RANDOM = 2;
/**
* Protected constructor for subclassing.
*/
protected RandomData(){}
/**
* Creates a <code>RandomData</code> instance of the selected algorithm.
* The pseudo random <code>RandomData</code> instance's seed is initialized to a internal default value.
* @param algorithm the desired random number algorithm. Valid codes listed in ALG_.. constants. See above.
* @return the <code>RandomData</code> object instance of the requested algorithm.
* @exception CryptoException with the following reason codes:<ul>
* <li><code>CryptoException.NO_SUCH_ALGORITHM</code> if the requested algorithm is not supported.</ul>
*/
public static final RandomData getInstance(byte algorithm) throws CryptoException{
switch ( algorithm ){
case ALG_PSEUDO_RANDOM :
case ALG_SECURE_RANDOM :
CryptoException.throwIt( CryptoException.NO_SUCH_ALGORITHM);
return null;
}
return null;
}
/**
* Generates random data.
* @param buffer the output buffer
* @param offset the offset into the output buffer
* @param length the length of random data to generate
*/
abstract public void generateData(
byte[] buffer,
short offset,
short length);
// {
// Randomness.generate(buffer,offset,length);
// }
/**
* Seeds the random data generator.
* @param buffer the input buffer
* @param offset the offset into the input buffer
* @param length the length of the seed data
*/
abstract public void setSeed(
byte[] buffer,
short offset,
short length);
// {
// Randomness.setSeed(buffer,offset,length);
// }
}
|