Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NIFI-10667 Add Private Key Service interface and implementation #6553

Closed
wants to merge 3 commits into from

Conversation

exceptionfactory
Copy link
Contributor

Summary

NIFI-10667 Adds a new PrivateKeyService Controller Service interface and StandardPrivateKeyService implementation capable of reading encrypted or unencrypted Private Keys.

The service interface is defined in a new nifi-key-service-api module under nifi-standard-services. The standard implementation uses the Bouncy Castle library and PEMParser class to handle decoding and decrypting Private Keys. The initial implementation supports PEM encoding and PKCS 8, which can be used for several standard key algorithms including RSA and DSA.

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using mvn clean install -P contrib-check
    • JDK 8
    • JDK 11
    • JDK 17

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

- Defined PrivateKeyService in nifi-key-service-api
- Implemented StandardPrivateKeyService using Bouncy Castle library
@thenatog
Copy link
Contributor

Will review

@thenatog thenatog added the hacktoberfest-accepted Hacktoberfest Accepted label Oct 20, 2022
Copy link
Contributor

@turcsanyip turcsanyip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@exceptionfactory Thanks for adding this controller service!
I tested it with both encrypted and non-encrypted private keys and it works properly.

I found an invalid configuration case which is not handled correctly.
Also added some other comments as possible improvements.

Copy link
Contributor

@turcsanyip turcsanyip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@exceptionfactory Thanks for the changes!

+1 LGTM

@thenatog
Copy link
Contributor

+1 looks good to me

@thenatog thenatog closed this in 9f2ad26 Oct 20, 2022
priyanka-28 pushed a commit to priyanka-28/nifi that referenced this pull request Nov 16, 2022
- Defined PrivateKeyService in nifi-key-service-api
- Implemented StandardPrivateKeyService using Bouncy Castle library

NIFI-10667 Improved custom validation to avoid repetitive reads

NIFI-10667 Added onPropertyModified() to clear Key Reference for validation

Signed-off-by: Nathan Gough <thenatog@gmail.com>

This closes apache#6553.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Hacktoberfest Accepted
Projects
None yet
3 participants