src/java.base/share/classes/javax/crypto/CipherOutputStream.java
changeset 49781 21fa027e2e62
parent 47216 71c04702a3d5
child 51759 ac6e9a2ebc04
equal deleted inserted replaced
49780:3b7859b3ef15 49781:21fa027e2e62
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    40  * <p> This class adheres strictly to the semantics, especially the
    40  * <p> This class adheres strictly to the semantics, especially the
    41  * failure semantics, of its ancestor classes
    41  * failure semantics, of its ancestor classes
    42  * java.io.OutputStream and java.io.FilterOutputStream.  This class
    42  * java.io.OutputStream and java.io.FilterOutputStream.  This class
    43  * has exactly those methods specified in its ancestor classes, and
    43  * has exactly those methods specified in its ancestor classes, and
    44  * overrides them all.  Moreover, this class catches all exceptions
    44  * overrides them all.  Moreover, this class catches all exceptions
    45  * that are not thrown by its ancestor classes.
    45  * that are not thrown by its ancestor classes. In particular, this
       
    46  * class catches BadPaddingException and other exceptions thrown by
       
    47  * failed integrity checks during decryption. These exceptions are not
       
    48  * re-thrown, so the client will not be informed that integrity checks
       
    49  * failed. Because of this behavior, this class may not be suitable
       
    50  * for use with decryption in an authenticated mode of operation (e.g. GCM)
       
    51  * if the application requires explicit notification when authentication
       
    52  * fails. Such an application can use the Cipher API directly as an
       
    53  * alternative to using this class.
    46  *
    54  *
    47  * <p> It is crucial for a programmer using this class not to use
    55  * <p> It is crucial for a programmer using this class not to use
    48  * methods that are not defined or overriden in this class (such as a
    56  * methods that are not defined or overriden in this class (such as a
    49  * new method or constructor that is later added to one of the super
    57  * new method or constructor that is later added to one of the super
    50  * classes), because the design and implementation of those methods
    58  * classes), because the design and implementation of those methods