com.rsa.certj.cert.extensions

Class BiometricData

java.lang.Object
  |
  +--com.rsa.certj.cert.extensions.BiometricData
All Implemented Interfaces:
Cloneable, Serializable

public class BiometricData
extends Object
implements Cloneable, Serializable

This class is used in Biometric Info extension in Qualified Certificates.

The ASN.1 definition is as follows:

 BiometricData ::= SEQUENCE {
         typeOfBiometricData  TypeOfBiometricData,
         hashAlgorithm        AlgorithmIdentifier,
         biometricDataHash    OCTET STRING,
         sourceDataUri        IA5String OPTIONAL }

     TypeOfBiometricData ::= CHOICE {
         predefinedBiometricType    PredefinedBiometricType,
         biometricDataID            OBJECT IDENTIFIER }

     PredefinedBiometricType ::= INTEGER { picture(0),
         handwritten-signature(1)} (picture|handwritten-signature)
 
The predefined biometric type picture, when present, SHALL identify that the source picture is in the form of a displayable graphical image of the subject. The hash of the graphical image SHALL only be calculated over the image data excluding any labels defining the image type.

The predefined biometric type handwritten-signature, when present, SHALL identify that the source data is in the form of a displayable graphical image of the subject's handwritten signature. The hash of the graphical image SHALL only be calculated over the image data excluding any labels defining the image type.

The BiometricData MAY include an URI pointing to a location where the biometric information that corresponds to the stored hash can be obtained. If included, this URI does not imply that this is the only way to access this information.

Copyright © RSA Security Inc., 2002. All rights reserved.

See Also

Serialized Form

Constructor Summary

BiometricData()

Constructs an empty BiometricData object.

BiometricData(byte[] infoBER, int offset, int special)

Creates a BiometricData object and initializes it with the given values.

 

Method Summary

 Object

clone()

Overrides the default clone method to get a deeper clone.

 boolean

equals(Object obj)

Returns true if this object and obj contain the same BiometricData, returns false otherwise.

 int

getBiometricType()

Gets a predefinedBiometricType value

 byte[]

getDataHash()

Gets a biometricDataHash value.

 byte[]

getDataID()

Gets a biometricDataID value

 String

getDataURI()

Gets a sourceDataUri value

 int

getDEREncoding(byte[] encoding, int offset, int special)

Places the DER encoding of this BiometricData object into encoding, beginning at offset.

 int

getDERLen(int special)

Returns the number of bytes that will be used by the DER encoding of this BiometricData object.

 String

getHashAlgorithm()

Gets the hash algorithm.

static int

getNextBEROffset(byte[] valueBER, int offset)

Given valueBER, the BER encoding of a BiometricData object beginning at offset, finds the index to the next element in the encoding.

 void

setBiometricType(int biometricType)

Sets a predefinedBiometricType value.

 void

setDataHash(byte[] dataHash, int offset, int len)

Sets a biometricDataHash The hash of the graphical image SHALL only be calculated over the image data excluding any labels defining the image type.

 void

setDataID(byte[] dataID, int offset, int len)

Sets a biometricDataID value.

 void

setDataURI(String dataUri)

Sets a sourceDataUri value

 void

setHashAlgorithm(String hashAlg)

Sets the hash algorithm, for example "SHA512".

 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BiometricData

public BiometricData(byte[] infoBER,
                     int offset,
                     int special)
              throws NameException
Creates a BiometricData object and initializes it with the given values. and initializes it with the given values.

Parameters

         infoBER  

A byte array containing the BER encoding of this object.

         offset  

The offset into the infoBER array.

         special  

The special instructions of the BER encoding, if there are any. The following ASN.1 constants are possible values for special: APP_IMPLICIT, APP_EXPLICIT, PRIVATE_IMPLICIT, PRIVATE_EXPLICIT, OPTIONAL, DEFAULT, CONTEXT_IMPLICIT, or CONTEXT_EXPLICIT.

Throws

NameException - If the encoding is invalid.

BiometricData

public BiometricData()
Constructs an empty BiometricData object.
Method Detail

setDataHash

public void setDataHash(byte[] dataHash,
                        int offset,
                        int len)
Sets a biometricDataHash The hash of the graphical image SHALL only be calculated over the image data excluding any labels defining the image type.

Parameters

         dataHash  

the hash of the biometric data

         offset  

the offset into dataHash array

         len  

the length of the biometric data hash in dataHash array


getDataHash

public byte[] getDataHash()
Gets a biometricDataHash value.

Returns

the hash of the biometric data

setDataURI

public void setDataURI(String dataUri)
Sets a sourceDataUri value

Parameters

         dataUri  

an URI pointing to a location where biometric information that corresponds to the stored hash can be obtained. This URI does not imply that this is the only way to access this information.


getDataURI

public String getDataURI()
Gets a sourceDataUri value

Returns

an URI pointing to a location where biometric information that corresponds to the stored hash can be obtained. This URI does not imply that this is the only way to access this information.

setBiometricType

public void setBiometricType(int biometricType)
Sets a predefinedBiometricType value. If biometricDataID was set, this method resets it to null.

The predefined biometric type picture (predefinedBiometricType = 0) identifires that the source picture is in the form of a displayable graphical image of the subject.

The predefined biometric type handwritten-signature, (predefinedBiometricType = 1) identifies that the source data is in the form of a displayable graphical image of the subject's handwritten signature.

Parameters

         biometricType  

a predefined biometric type


getBiometricType

public int getBiometricType()
Gets a predefinedBiometricType value

The predefined biometric type picture (predefinedBiometricType = 0) identifires that the source picture is in the form of a displayable graphical image of the subject.

The predefined biometric type handwritten-signature, (predefinedBiometricType = 1) identifies that the source data is in the form of a displayable graphical image of the subject's handwritten signature.

Returns

a predefined biometric type

setDataID

public void setDataID(byte[] dataID,
                      int offset,
                      int len)
Sets a biometricDataID value. If predefinedBiometricType was set, this method resets it.

Parameters

         dataID  

the ID of the biometric data

         offset  

the offset into dataID array

         len  

the length of the biometric data hash in dataID array


getDataID

public byte[] getDataID()
Gets a biometricDataID value

Returns

dataID the ID of the biometric data

setHashAlgorithm

public void setHashAlgorithm(String hashAlg)
                      throws NameException
Sets the hash algorithm, for example "SHA512".

Parameters

         hashAlg  

the string describing hash algorithm

Throws

NameException - if passed in algorithm is not a valid hash algorithm

getHashAlgorithm

public String getHashAlgorithm()
                        throws NameException
Gets the hash algorithm.

Returns

the string describing hash algorithm

Throws

NameException - if hash algorithm is invalid

getNextBEROffset

public static int getNextBEROffset(byte[] valueBER,
                                   int offset)
                            throws NameException
Given valueBER, the BER encoding of a BiometricData object beginning at offset, finds the index to the next element in the encoding. In other words, this method gets the next offset after the BiometricData object.

For example, if the offset is 120 and the BiometricData object's BER encoding is 1819 bytes, then this method will return 1939, the index immediately following the BiometricData object. That is, valueBER[120] is the first byte in the encoding of the BiometricData object, valueBER[1938] is the last byte in the encoding of the BiometricData object, and the next element begins at index 1939.

Parameters

         valueBER  

The BER encoding of this BiometricData object.

         offset  

The offset into valueBER where the encoding begins.

Returns

The index to the next element in the BER encoding.

Throws

NameException - If the method cannot read the BER encoding.

getDERLen

public int getDERLen(int special)
              throws NameException
Returns the number of bytes that will be used by the DER encoding of this BiometricData object. If this object is not set with values, then this method returns zero.

Parameters

         special  

The special circumstances of the DER encoding, if there are any. The following ASN.1 constants are possible values for special: APP_IMPLICIT, APP_EXPLICIT, PRIVATE_IMPLICIT, PRIVATE_EXPLICIT, OPTIONAL, DEFAULT, CONTEXT_IMPLICIT, or CONTEXT_EXPLICIT.

Returns

The number of bytes that will be used by the DER encoding of this BiometricData object.

Throws

NameException - if there is an error in encoding

getDEREncoding

public int getDEREncoding(byte[] encoding,
                          int offset,
                          int special)
                   throws NameException
Places the DER encoding of this BiometricData object into encoding, beginning at offset. To determine the length of the encoding, call getDERLen. If this object is not yet set with values, then this method places nothing into the array and returns zero. To indicate that the DER encoding should follow any special instructions, use the special argument.

For example, to indicate the following:
      extension   [1] IMPLICIT Extension
 
pass in the following:
      special = (ASN1.CONTEXT_IMPLICIT | 1);
 

If there are no special circumstances, pass in the following:
      special = 0
 
The following ASN.1 constants are possible values for special: APP_IMPLICIT, APP_EXPLICIT, PRIVATE_IMPLICIT, PRIVATE_EXPLICIT, OPTIONAL, DEFAULT, CONTEXT_IMPLICIT, or CONTEXT_EXPLICIT.

Parameters

         encoding  

The byte array into which the result will be placed.

         offset  

The offset into encoding where writing begins.

         special  

The special circumstances of the DER encoding, if there are any. The following ASN.1 constants are possible values for special: APP_IMPLICIT, APP_EXPLICIT, PRIVATE_IMPLICIT, PRIVATE_EXPLICIT, OPTIONAL, DEFAULT, CONTEXT_IMPLICIT, or CONTEXT_EXPLICIT. are any.

Returns

The number of bytes placed into encoding.

Throws

NameException - If the method cannot create the DER encoding.

equals

public boolean equals(Object obj)
Returns true if this object and obj contain the same BiometricData, returns false otherwise.

Overrides

equals in class Object

Parameters

         obj  

An instance of the BiometricData object.

Returns

A boolean indicating whether these objects are equal.

clone

public Object clone()
             throws CloneNotSupportedException
Overrides the default clone method to get a deeper clone.

Returns

A new BiometricData object, a copy of this object.

Throws

CloneNotSupportedException - If the cloning operation is not successful.


RSA BSAFE ® Cert-J 2.1.1 001-047007-211-001-000