1 13 14 package org.ejbca.core.model.ca.caadmin.extendedcaservices; 15 16 import java.io.Serializable ; 17 import java.security.KeyPair ; 18 19 20 25 public class KeyRecoveryCAServiceResponse extends ExtendedCAServiceResponse implements Serializable { 26 27 public static final int TYPE_ENCRYPTKEYSRESPONSE = 1; 28 public static final int TYPE_DECRYPTKEYSRESPONSE = 1; 29 30 private int type; 31 private byte[] keydata; 32 private KeyPair keypair; 33 34 public KeyRecoveryCAServiceResponse(int type, byte[] keydata) { 35 this.type=type; 36 this.keydata=keydata; 37 } 38 39 public KeyRecoveryCAServiceResponse(int type, KeyPair keypair) { 40 this.type=type; 41 this.keypair=keypair; 42 } 43 44 47 public int getType(){ 48 return type; 49 } 50 51 55 56 public byte[] getKeyData(){ 57 if(type != TYPE_ENCRYPTKEYSRESPONSE) 58 return null; 59 return keydata; 60 } 61 62 66 public KeyPair getKeyPair(){ 67 if(type != TYPE_DECRYPTKEYSRESPONSE) 68 return null; 69 return keypair; 70 } 71 72 } 73 | Popular Tags |