Code example for DESKeySpec

0
      throws InvalidKeySpecException 
  { 
    if (spec.isAssignableFrom(DESKeySpec.class))
      try 
        { 
          return new DESKeySpec(key.getEncoded());
        } 
      catch (InvalidKeyException ike)
        { 
          InvalidKeySpecException ikse = new InvalidKeySpecException(
              "can't create DES key spec"); 
          ikse.initCause(ike);
          throw ikse;
        } 
    return super.engineGetKeySpec(key, spec);
  } 
}