/** * Returns the transformation string to use with the {@link javax.crypto.Cipher#getInstance} call. If * {@code streaming} is {@code true}, a block-cipher transformation string compatible with streaming operations will * be constructed and cached for re-use later (see the class-level JavaDoc for more on using block ciphers * for streaming). If {@code streaming} is {@code false} a normal block-cipher transformation string will * be constructed and cached for later re-use. * * @param streaming if the transformation string is going to be used for a Cipher performing stream-based encryption or not. * @return the transformation string */ protected String getTransformationString(boolean streaming) { if (streaming) { if (this.streamingTransformationString == null) { this.streamingTransformationString = buildStreamingTransformationString(); } return this.streamingTransformationString; } else { if (this.transformationString == null) { this.transformationString = buildTransformationString(); } return this.transformationString; } }
private String buildStreamingTransformationString() { return buildTransformationString(getStreamingModeName(), getStreamingPaddingSchemeName(), 0); }
private String buildTransformationString() { return buildTransformationString(getModeName(), getPaddingSchemeName(), getBlockSize()); }
/** * Returns the transformation string to use with the {@link javax.crypto.Cipher#getInstance} call. If * {@code streaming} is {@code true}, a block-cipher transformation string compatible with streaming operations will * be constructed and cached for re-use later (see the class-level JavaDoc for more on using block ciphers * for streaming). If {@code streaming} is {@code false} a normal block-cipher transformation string will * be constructed and cached for later re-use. * * @param streaming if the transformation string is going to be used for a Cipher performing stream-based encryption or not. * @return the transformation string */ protected String getTransformationString(boolean streaming) { if (streaming) { if (this.streamingTransformationString == null) { this.streamingTransformationString = buildStreamingTransformationString(); } return this.streamingTransformationString; } else { if (this.transformationString == null) { this.transformationString = buildTransformationString(); } return this.transformationString; } }
private String buildStreamingTransformationString() { return buildTransformationString(getStreamingModeName(), getStreamingPaddingSchemeName(), getStreamingBlockSize()); }
private String buildTransformationString() { return buildTransformationString(getModeName(), getPaddingSchemeName(), getBlockSize()); }