|
DESede3KeyCipherImpl |
|
1 /* $RCSfile: DESede3KeyCipherImpl.java,v $
2 * $Revision: 1.2 $
3 * $Date: 2002/01/04 12:11:40 $
4 * $Author: uwe $
5 * $State: Exp $
6 *
7 * Created on January 2, 2002 1:36 PM
8 *
9 * Copyright (C) 2001 Uwe Guenther <uwe@cscc.de>
10 *
11 * This file is part of the jhbci JCE-ServiceProvider. The jhbci JCE-
12 * ServiceProvider is a library, written in JavaTM, that should be
13 * used in HBCI banking applications (clients and may be servers),
14 * to do cryptographic operations.
15 *
16 * The jhbci library is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public
18 * License as published by the Free Software Foundation; either
19 * version 2.1 of the License, or (at your option) any later version.
20 *
21 * The jhbci library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
25 *
26 * You should have received a copy of the GNU Lesser General Public
27 * License along with this library; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 *
30 */
31
32 package de.cscc.crypto.provider;
33
34 import javax.crypto.IllegalBlockSizeException;
35
36 /**
37 * This is the concret DESede3Key algorithm class,
38 * it subclasses DESBaseCipherImpl, because in JCE is no
39 * possiblity to set a cipher.
40 */
41 final class DESede3KeyCipherImpl extends DESBaseCipherImpl {
42
43 /** The default key to initialize the cipher algorithm object. */
44 private static final byte[] DEFAULT_KEY = {
45 (byte)0x01, (byte)0x01, (byte)0x01, (byte)0x01,
46 (byte)0x01, (byte)0x01, (byte)0x01, (byte)0x01,
47 (byte)0x01, (byte)0x01, (byte)0x01, (byte)0x01,
48 (byte)0x01, (byte)0x01, (byte)0x01, (byte)0x01,
49 (byte)0x01, (byte)0x01, (byte)0x01, (byte)0x01,
50 (byte)0x01, (byte)0x01, (byte)0x01, (byte)0x01
51 };
52
53 /**
54 * Creates a new DESede3KeyCipherImpl object.
55 *
56 * @throws SecurityException if the provider self integrity check fails.
57 */
58 DESede3KeyCipherImpl() {
59
60 this.cipherAlgorithm = "DESede3Key";
61
62 try{
63 this.cipher = new DESCoreEde3KeyBlockCipher(DEFAULT_KEY);
64 } catch (IllegalBlockSizeException cannothappen) {
65 throw new Error("Can not happen.", cannothappen);
66 }
67
68 //mode has default iv 0x0000000000000000
69 this.mode = new OperationModeCBC(this.cipher);
70
71 this.padding = new PaddingISO10126OctetPadding(this.mode);
72 }
73
74 }
75
76
|
DESede3KeyCipherImpl |
|