public interface RandomDataService extends CSPService
Provides services for random number generation.
setSeed(..)
method initializes the random data generator with seed.nextBytes(..)
method generates random data.This services uses a Secure Random Number Generator (SRNG) conform to one of the following functionality classes defined in [AIS 20/31]:
RESULT_FALSE, RESULT_TRUE
Modifier and Type | Method and Description |
---|---|
short |
nextBytes(byte[] outBuffer,
short outOffset,
short length)
Generates random data.
|
void |
setSeed(byte[] inBuffer,
short inOffset,
short length)
Seeds the random data generator.
|
assertSensitiveResult
short nextBytes(byte[] outBuffer, short outOffset, short length)
Usage Guidelines:
setSeed
to initialize the generator with seed.CSPSensitiveArrays
for the output buffer and invoke assertIntegrity(..)
after processing it.assertSensitiveResult(..)
.outBuffer
- Output buffer for storing the result.outOffset
- Offset in the output buffer where the result should be written.length
- The length of random data to generate.CSPException
- with reason:
ILLEGAL_BUFFER
: Illegal output buffer [1001], [1004], [1005], [1006], [1007].ILLEGAL_CONFIG
: CSP not activated [3001].setSeed
void setSeed(byte[] inBuffer, short inOffset, short length)
inBuffer
- Input data containing the seed.inOffset
- Offset in the input buffer to start reading.length
- Length of the input data in bytes.CSPException
- with reason:
ILLEGAL_BUFFER
: Illegal output buffer [1002], [1003].ILLEGAL_CONFIG
: CSP not activated [3001].nextBytes
Copyright © 2023-2025 GlobalPlatform, Inc. All rights reserved. The technology provided or described in this specification is subject to updates, revisions, and extensions by GlobalPlatform. Recipients of this document are invited to submit, with their comments, notification of any relevant patent rights or other intellectual property rights of which they may be aware which might be necessarily infringed by the implementation of the specification or other work product set forth in this document, and to provide supporting documentation.
THIS SPECIFICATION OR OTHER WORK PRODUCT IS BEING OFFERED WITHOUT ANY WARRANTY WHATSOEVER, AND IN PARTICULAR, ANY WARRANTY OF NON-INFRINGEMENT IS EXPRESSLY DISCLAIMED. ANY IMPLEMENTATION OF THIS SPECIFICATION OR OTHER WORK PRODUCT SHALL BE MADE ENTIRELY AT THE IMPLEMENTER'S OWN RISK, AND NEITHER THE COMPANY, NOR ANY OF ITS MEMBERS OR SUBMITTERS, SHALL HAVE ANY LIABILITY WHATSOEVER TO ANY IMPLEMENTER OR THIRD PARTY FOR ANY DAMAGES OF ANY NATURE WHATSOEVER DIRECTLY OR INDIRECTLY ARISING FROM THE IMPLEMENTATION OF THIS SPECIFICATION OR OTHER WORK PRODUCT.