Class AsymmetricEncryptingReader
java.lang.Object
com.northconcepts.datapipeline.core.DataObject
com.northconcepts.datapipeline.core.Endpoint
com.northconcepts.datapipeline.core.DataEndpoint
com.northconcepts.datapipeline.core.DataReader
com.northconcepts.datapipeline.core.ProxyReader
com.northconcepts.datapipeline.internal.lang.IntegrationProxyReader
com.northconcepts.datapipeline.security.EncryptingReader
com.northconcepts.datapipeline.security.AsymmetricEncryptingReader
An
EncryptingReader that encrypts fields with a symmetric key and appends that key, encrypted with a public
key, to every value after a -; read the values back with an AsymmetricDecryptingReader.-
Nested Class Summary
Nested classes/interfaces inherited from class com.northconcepts.datapipeline.core.DataEndpoint
DataEndpoint.State -
Field Summary
FieldsFields inherited from class com.northconcepts.datapipeline.security.EncryptingReader
buffer, cipher, fields, serializerFields inherited from class com.northconcepts.datapipeline.core.DataReader
fieldLineage, recordLineageFields inherited from class com.northconcepts.datapipeline.core.DataEndpoint
lastRecord, PRODUCT, PRODUCT_VERSION, VENDOR, XML_INPUT_FACTORY_KEYFields inherited from class com.northconcepts.datapipeline.core.Endpoint
BUFFER_SIZE, captureElapsedTime, DEFAULT_READ_BUFFER_SIZEFields inherited from class com.northconcepts.datapipeline.core.DataObject
id, log, name, TIMESTAMP_FORMAT -
Constructor Summary
ConstructorsConstructorDescriptionAsymmetricEncryptingReader(DataReader nestedDataReader) AsymmetricEncryptingReader(DataReader nestedDataReader, String asymmetricAlgorithm, PublicKey asymmetricKey) -
Method Summary
Modifier and TypeMethodDescriptionaddExceptionProperties(DataException exception) Adds this endpoint's current state to aDataException.Adds fields to encrypt; only allowed before the reader is opened.addFields(Collection<String> fieldNames) Adds fields to encrypt; only allowed before the reader is opened.protected voidencryptFieldImpl(Field field) Replaces the field's value in place with its encrypted form.Returns the algorithm used with the public key to encrypt the symmetric key, such asRSA; required to open the reader.Returns the public key used to encrypt the symmetric key; required to open the reader.Returns the algorithm of the symmetric key that encrypts the fields (default isAES).Returns the symmetric key that encrypts the fields; if none is set, one is generated when the reader opens.intReturns the size in bits of the symmetric key generated when none is set (default is 128); it must be at leastMINIMUM_SYMMETRIC_LENGTH.protected voidInitializes or resetsEncryptingReader.cipherfor encryption; called when the reader opens and again after a field fails to encrypt.setAsymmetricAlgorithm(String asymmetricAlgorithm) Sets the algorithm used with the public key to encrypt the symmetric key, such asRSA; required to open the reader.setAsymmetricKey(PublicKey asymmetricKey) Sets the public key used to encrypt the symmetric key; required to open the reader.setSymmetricAlgorithm(String symmetricAlgorithm) Sets the algorithm of the symmetric key that encrypts the fields (default isAES).setSymmetricKey(SecretKey symmetricKey) Sets the symmetric key that encrypts the fields; if none is set, one is generated when the reader opens.setSymmetricKeyBitLength(int symmetricKeyBitLength) Sets the size in bits of the symmetric key generated when none is set (default is 128); it must be at leastMINIMUM_SYMMETRIC_LENGTH.Methods inherited from class com.northconcepts.datapipeline.security.EncryptingReader
encryptField, getFields, interceptRecord, openMethods inherited from class com.northconcepts.datapipeline.core.ProxyReader
available, close, getNestedReader, map, map, readImpl, setNestedDataReader, setNestedDataReaderMethods inherited from class com.northconcepts.datapipeline.core.DataReader
addLineage, getBufferSize, getNestedEndpoint, getReader, getRootEndpoint, getRootReader, isExhausted, isLineageSupported, isSaveLineage, peek, pop, push, read, setSaveLineage, skipMethods inherited from class com.northconcepts.datapipeline.core.DataEndpoint
decrementRecordCount, enableJmx, getLastRecord, getRecordCount, getRecordCountAsBigInteger, getRecordCountAsString, incrementRecordCount, isRecordCountBigInteger, resetRecordCount, toStringMethods inherited from class com.northconcepts.datapipeline.core.Endpoint
addElapsedtime, assertClosed, assertNotOpened, assertOpened, finalize, getClosedOn, getDescription, getElapsedTime, getElapsedTimeAsString, getOpenedOn, getOpenElapsedTime, getOpenElapsedTimeAsString, getSelfTime, getSelfTimeAsString, getState, isCaptureElapsedTime, isClosed, isOpen, setCaptureElapsedTime, setDescription
-
Field Details
-
MINIMUM_SYMMETRIC_LENGTH
public static final int MINIMUM_SYMMETRIC_LENGTH- See Also:
-
-
Constructor Details
-
AsymmetricEncryptingReader
-
AsymmetricEncryptingReader
public AsymmetricEncryptingReader(DataReader nestedDataReader, String asymmetricAlgorithm, PublicKey asymmetricKey)
-
-
Method Details
-
getAsymmetricAlgorithm
Returns the algorithm used with the public key to encrypt the symmetric key, such asRSA; required to open the reader. -
setAsymmetricAlgorithm
Sets the algorithm used with the public key to encrypt the symmetric key, such asRSA; required to open the reader. -
getAsymmetricKey
Returns the public key used to encrypt the symmetric key; required to open the reader. -
setAsymmetricKey
Sets the public key used to encrypt the symmetric key; required to open the reader. -
getSymmetricAlgorithm
Returns the algorithm of the symmetric key that encrypts the fields (default isAES). -
setSymmetricAlgorithm
Sets the algorithm of the symmetric key that encrypts the fields (default isAES). -
getSymmetricKeyBitLength
public int getSymmetricKeyBitLength()Returns the size in bits of the symmetric key generated when none is set (default is 128); it must be at leastMINIMUM_SYMMETRIC_LENGTH. -
setSymmetricKeyBitLength
Sets the size in bits of the symmetric key generated when none is set (default is 128); it must be at leastMINIMUM_SYMMETRIC_LENGTH. -
getSymmetricKey
Returns the symmetric key that encrypts the fields; if none is set, one is generated when the reader opens. -
setSymmetricKey
Sets the symmetric key that encrypts the fields; if none is set, one is generated when the reader opens. -
addFields
Description copied from class:EncryptingReaderAdds fields to encrypt; only allowed before the reader is opened.- Overrides:
addFieldsin classEncryptingReader
-
addFields
Description copied from class:EncryptingReaderAdds fields to encrypt; only allowed before the reader is opened.- Overrides:
addFieldsin classEncryptingReader
-
initCipher
protected void initCipher()Description copied from class:EncryptingReaderInitializes or resetsEncryptingReader.cipherfor encryption; called when the reader opens and again after a field fails to encrypt.- Specified by:
initCipherin classEncryptingReader
-
encryptFieldImpl
Description copied from class:EncryptingReaderReplaces the field's value in place with its encrypted form.- Specified by:
encryptFieldImplin classEncryptingReader- Throws:
Throwable
-
addExceptionProperties
Description copied from class:EndpointAdds this endpoint's current state to aDataException. Since this method is called whenever an exception is thrown, subclasses should override it to add their specific information.- Overrides:
addExceptionPropertiesin classEncryptingReader
-