KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ccvs > ssh > Cipher


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.team.internal.ccvs.ssh;
12
13 public abstract class Cipher {
14 public abstract void decipher(byte[] src, int srcPos, byte[] dst, int dstPos, int len);
15 public abstract void encipher(byte[] src, int srcPos, byte[] dst, int dstPos, int len);
16 public static Cipher getInstance(String JavaDoc algorithm) {
17     try {
18         Class JavaDoc c = Class.forName("org.eclipse.team.internal.ccvs.ssh." + algorithm); //$NON-NLS-1$
19
return (Cipher) c.newInstance();
20     } catch (Exception JavaDoc e) {
21         return null;
22     }
23 }
24 public abstract void setKey(byte[] key);
25 }
26
Popular Tags