public interface AuthoritySignature
extends javacard.framework.Shareable
To do so, the Application shall first select a signature mode using the
init(byte, byte[], short, short)
method, then use the update(byte[], short, short)
and sign(byte[], short, short, byte[], short)
methods
to provide input data and obtain output data. The to-be-signed data will
typically include the input data provided by the Application and the output
data will typically include a digital signature, however what data are signed
and what output data are generated will depend on the selected mode (see
MODE_XXX
constants for details).
The signature algorithm and key cannot be chosen by the caller Application and will depend on how the implementation of this interface was created and personalized. However, for all modes, output data will include information about:
It is intended for Applications to access an AuthoritySignature
instance through a Global Service registered by the Controlling Authority
Security Domain (CASD) with a service name of (
.GPSystem.FAMILY_AUTHORITY_SIGNATURE
<<8|0x00)
Modifier and Type | Field and Description |
---|---|
static byte |
MODE_INTEGRITY
Used with
init(byte, byte[], short, short) method to indicate integrity protection mode. |
Modifier and Type | Method and Description |
---|---|
short |
getLength()
Gets the length (in bytes) of the output data that will be generated by the
sign(byte[], short, short, byte[], short) method. |
void |
init(byte mode,
byte[] params,
short offset,
short length)
Initializes this interface with a specific mode.
|
short |
sign(byte[] inBuff,
short inOffset,
short inLength,
byte[] sigBuff,
short sigOffset)
Generates a signature over the concatenation of the input data provided by
the caller Application and metadata added by this interface providing
information about the caller Application, the signature algorithm and
signature key.
|
void |
update(byte[] inBuff,
short inOffset,
short inLength)
Accumulates input data.
|
static final byte MODE_INTEGRITY
init(byte, byte[], short, short)
method to indicate integrity protection mode.In this mode, this interface will sign the input data provided by the caller Application to protect its integrity, without performing any additional check.
For this mode, to-be-signed data and output data are described in [GPCS-A] section 5.3.
This mode does not require any additional parameters.
void init(byte mode, byte[] params, short offset, short length)
While this method may be called anytime by any Application
(i.e. resetting the state of this interface), the other methods of this
interface may only be called by the Application that last invoked the
#init
method (i.e. calls performed by other Applications shall be
rejected).
mode
- MODE_INTEGRITY
params
- byte array containing parameters required by the specified
mode. Must be a global array. May be null if the specified
mode
does not require any additional parameter.offset
- offset of parameterslength
- length of parametersjavacard.security.CryptoException
- with reason code:CryptoException.ILLEGAL_VALUE
if mode
has an undefined value.
CryptoException.UNINITIALIZED_KEY
if the implementation of this interface is not ready (i.e. signature key not available).
short sign(byte[] inBuff, short inOffset, short inLength, byte[] sigBuff, short sigOffset)
The output data generated by this method will typically contain more than
just a digital signature, but also the above mentioned metadata. See MODE_XXX
constants for a detailed description of the signed data and
output data for each mode.
If the caller Application is not the one that previously invoked the init(byte, byte[], short, short)
method, an exception shall be thrown. If needed, the Application
shall invoke the init(byte, byte[], short, short)
method again.
A call to this method resets this interface to the state it was in when
previously initialized via a call to the init(byte, byte[], short, short)
method. That is,
the object is reset and available to sign another message.
inBuff
- byte array containing last (or all) input data. Must be a global array.inOffset
- offset of input datainLength
- length of input datasigBuff
- byte array where output data shall be written. Must be a global array.sigOffset
- offset where output data shall be writtensigBuff
javacard.security.CryptoException
- with reason code:CryptoException.INVALID_INIT
if this interface is not
initialized or was not initialized by the caller Application.
java.lang.SecurityException
- if inBuff
or sigBuff
are not global arrays.init(byte, byte[], short, short)
,
getLength()
void update(byte[] inBuff, short inOffset, short inLength)
When this method is used, temporary storage of intermediate results is
required. This method should only be used if all the input data required
for the current operation is not available in one byte array. Using the
sign(byte[], short, short, byte[], short)
method directly is recommended whenever possible.
If the caller Application is not the one that previously invoked the init(byte, byte[], short, short)
method, an exception shall be thrown. If needed, the Application
shall invoke the init(byte, byte[], short, short)
method again.
inBuff
- byte array containing input data. Must be a global array.inOffset
- offset of input datainLength
- length of input datajavacard.security.CryptoException
- with reason code:CryptoException.INVALID_INIT
if this interface is not
initialized or was not initialized by the caller Application.
java.lang.SecurityException
- if inBuff
is not a global array.init(byte, byte[], short, short)
,
getLength()
short getLength()
sign(byte[], short, short, byte[], short)
method.
If the caller Application is not the one that previously invoked the init(byte, byte[], short, short)
method, an exception shall be thrown. If needed, the Application
shall invoke the init(byte, byte[], short, short)
method again.
javacard.security.CryptoException
- with reason code:CryptoException.INVALID_INIT
if this interface is not
initialized or was not initialized by the caller Application.
init(byte, byte[], short, short)
Copyright © 2003-2018 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.