|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--iaik.x509.extensions.qualified.structures.BiometricData
This class implements the BiometricData type of the
PKIX
Qualified Certificate Profile.
The BiometricData is used for including biometric information
into a qualified certificate by means of the private BiometricInfo extension.
The biometric information is provided by a hash of a biometric template:
BiometricData ::= SEQUENCE {
typeOfBiometricData TypeOfBiometricData,
hashAlgorithm AlgorithmIdentifier,
biometricDataHash OCTET STRING,
sourceDataUri IA5String OPTIONAL }
The biometric information corresponding to the included hash value is
not supplied. However, an URI may be specified pointing to the location
where the biometric information can be obtained.
TypeOfBiometricData ::= CHOICE {
predefinedBiometricType PredefinedBiometricType,
biometricDataOid OBJECT IDENTIFIER }
PredefinedBiometricType ::= INTEGER {
picture(0), handwritten-signature(1)}
(picture|handwritten-signature)
For more information about the BiometricData type please
refer to the actual Qualified Certificate Profile draft.
This class provides two constructors for supplying the type of biometric data:
BiometricData(int predefinedBiometricType) may be
used when creating a BiometricData object of predefined type and
BiometricData(ObjectID biometricDataOid) for
creating a BiometricData object where the type is indicated by an
object identifier. In the first case use the static variables picture respectively handwritten_signature for
indicating the desired predefined type, e.g.:
BiometricData biometricData = new BiometricData(BiometricData.picture);After having created a
BiometricData object you may choose among
three ways for setting hash algorithm and biometric data hash. When calling
method setBiometricDataHash(AlgorithmID hashAlgorithm, String sourceDataUri) a
connection is established to the given source data uri for obtaining the
biometric data to be hashed and subsequently setting the calcualted biometric
data hash value, e.g. (please note that this method only may be used for HTTP urls):
BiometricData biometricData = new BiometricData(BiometricData.picture); String sourceDaraUri = "http://jcewww.iaik.at/images/PE03257A.gif"; biometricData.setBiometricDataHash(AlgorithmID.sha, sourceDataUri);When using method
setBiometricDataHash(AlgorithmID hashAlgorithm, InputStream is) the
biometric data is calculated over the data supplied from the input stream.
An applicatin using method setBiometricDataHash(AlgorithmID hashAlgorithm, byte[]) has to calculate the
biometric data hash by itself. In both cases method setSourceDataUri may be used to set the optional source data uri field:
String sourceDataUri = ...; biometricData.setSourceDataUri(sourceDataUri);Use method
setBiometricDatas for adding BiometricData objects to a BiometricInfo extension.
When verifying the biometric data hash(es) included in a qualified certificate an application may use one of the following two methods obtaining the data to be hashed from the inherent source data uri or from the given input stream, respectively:
| Field Summary | |
static int |
handwritten_signature
The predefined biometric data type handwritten-signature. |
static int |
picture
The predefined biometric data type picture. |
| Constructor Summary | |
BiometricData()
Empty default constructor. |
|
BiometricData(ASN1Object obj)
Creates a BiometricData object from an ASN1Object.
|
|
BiometricData(int predefinedBiometricType)
Creates a BiometricData object from predefined biometric type. |
|
BiometricData(ObjectID biometricDataOid)
Creates a BiometricData object from the given object identifier. |
|
| Method Summary | |
void |
decode(ASN1Object obj)
Decodes this BiometricData from an ASN1Object.
|
byte[] |
getBiometricDataHash()
Gets the biometric data hash value. |
String |
getBiometricDataHashAsString()
Gets a string representation of the biometric data hash value. |
AlgorithmID |
getHashAlgorithm()
Gets the hash algorithm. |
String |
getSourceDataUri()
Gets source data uri. |
ASN1Object |
getTypeOfBiometricData()
Gets the type of biometric data. |
void |
setBiometricDataHash(AlgorithmID hashAlgorithm,
byte[] biometricDataHash)
Sets hash algorithm and hash value of this BiometricData object. |
void |
setBiometricDataHash(AlgorithmID hashAlgorithm,
InputStream is)
Calculates and sets the biometric data hash over the data supplied from an input stream. |
void |
setBiometricDataHash(AlgorithmID hashAlgorithm,
String sourceDataUri)
Sets hash algorithm and biometric data hash value calculated from the given source data uri. |
void |
setSourceDataUri(String sourceDataUri)
Sets the optional sourceDataUri field of this BiometricData object. |
ASN1Object |
toASN1Object()
Returns this BiometricData as ASN1Object. |
String |
toString()
Returns a string giving some information about this BiometricData object. |
boolean |
verifyBiometricDataHash()
Verifies the biometric data hash. |
boolean |
verifyBiometricDataHash(InputStream is)
Verifies the biometric data hash. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int picture
public static final int handwritten_signature
| Constructor Detail |
public BiometricData()
public BiometricData(int predefinedBiometricType)
throws IllegalArgumentException
predefinedBiometricType - the predefined biometric type (either 0 for picture
or 1 for handwritten-signature)IllegalArgumentException - if the given predefined biometric type is not
0 (picture) or 1 (handwritten-signature)public BiometricData(ObjectID biometricDataOid)
biometricDataOid - the object identifier indicating the type of biometric
data
public BiometricData(ASN1Object obj)
throws CodingException
BiometricData object from an ASN1Object.
The given ASN1Object represents an already existing BiometricData
that may have been created by using method toASN1Object().
obj - the BiometricData as ASN1ObjectX509ExtensionException - if the BiometricData cannot be parsed| Method Detail |
public void decode(ASN1Object obj)
throws CodingException
BiometricData from an ASN1Object.
The given ASN1Object represents an already existing BiometricData
that may have been created by using method toASN1Object().
decode in interface ASN1Typeobj - the BiometricData as ASN1ObjectX509ExtensionException - if the BiometricData cannot be parsed
public ASN1Object toASN1Object()
throws CodingException
toASN1Object in interface ASN1Typepublic void setSourceDataUri(String sourceDataUri)
sourceDataUri field, if present, represents an URI that
points to a location where the biometric information corresponding to
the stored hash value can be found.sourceDataUri - the source data URI
public void setBiometricDataHash(AlgorithmID hashAlgorithm,
byte[] biometricDataHash)
hashAlgorithm - the hash algorithmbiometricDataHash - the hash value
public void setBiometricDataHash(AlgorithmID hashAlgorithm,
InputStream is)
throws IOException,
NoSuchAlgorithmException
hashAlgorithm - the hash algorithm to be usedis - the input stream from which to read the dataIOException - if an error occurs while reading the dataNoSuchAlgorithmException - if the requested hash algorithm is
not supported
public void setBiometricDataHash(AlgorithmID hashAlgorithm,
String sourceDataUri)
throws IOException,
NoSuchAlgorithmException
This method tries to connect to the supplied (HTTP) source data uri to get the biometric data to be hashed. If successful, the given hash algorithm is used for calcuting and setting the biometric data hash value. Note that this method only may be used for HTTP urls.
If for some reason this method fails in setting the biometric data hash
an application may calculate the hash itself and may use method setBiometricDataHash(AlgorithmID,
byte[]) for explicitly setting the biometric data hash value (or supply the
data to be hashed from an input stream and call method setBiometricDataHash(AlgorithmID,
InputStream) for calculating and setting the biometric data hash.
hashAlgorithm - the hash algorithm to be usedsourceDataUri - the (HTTP) URL from where to get the biometric data to be hashedIOException - if an error occurs when trying to get the dataNoSuchAlgorithm - if the requested hash algorithm is not supported
public boolean verifyBiometricDataHash()
throws IOException
If a source dara uri is included, this method tries to connect to it for getting the biometric data to be hashed. If successful a hash value is calculated over the data obatained and compared with the inherent biometric data hash. Note that this method only may be used for HTTP urls.
If for some reason this method fails in verifying the biometric data hash
an application may obtain the data and calculate a hash itself for comparing
it against the biometric data hash got by getBiometricDataHash (or use method verifyBiometricDataHash(InputStream is) for supplying the biometric data to
be hashed and verified from an input stream).
true if the biometric data hash is ok, false
otherwiseIOException - if an error occurs when trying to get the data or
computing the hash to be verifiied
public boolean verifyBiometricDataHash(InputStream is)
throws IOException
This method calculates a hash value over the data supplied from the given input stream and compares it against the inherent biometric data hash.
true if the biometric data hash is ok, false
otherwiseIOException - if an error occurs when reading the data or
computing the hash to be verifiiedpublic ASN1Object getTypeOfBiometricData()
public AlgorithmID getHashAlgorithm()
public byte[] getBiometricDataHash()
public String getBiometricDataHashAsString()
public String getSourceDataUri()
public String toString()
BiometricData object.toString in class Object
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
IAIK-JCE 3.1 with IAIK-JCE CC Core 3.1, (c) 1997-2004 IAIK