Source code: cryptix/jce/provider/key/RC2KeyGenerator.java
1 /* $Id: RC2KeyGenerator.java,v 1.6 2000/02/19 02:57:54 gelderen Exp $
2 *
3 * Copyright (C) 1995-1999 The Cryptix Foundation Limited.
4 * All rights reserved.
5 *
6 * Use, modification, copying and distribution of this software is subject
7 * the terms and conditions of the Cryptix General Licence. You should have
8 * received a copy of the Cryptix General Licence along with this library;
9 * if not, you can download a copy from http://www.cryptix.org/ .
10 */
11 package cryptix.jce.provider.key;
12
13
14
15 /**
16 * A key generator for RC2.
17 * <p>
18 * FIXME: We only support 128-bit keys for now.
19 * <p>
20 *
21 * @version $Revision: 1.6 $
22 * @author Jeroen C. van Gelderen (gelderen@cryptix.org)
23 */
24 public class RC2KeyGenerator extends RawKeyGenerator
25 {
26 public RC2KeyGenerator()
27 {
28 super("RC2", 128);
29 }
30
31
32 /** RC2 doesn't have weak keys. */
33 protected boolean isWeak( byte[] key )
34 {
35 return false;
36 }
37
38
39 /** FIXME: 128-bit keys only. */
40 protected boolean isValidSize( int size )
41 {
42 return size==128 ? true : false;
43 }
44 }