01: package org.bouncycastle.jce.spec;
02:
03: import java.security.PrivateKey;
04: import java.security.PublicKey;
05: import java.security.spec.KeySpec;
06:
07: import org.bouncycastle.jce.interfaces.IESKey;
08:
09: /**
10: * key pair for use with an integrated encryptor - together
11: * they provide what's required to generate the message.
12: */
13: public class IEKeySpec implements KeySpec, IESKey {
14: private PublicKey pubKey;
15: private PrivateKey privKey;
16:
17: /**
18: * @param privKey our private key.
19: * @param pubKey the public key of the sender/recipient.
20: */
21: public IEKeySpec(PrivateKey privKey, PublicKey pubKey) {
22: this .privKey = privKey;
23: this .pubKey = pubKey;
24: }
25:
26: /**
27: * return the intended recipient's/sender's public key.
28: */
29: public PublicKey getPublic() {
30: return pubKey;
31: }
32:
33: /**
34: * return the local private key.
35: */
36: public PrivateKey getPrivate() {
37: return privKey;
38: }
39:
40: /**
41: * return "IES"
42: */
43: public String getAlgorithm() {
44: return "IES";
45: }
46:
47: /**
48: * return null
49: */
50: public String getFormat() {
51: return null;
52: }
53:
54: /**
55: * returns null
56: */
57: public byte[] getEncoded() {
58: return null;
59: }
60: }
|