01: package org.bouncycastle.crypto.tls;
02:
03: import java.io.IOException;
04:
05: /**
06: * A generic class for ciphersuites in TLS 1.0.
07: */
08: public abstract class TlsCipherSuite {
09:
10: protected static final short KE_RSA = 1;
11: protected static final short KE_RSA_EXPORT = 2;
12: protected static final short KE_DHE_DSS = 3;
13: protected static final short KE_DHE_DSS_EXPORT = 4;
14: protected static final short KE_DHE_RSA = 5;
15: protected static final short KE_DHE_RSA_EXPORT = 6;
16: protected static final short KE_DH_DSS = 7;
17: protected static final short KE_DH_RSA = 8;
18: protected static final short KE_DH_anon = 9;
19:
20: protected abstract void init(byte[] ms, byte[] cr, byte[] sr);
21:
22: protected abstract byte[] encodePlaintext(short type,
23: byte[] plaintext, int offset, int len);
24:
25: protected abstract byte[] decodeCiphertext(short type,
26: byte[] plaintext, int offset, int len,
27: TlsProtocolHandler handler) throws IOException;
28:
29: protected abstract short getKeyExchangeAlgorithm();
30:
31: }
|