1 13 14 package org.ejbca.core.model.ca.catoken; 15 16 import java.security.PrivateKey ; 17 import java.security.PublicKey ; 18 import java.util.HashMap ; 19 20 21 26 public class NullCAToken extends CAToken implements java.io.Serializable { 27 28 public static final float LATEST_VERSION = 1; 29 30 31 public NullCAToken(){ 32 data = new HashMap (); 33 data.put(CATOKENTYPE, new Integer (CATokenInfo.CATOKENTYPE_NULL)); 34 data.put(VERSION, new Float (LATEST_VERSION)); 35 } 36 37 public NullCAToken(HashMap data) { 38 39 } 40 41 44 public void generateKeys(CATokenInfo catokeninfo) throws Exception { 45 } 47 48 49 50 public CATokenInfo getCATokenInfo(){ 51 return new NullCATokenInfo(); 52 } 53 54 57 public void updateCATokenInfo(CATokenInfo catokeninfo){ 58 } 59 60 64 public PrivateKey getPrivateKey(int purpose){ 65 return null; 66 } 67 68 72 public PublicKey getPublicKey(int purpose){ 73 return null; 74 } 75 76 77 81 public String getProvider(){ 82 return "BC"; 83 } 84 85 86 public float getLatestVersion(){ 87 return LATEST_VERSION; 88 } 89 90 91 92 public void upgrade(){ 93 if(Float.compare(LATEST_VERSION, getVersion()) != 0) { 94 96 data.put(VERSION, new Float (LATEST_VERSION)); 97 } 98 } 99 100 103 public void activate(String authenticationcode) throws CATokenAuthenticationFailedException, CATokenOfflineException { 104 } 106 107 110 public boolean deactivate() { 111 return true; 113 } 114 115 116 } 117 118 | Popular Tags |