|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpygar.zoneable.FieldCrypto
public abstract class FieldCrypto
Perform the innermost encryption step: the encryption of fields but not the semantic tags of the statements.
According to the original plan, this class is abstract because there may be alternative document encodings during development and perhaps even in deployment. Thus, we introduce this abstract class and work is done in a subclass: FieldCryptoXmlTxt0
A potential alternative method would use document tree structures that are
stored and transmitted in binary. In order to supply that alternative, it will be
necessary write a new implementation in a subclass.
Field Summary | |
---|---|
protected int |
cipherBlockSize
|
protected javax.crypto.Cipher |
cipherDecrypt
|
protected javax.crypto.Cipher |
cipherEncrypt
|
protected int |
cipherOutputSize
|
protected CryptoEngine |
crypto
|
protected java.security.Key |
key
|
protected EncryptedFieldTable |
table
|
Constructor Summary | |
---|---|
FieldCrypto(CryptoEngine crypto,
java.security.Key key,
EncryptedFieldTable table)
Create an object initializing it for encryption using the table definitions of the fields. |
Method Summary | |
---|---|
abstract boolean |
compareStreams(java.io.InputStream inStream1,
java.io.InputStream inStream2,
java.lang.Double tolerance,
EncryptedFieldTable table)
Compare two streams containing XML documents containing fields described by the field table. |
abstract void |
decode(java.io.InputStream in,
java.io.OutputStream out)
Decode the in stream applying the encryption algorithm to the fields as specified in the table and placing the results on the out stream. |
abstract java.lang.String |
decodeField(EncryptedFieldTable.EFTYPE ftype,
java.lang.String name,
byte[] value)
Decode a single encrypted field according to its type creating a clear text string for the value. |
abstract java.lang.String |
decodeField(EncryptedFieldTable.Row row,
java.lang.String value)
Decode a single encrypted field according to its type creating a clear text string for the value. |
abstract void |
decryptPartiallyEncryptedStream(java.io.InputStream inStream,
java.io.OutputStream outStream,
EncryptedFieldTable table)
Decrypt the document on the inStream assuming it was partially encrypted with the current session encryption key. |
abstract void |
encode(java.io.InputStream in,
java.io.OutputStream out)
Encode the in stream applying the encryption algorithm to the fields as specified in the table and placing results on the out stream. |
abstract java.lang.String |
encodeField(EncryptedFieldTable.Row row,
java.lang.String value)
Encode a single field represented as a string creating an encrypted byte array using the field type specified. |
protected abstract java.lang.String |
encodeString(java.lang.String s)
Encode a string with a symmetric session key and return it as a string representation in hexadecimal. |
abstract void |
partiallyEncryptStream(java.io.InputStream inStream,
java.io.OutputStream outStream,
EncryptedFieldTable table)
Partially encrypt the input stream according to the specifications of the EncryptedFieldTable and using the current session key. |
abstract boolean |
verifyField(EncryptedFieldTable.Row row,
java.lang.Double tolerance,
java.lang.String value1,
java.lang.String value2)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected javax.crypto.Cipher cipherEncrypt
protected javax.crypto.Cipher cipherDecrypt
protected CryptoEngine crypto
protected int cipherBlockSize
protected int cipherOutputSize
protected volatile EncryptedFieldTable table
protected java.security.Key key
Constructor Detail |
---|
public FieldCrypto(CryptoEngine crypto, java.security.Key key, EncryptedFieldTable table) throws java.security.NoSuchAlgorithmException, javax.crypto.NoSuchPaddingException, java.security.InvalidKeyException
crypto
- the CryptoEngine object for this configurationkey
- the symmetric encryption keytable
- the definitions of the fields
java.security.NoSuchAlgorithmException
javax.crypto.NoSuchPaddingException
java.security.InvalidKeyException
Method Detail |
---|
public abstract void encode(java.io.InputStream in, java.io.OutputStream out) throws DocumentError
in
- out
-
DocumentError
public abstract void decode(java.io.InputStream in, java.io.OutputStream out) throws CryptoException
in
- out
-
CryptoException
public abstract java.lang.String encodeField(EncryptedFieldTable.Row row, java.lang.String value) throws CryptoException
row
- - from EncryptedFieldTable that describes the fieldvalue
-
CryptoException
public abstract java.lang.String decodeField(EncryptedFieldTable.EFTYPE ftype, java.lang.String name, byte[] value) throws CryptoException
ftype
- the type of the fieldname
- the name of the fieldvalue
-
CryptoException
public abstract java.lang.String decodeField(EncryptedFieldTable.Row row, java.lang.String value) throws CryptoException
row
- the description of the fieldvalue
-
CryptoException
public abstract void partiallyEncryptStream(java.io.InputStream inStream, java.io.OutputStream outStream, EncryptedFieldTable table) throws javax.xml.stream.XMLStreamException, CryptoException
javax.xml.stream.XMLStreamException
CryptoException
public abstract void decryptPartiallyEncryptedStream(java.io.InputStream inStream, java.io.OutputStream outStream, EncryptedFieldTable table) throws javax.xml.stream.XMLStreamException, CryptoException
inStream
- outStream
- table
-
javax.xml.stream.XMLStreamException
CryptoException
public abstract boolean compareStreams(java.io.InputStream inStream1, java.io.InputStream inStream2, java.lang.Double tolerance, EncryptedFieldTable table) throws javax.xml.stream.XMLStreamException, java.lang.Exception
inStream1
- first xml document to compareinStream2
- second xml documenttolerance
- allowable difference between two real values as a fraction of valuetable
- description of fields
javax.xml.stream.XMLStreamException
java.lang.Exception
public abstract boolean verifyField(EncryptedFieldTable.Row row, java.lang.Double tolerance, java.lang.String value1, java.lang.String value2) throws CryptoException
CryptoException
protected abstract java.lang.String encodeString(java.lang.String s) throws CryptoException
s
- - clear text string
CryptoException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |