keyrecoverycaserviceresponse.java

来自「一套JAVA的CA证书签发系统.」· Java 代码 · 共 73 行

JAVA
73
字号
/************************************************************************* *                                                                       * *  EJBCA: The OpenSource Certificate Authority                          * *                                                                       * *  This software is free software; you can redistribute it and/or       * *  modify it under the terms of the GNU Lesser General Public           * *  License as published by the Free Software Foundation; either         * *  version 2.1 of the License, or any later version.                    * *                                                                       * *  See terms of license at gnu.org.                                     * *                                                                       * *************************************************************************/ package se.anatom.ejbca.ca.caadmin.extendedcaservices;import java.io.Serializable;import java.security.KeyPair;/** * Class used when delevering key recovery service response from a CA.   * * @version $Id: KeyRecoveryCAServiceResponse.java,v 1.2 2004/04/16 07:38:57 anatom Exp $ */public class KeyRecoveryCAServiceResponse extends ExtendedCAServiceResponse implements Serializable {                 	public final static int TYPE_ENCRYPTKEYSRESPONSE = 1;	public final static int TYPE_DECRYPTKEYSRESPONSE = 1;        private int type;    private byte[] keydata;    private KeyPair keypair;	    public KeyRecoveryCAServiceResponse(int type, byte[] keydata) {       this.type=type;       this.keydata=keydata;    }         public KeyRecoveryCAServiceResponse(int type, KeyPair keypair) {    	this.type=type;    	this.keypair=keypair;    }                 /**     * @return type of response, one of the TYPE_ constants.     */    public int getType(){    	return type;    }        /**     *  Method returning the encrypted key data if the type of response      *  is TYPE_ENCRYPTRESPONSE, null otherwise.     */        public byte[] getKeyData(){    	if(type != TYPE_ENCRYPTKEYSRESPONSE)    		return null;    	return keydata;    }    /**     *  Method returning the decrypted keypair if the type of response      *  is TYPE_DECRYPTRESPONSE, null otherwise.     */    public KeyPair getKeyPair(){    	if(type != TYPE_DECRYPTKEYSRESPONSE)    		return null;    	return keypair;    	    }        }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?