From issues-return-104047-archive-asf-public=cust-asf.ponee.io@nifi.apache.org Tue Sep 29 11:52:57 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-ec2-va.apache.org (mxout1-ec2-va.apache.org [3.227.148.255]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id 786EF18063B for ; Tue, 29 Sep 2020 13:52:57 +0200 (CEST) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-ec2-va.apache.org (ASF Mail Server at mxout1-ec2-va.apache.org) with SMTP id B9A8F43927 for ; Tue, 29 Sep 2020 11:52:56 +0000 (UTC) Received: (qmail 85501 invoked by uid 500); 29 Sep 2020 11:52:56 -0000 Mailing-List: contact issues-help@nifi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@nifi.apache.org Delivered-To: mailing list issues@nifi.apache.org Received: (qmail 85492 invoked by uid 99); 29 Sep 2020 11:52:56 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Sep 2020 11:52:56 +0000 From: =?utf-8?q?GitBox?= To: issues@nifi.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bnifi-minifi-cpp=5D_fgerlits_commented_on_a_change_?= =?utf-8?q?in_pull_request_=23886=3A_MINIFICPP-1323_Encrypt_sensitive_proper?= =?utf-8?q?ties?= Message-ID: <160138037644.32230.5676119947205480573.asfpy@gitbox.apache.org> Date: Tue, 29 Sep 2020 11:52:56 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit In-Reply-To: References: fgerlits commented on a change in pull request #886: URL: https://github.com/apache/nifi-minifi-cpp/pull/886#discussion_r496654947 ########## File path: libminifi/include/properties/Decryptor.h ########## @@ -0,0 +1,55 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include + +#include "utils/EncryptionUtils.h" +#include "utils/OptionalUtils.h" + +namespace org { +namespace apache { +namespace nifi { +namespace minifi { + +class Configure; + +class Decryptor { + public: + explicit Decryptor(const utils::crypto::Bytes& encryption_key); + static bool isEncrypted(const utils::optional& encryption_type); + std::string decrypt(const std::string& encrypted_text, const std::string& aad) const; + void decryptSensitiveProperties(Configure& configure) const; + + private: + const utils::crypto::Bytes encryption_key_; +}; + +inline Decryptor::Decryptor(const utils::crypto::Bytes& encryption_key) : encryption_key_(encryption_key) {} + +inline bool Decryptor::isEncrypted(const utils::optional& encryption_type) { Review comment: I have renamed it to `isValidEncryptionMarker` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org