equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1996, 2015, 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 |
255 boolean encrypt) throws NoSuchAlgorithmException { |
255 boolean encrypt) throws NoSuchAlgorithmException { |
256 if (cipher.allowed == false) { |
256 if (cipher.allowed == false) { |
257 throw new NoSuchAlgorithmException("Unsupported cipher " + cipher); |
257 throw new NoSuchAlgorithmException("Unsupported cipher " + cipher); |
258 } |
258 } |
259 |
259 |
260 if (cipher == B_NULL) { |
260 if (cipher == BulkCipher.B_NULL) { |
261 return NULL; |
261 return NULL; |
262 } else { |
262 } else { |
263 return new CipherBox(version, cipher, key, iv, random, encrypt); |
263 return new CipherBox(version, cipher, key, iv, random, encrypt); |
264 } |
264 } |
265 } |
265 } |