Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 15221200B2D for ; Thu, 16 Jun 2016 15:36:07 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 13B5F160A61; Thu, 16 Jun 2016 13:36:07 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 63FD2160A51 for ; Thu, 16 Jun 2016 15:36:06 +0200 (CEST) Received: (qmail 81010 invoked by uid 500); 16 Jun 2016 13:36:05 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 80979 invoked by uid 99); 16 Jun 2016 13:36:05 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Jun 2016 13:36:05 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 568FF2C1F5C for ; Thu, 16 Jun 2016 13:36:05 +0000 (UTC) Date: Thu, 16 Jun 2016 13:36:05 +0000 (UTC) From: "Sebb (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CRYPTO-77) Hide Stream's Ctor with cipher parameter MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 16 Jun 2016 13:36:07 -0000 [ https://issues.apache.org/jira/browse/CRYPTO-77?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:all-tabpanel ] Sebb updated CRYPTO-77: ----------------------- Summary: Hide Stream's Ctor with cipher parameter (was: Hide Steam's C= tor with cipher parameter) > Hide Stream's Ctor with cipher parameter > ---------------------------------------- > > Key: CRYPTO-77 > URL: https://issues.apache.org/jira/browse/CRYPTO-77 > Project: Commons Crypto > Issue Type: Bug > Reporter: Xianda Ke > Assignee: Xianda Ke > > Stream has such two Ctor: > {code} > // denoted as (a) > public CryptoInputStream(InputStream in, CryptoCipher cipher, > int bufferSize, Key key, AlgorithmParameterSpec params) > // denoted as (b) > public CryptoInputStream(CipherTransformation transformation, > Properties props, InputStream in, Key key, > AlgorithmParameterSpec params) > {code} > if use Ctor (b), client user don't have to construct a cipher. make sens= e.=20 > But, in Ctor (a), the cipher argument is create outside Ctor, then it is = initialized in CryptoInputStream's Ctor. The cipher=E2=80=99s construction = is scattered. It is a bit confusing. > Ctor (a) seem only used internally. It would be better to hide Ctor (a) = for user. > In future, we can consider this: > {code} > // don't pass key and iv param, the cipher should be initialized outside > // similar to JDK, and more scalable to support GCM, CCM modes. > CryptoInputStream(InputStream in, CryptoCipher cipher, int bufferSize) > {code} > right now, we just hide Ctor (a) for user. -- This message was sent by Atlassian JIRA (v6.3.4#6332)