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 KeyRecoveryCAServiceRequest extends ExtendedCAServiceRequest implements Serializable { 26 27 public static final int COMMAND_ENCRYPTKEYS = 1; 28 public static final int COMMAND_DECRYPTKEYS = 2; 29 30 private int command; 31 private byte[] keydata; 32 private KeyPair keypair; 33 35 public KeyRecoveryCAServiceRequest(int command, byte[] keydata) { 36 this.command = command; 37 this.keydata = keydata; 38 } 39 40 42 public KeyRecoveryCAServiceRequest(int command, KeyPair keypair) { 43 this.command = command; 44 this.keypair = keypair; 45 } 46 47 public int getCommand(){ 48 return command; 49 } 50 51 54 55 public byte[] getKeyData(){ 56 if(command != COMMAND_DECRYPTKEYS) 57 return null; 58 return keydata; 59 } 60 61 64 65 public KeyPair getKeyPair(){ 66 if(command != COMMAND_ENCRYPTKEYS) 67 return null; 68 return keypair; 69 } 70 71 } 72 | Popular Tags |