@InputRequirement(value=INPUT_REQUIRED) @Tags(value={"PGP","GPG","OpenPGP","Encryption","RFC 4880"}) @CapabilityDescription(value="Encrypt contents using OpenPGP. The processor reads input and detects OpenPGP messages to avoid unnecessary additional wrapping in Literal Data packets.") @SeeAlso(value={DecryptContentPGP.class,SignContentPGP.class,VerifyContentPGP.class}) @WritesAttribute(attribute="pgp.symmetric.key.algorithm",description="Symmetric-Key Algorithm") @WritesAttribute(attribute="pgp.symmetric.key.algorithm.block.cipher",description="Symmetric-Key Algorithm Block Cipher") @WritesAttribute(attribute="pgp.symmetric.key.algorithm.key.size",description="Symmetric-Key Algorithm Key Size") @WritesAttribute(attribute="pgp.symmetric.key.algorithm.id",description="Symmetric-Key Algorithm Identifier") @WritesAttribute(attribute="pgp.file.encoding",description="File Encoding") @WritesAttribute(attribute="pgp.compression.algorithm",description="Compression Algorithm") @WritesAttribute(attribute="pgp.compression.algorithm.id",description="Compression Algorithm Identifier") public class EncryptContentPGP extends AbstractProcessor
| Modifier and Type | Class and Description |
|---|---|
private static class |
EncryptContentPGP.EncryptStreamCallback |
private class |
EncryptContentPGP.PacketReadInputStreamCallback |
| Modifier and Type | Field and Description |
|---|---|
static PropertyDescriptor |
COMPRESSION_ALGORITHM |
private static List<PropertyDescriptor> |
DESCRIPTORS |
private static boolean |
ENCRYPTION_INTEGRITY_PACKET_ENABLED
Enable Integrity Protection as described in RFC 4880 Section 5.13
|
static Relationship |
FAILURE |
static PropertyDescriptor |
FILE_ENCODING |
static PropertyDescriptor |
PASSPHRASE |
static PropertyDescriptor |
PUBLIC_KEY_SEARCH |
static PropertyDescriptor |
PUBLIC_KEY_SERVICE |
private static Set<Relationship> |
RELATIONSHIPS |
static Relationship |
SUCCESS |
static PropertyDescriptor |
SYMMETRIC_KEY_ALGORITHM |
| Constructor and Description |
|---|
EncryptContentPGP() |
| Modifier and Type | Method and Description |
|---|---|
protected Collection<ValidationResult> |
customValidate(ValidationContext context)
Custom Validate requires at least one encryption property to be configured
|
private Map<String,String> |
getAttributes(SymmetricKeyAlgorithm symmetricKeyAlgorithm,
FileEncoding fileEncoding,
CompressionAlgorithm compressionAlgorithm) |
private CompressionAlgorithm |
getCompressionAlgorithm(ProcessContext context) |
private List<org.bouncycastle.openpgp.operator.PGPKeyEncryptionMethodGenerator> |
getEncryptionMethodGenerators(ProcessContext context,
FlowFile flowFile,
SecureRandom secureRandom) |
private StreamCallback |
getEncryptStreamCallback(ProcessContext context,
FlowFile flowFile,
SymmetricKeyAlgorithm symmetricKeyAlgorithm,
CompressionAlgorithm compressionAlgorithm,
FileEncoding fileEncoding,
boolean packetFound) |
private FileEncoding |
getFileEncoding(ProcessContext context) |
Set<Relationship> |
getRelationships()
Get Relationships
|
List<PropertyDescriptor> |
getSupportedPropertyDescriptors()
Get Supported Property Descriptors
|
private SymmetricKeyAlgorithm |
getSymmetricKeyAlgorithm(ProcessContext context) |
void |
onTrigger(ProcessContext context,
ProcessSession session)
On Trigger encrypts Flow File contents using configured properties
|
onTriggergetControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueequals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitisStatefulgetPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validatepublic static final Relationship SUCCESS
public static final Relationship FAILURE
public static final PropertyDescriptor SYMMETRIC_KEY_ALGORITHM
public static final PropertyDescriptor COMPRESSION_ALGORITHM
public static final PropertyDescriptor FILE_ENCODING
public static final PropertyDescriptor PASSPHRASE
public static final PropertyDescriptor PUBLIC_KEY_SERVICE
public static final PropertyDescriptor PUBLIC_KEY_SEARCH
private static final boolean ENCRYPTION_INTEGRITY_PACKET_ENABLED
private static final Set<Relationship> RELATIONSHIPS
private static final List<PropertyDescriptor> DESCRIPTORS
public Set<Relationship> getRelationships()
getRelationships in interface ProcessorgetRelationships in class AbstractSessionFactoryProcessorpublic final List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors in class AbstractConfigurableComponentpublic void onTrigger(ProcessContext context, ProcessSession session)
onTrigger in class AbstractProcessorcontext - Process Contextsession - Process Sessionprotected Collection<ValidationResult> customValidate(ValidationContext context)
customValidate in class AbstractConfigurableComponentcontext - Validation Contextprivate StreamCallback getEncryptStreamCallback(ProcessContext context, FlowFile flowFile, SymmetricKeyAlgorithm symmetricKeyAlgorithm, CompressionAlgorithm compressionAlgorithm, FileEncoding fileEncoding, boolean packetFound)
private List<org.bouncycastle.openpgp.operator.PGPKeyEncryptionMethodGenerator> getEncryptionMethodGenerators(ProcessContext context, FlowFile flowFile, SecureRandom secureRandom)
private SymmetricKeyAlgorithm getSymmetricKeyAlgorithm(ProcessContext context)
private CompressionAlgorithm getCompressionAlgorithm(ProcessContext context)
private FileEncoding getFileEncoding(ProcessContext context)
private Map<String,String> getAttributes(SymmetricKeyAlgorithm symmetricKeyAlgorithm, FileEncoding fileEncoding, CompressionAlgorithm compressionAlgorithm)
Copyright © 2022 Apache NiFi Project. All rights reserved.