FileDocCategorySizeDatePackage
DESedeParameters.javaAPI DocAzureus 3.0.3.41356Tue Jun 08 05:13:00 BST 2004org.bouncycastle.crypto.params

DESedeParameters

public class DESedeParameters extends DESParameters

Fields Summary
public static final int
DES_EDE_KEY_LENGTH
Constructors Summary
public DESedeParameters(byte[] key)


     
          
    
        super(key);

        if (isWeakKey(key, 0, 0))
        {
            throw new IllegalArgumentException("attempt to create weak DESede key");
        }
    
Methods Summary
public static booleanisWeakKey(byte[] key, int offset, int length)
return true if the passed in key is a DES-EDE weak key.

param
key bytes making up the key
param
offset offset into the byte array the key starts at
param
length number of bytes making up the key

        for (int i = offset; i < length; i += DES_KEY_LENGTH)
        {
            if (DESParameters.isWeakKey(key, i))
            {
                return true;
            }
        }

        return false;
    
public static booleanisWeakKey(byte[] key, int offset)
return true if the passed in key is a DES-EDE weak key.

param
key bytes making up the key
param
offset offset into the byte array the key starts at

        return isWeakKey(key, offset, key.length - offset);