Package org.jmrtd.lds.icao
Class DG15File
- java.lang.Object
-
- org.jmrtd.lds.AbstractTaggedLDSFile
-
- org.jmrtd.lds.DataGroup
-
- org.jmrtd.lds.icao.DG15File
-
- All Implemented Interfaces:
java.io.Serializable
,LDSElement
,LDSFile
public class DG15File extends DataGroup
File structure for the EF_DG15 file. Datagroup 15 contains the public key used in Active Authentication.- Version:
- $Revision: 1808 $
- Author:
- The JMRTD team ([email protected])
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.jmrtd.lds.LDSFile
EF_COM_TAG, EF_DG1_TAG, EF_DG10_TAG, EF_DG11_TAG, EF_DG12_TAG, EF_DG13_TAG, EF_DG14_TAG, EF_DG15_TAG, EF_DG16_TAG, EF_DG2_TAG, EF_DG3_TAG, EF_DG4_TAG, EF_DG5_TAG, EF_DG6_TAG, EF_DG7_TAG, EF_DG8_TAG, EF_DG9_TAG, EF_SOD_TAG
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
byte[]
getEncoded()
Returns the contents of this file as byte array, includes the ICAO tag and length.java.security.PublicKey
getPublicKey()
Returns the public key stored in this file.int
hashCode()
protected void
readContent(java.io.InputStream inputStream)
Reads the contents of the data group from an input stream.java.lang.String
toString()
Returns a textual representation of this file.protected void
writeContent(java.io.OutputStream out)
Writes the contents of the data group to an output stream.-
Methods inherited from class org.jmrtd.lds.AbstractTaggedLDSFile
getLength, getTag, readObject, writeObject
-
-
-
-
Constructor Detail
-
DG15File
public DG15File(java.security.PublicKey publicKey)
Constructs a new file.- Parameters:
publicKey
- the key to store in this file
-
DG15File
public DG15File(java.io.InputStream inputStream) throws java.io.IOException
Constructs a new file from binary representation.- Parameters:
inputStream
- an input stream- Throws:
java.io.IOException
- on error reading from input stream
-
-
Method Detail
-
readContent
protected void readContent(java.io.InputStream inputStream) throws java.io.IOException
Description copied from class:AbstractTaggedLDSFile
Reads the contents of the data group from an input stream. Client code implementing this method should only read the contents from the input stream, not the tag or length of the data group.- Specified by:
readContent
in classAbstractTaggedLDSFile
- Parameters:
inputStream
- the input stream to read from- Throws:
java.io.IOException
- on error reading from input stream
-
writeContent
protected void writeContent(java.io.OutputStream out) throws java.io.IOException
Description copied from class:AbstractTaggedLDSFile
Writes the contents of the data group to an output stream. Client code implementing this method should only write the contents to the output stream, not the tag or length of the data group.- Specified by:
writeContent
in classAbstractTaggedLDSFile
- Parameters:
out
- the output stream to write to- Throws:
java.io.IOException
- on error writing to output stream
-
getPublicKey
public java.security.PublicKey getPublicKey()
Returns the public key stored in this file.- Returns:
- the public key
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
Description copied from class:DataGroup
Returns a textual representation of this file.
-
getEncoded
public byte[] getEncoded()
Returns the contents of this file as byte array, includes the ICAO tag and length.- Specified by:
getEncoded
in interfaceLDSElement
- Returns:
- a byte array containing the file
-
-