|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectds.ov2.util.Serializable_array
ds.ov2.front.Host_signature
public class Host_signature
Host data type for Signature's
with signature
checking. Used to receive objects of type Signature
from
the card. This class further implements the validity check for
signatures. This class does not implement sending a signature to
the card, because signatures are established on the card in a
completely differnt way.
For a general description of signatures, the validity check and the
hash-size issue, see Signature
.
This is a host data type. It is compatible with nothing. The card
data type Signature
is compatible with this class.
Field Summary | |
---|---|
private APDU_byte_array |
apdu_hash
APDU container for the hash. |
private APDU_BigInteger |
apdu_number
APDU container for the number. |
private MessageDigest |
digest
SHA-1 hash instance. |
(package private) byte[] |
hash
The hash part of the signature. |
(package private) BigInteger |
number
The number part of the signature. |
static PrintWriter |
out
Debug channel. |
private APDU_Serializable[] |
serializable_contents
Array of the two APDU containers in support for Serializable_array . |
Constructor Summary | |
---|---|
Host_signature(short short_bignat_size,
short long_bignat_size,
byte applet_id)
Create a new host signature object. |
Method Summary | |
---|---|
boolean |
check_signature_ex(BigInteger blinded_a,
PTLS_rsa_parameters params,
boolean montgomerized)
Debug and exception wrapper for check_signature(java.math.BigInteger, ds.ov2.front.PTLS_rsa_parameters, boolean) . |
private boolean |
check_signature(BigInteger blinded_a,
PTLS_rsa_parameters params,
boolean montgomerized)
Signature check. |
short |
from_byte_array(short len,
short this_index,
byte[] byte_array,
short byte_index)
Deserialization of this object for the OV-chip protocol layer. |
protected APDU_Serializable[] |
get_array()
Return serializable_contents in support for abstract
Serializable_array . |
(package private) int |
get_hash_size()
Return the size of the hash hash . |
short |
get_length()
Return 2 as effective size in support for abstract Serializable_array . |
(package private) int |
get_number_size()
Return the size of the number number . |
Methods inherited from class ds.ov2.util.Serializable_array |
---|
is_compatible_with, size, to_byte_array |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface ds.ov2.util.APDU_Serializable |
---|
is_compatible_with, size, to_byte_array |
Field Detail |
---|
byte[] hash
from_byte_array
.
BigInteger number
from_byte_array
.
private APDU_byte_array apdu_hash
private APDU_BigInteger apdu_number
private APDU_Serializable[] serializable_contents
Serializable_array
.
private MessageDigest digest
public static PrintWriter out
Constructor Detail |
---|
public Host_signature(short short_bignat_size, short long_bignat_size, byte applet_id)
Hash_size
).
short_bignat_size
- size of the exponent bignats in byteslong_bignat_size
- size of the base bignats in bytesapplet_id
- the applet ID
RuntimeException
- with a cause of type
NoSuchAlgorithmException if the SHA-1 hash function cannot be
found.Method Detail |
---|
private boolean check_signature(BigInteger blinded_a, PTLS_rsa_parameters params, boolean montgomerized)
hash
and number
forms a valid signature for the blinded attribute
expression blinded_a
with respect to the PTLS
parameters params
.
If the argument montgomerized
is true this method
performs a check for a montgomerized signature, that is a
signature where numbers must be montgomerized before they are
fed into the hash function. Further, when montgomerized
is true it is assumed that blinded_a
is already
montgomerized. In essence, for a signature from the
Montgomerizing applet montgomerized
should be true and
otherwise false.
Restrictions of the hash size (see Signature
and Hash_size
) are taken into account as necessary.
The source code of this method is affected by Brand's patents
on selective disclosure protocols that are now in the posession
of Microsoft. Microsoft lawyers are still pondering our request
from January 2009 for making the full source code publically
available. The source code of this method is therefore
currently not publically available. The detailed operations of
this method are:
blinded_a
- the blinded attribute expression that was
signed; in montgomerized form if montgomerized
is trueparams
- the PTLS parametersmontgomerized
- true if the signature and blinded_a
come from the montgomerizing applet
public boolean check_signature_ex(BigInteger blinded_a, PTLS_rsa_parameters params, boolean montgomerized)
check_signature(java.math.BigInteger, ds.ov2.front.PTLS_rsa_parameters, boolean)
.
Prints the arguments to out
if that is non-null and
prints information about escaping runtime exceptions to out
or System.err
. Does not catch any exception, only
prints information and rethrows them.
blinded_a
- the blinded attribute expression that was
signed; in montgomerized form if montgomerized
is trueparams
- the PTLS parametersmontgomerized
- true if the signature and blinded_a
come from the montgomerizing applet
int get_hash_size()
hash
. Needed for the
compatibility check in Signature.is_compatible_with
.
int get_number_size()
number
. Needed for the
compatibility check in Signature.is_compatible_with
.
number
in bytesprotected APDU_Serializable[] get_array()
serializable_contents
in support for abstract
Serializable_array
.
get_array
in class Serializable_array
public short get_length()
Serializable_array
.
get_length
in class Serializable_array
public short from_byte_array(short len, short this_index, byte[] byte_array, short byte_index)
APDU_Serializable.from_byte_array
.
Overridden here to initialize number
from the APDU
wrapper after deserialization finished.
from_byte_array
in interface APDU_Serializable
from_byte_array
in class Serializable_array
len
- available data in byte_array
this_index
- number of bytes that
have already been read in preceeding callsbyte_array
- data array to deserialize frombyte_index
- index in byte_array
len
bytes, in this case len + 1
is
returned.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |