|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.rsa.certj.cert.extensions.BiometricData
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) |
See Also
Constructor Summary |
|
BiometricData()
Constructs an empty |
|
BiometricData(byte[] infoBER,
int offset,
int special)
Creates a |
Method Summary |
|
clone()
Overrides the default |
|
boolean |
equals(Object obj)
Returns |
int |
getBiometricType()
Gets a |
byte[] |
getDataHash()
Gets a |
byte[] |
getDataID()
Gets a |
getDataURI()
Gets a |
|
int |
getDEREncoding(byte[] encoding,
int offset,
int special)
Places the DER encoding of this
|
int |
getDERLen(int special)
Returns the number of bytes that will be used by the DER encoding of
this |
getHashAlgorithm()
Gets the hash algorithm. |
|
static int |
getNextBEROffset(byte[] valueBER,
int offset)
Given valueBER, the BER encoding of a
|
void |
setBiometricType(int biometricType)
Sets a |
void |
setDataHash(byte[] dataHash,
int offset,
int len)
Sets a |
void |
setDataID(byte[] dataID,
int offset,
int len)
Sets a |
void |
setDataURI(String dataUri)
Sets a |
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 |
public BiometricData(byte[] infoBER, int offset, int special) throws NameException
BiometricData
object
and initializes it with the given values.
and initializes it with the given values.Parameters
infoBER | A | ||
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:
|
Throws
NameException
- If the encoding is invalid.public BiometricData()
BiometricData
object.Method Detail |
public void setDataHash(byte[] dataHash, int offset, int len)
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 | ||
len | the length of the biometric data hash in
|
public byte[] getDataHash()
biometricDataHash
value.
Returns
public void setDataURI(String dataUri)
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. |
public String getDataURI()
sourceDataUri
value
Returns
public void setBiometricType(int biometricType)
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 |
public int getBiometricType()
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
public void setDataID(byte[] dataID, int offset, int len)
biometricDataID
value. If
predefinedBiometricType
was set, this method resets it.
Parameters
dataID | the ID of the biometric data | ||
offset | the offset into | ||
len | the length of the biometric data hash in
|
public byte[] getDataID()
biometricDataID
value
Returns
public void setHashAlgorithm(String hashAlg) throws NameException
Parameters
hashAlg | the string describing hash algorithm |
Throws
NameException
- if passed in algorithm is not
a valid hash algorithmpublic String getHashAlgorithm() throws NameException
Returns
Throws
NameException
- if hash algorithm is invalidpublic static int getNextBEROffset(byte[] valueBER, int offset) throws NameException
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
| ||
offset | The offset into valueBER where the encoding begins. |
Returns
Throws
NameException
- If the method cannot
read the BER encoding.public int getDERLen(int special) throws NameException
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:
|
Returns
BiometricData
object.Throws
NameException
- if there is an error in encodingpublic int getDEREncoding(byte[] encoding, int offset, int special) throws NameException
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 Extensionpass in the following:
special = (ASN1.CONTEXT_IMPLICIT | 1);If there are no special circumstances, pass in the following:
special = 0The 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 | ||
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:
|
Returns
Throws
NameException
- If the method cannot create
the DER encoding.public boolean equals(Object obj)
true
if this
object and obj contain the
same BiometricData
, returns
false
otherwise.Overrides
equals
in class Object
Parameters
obj | An instance of the
|
Returns
boolean
indicating whether
these objects are equal.public Object clone() throws CloneNotSupportedException
clone
method to get a deeper clone.
Returns
BiometricData
object, a copy of this object.
Throws
CloneNotSupportedException
- If the cloning
operation is not successful.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |