1 package org.bouncycastle.crypto; 2 3 import org.bouncycastle.crypto.params.AsymmetricKeyParameter; 4 5 /** 6 * a holding class for public/private parameter pairs. 7 */ 8 public class AsymmetricCipherKeyPair 9 { 10 private AsymmetricKeyParameter publicParam; 11 private AsymmetricKeyParameter privateParam; 12 13 /** 14 * basic constructor. 15 * 16 * @param publicParam a public key parameters object. 17 * @param privateParam the corresponding private key parameters. 18 */ 19 public AsymmetricCipherKeyPair( 20 AsymmetricKeyParameter publicParam, 21 AsymmetricKeyParameter privateParam) 22 { 23 this.publicParam = publicParam; 24 this.privateParam = privateParam; 25 } 26 27 /** 28 * basic constructor. 29 * 30 * @param publicParam a public key parameters object. 31 * @param privateParam the corresponding private key parameters. 32 * @deprecated use AsymmetricKeyParameter 33 */ 34 public AsymmetricCipherKeyPair( 35 CipherParameters publicParam, 36 CipherParameters privateParam) 37 { 38 this.publicParam = (AsymmetricKeyParameter)publicParam; 39 this.privateParam = (AsymmetricKeyParameter)privateParam; 40 } 41 42 /** 43 * return the public key parameters. 44 * 45 * @return the public key parameters. 46 */ 47 public AsymmetricKeyParameter getPublic() 48 { 49 return publicParam; 50 } 51 52 /** 53 * return the private key parameters. 54 * 55 * @return the private key parameters. 56 */ 57 public AsymmetricKeyParameter getPrivate() 58 { 59 return privateParam; 60 } 61 } 62