1 22 package javax.security.auth.message.callback; 23 24 import java.math.BigInteger ; 25 import java.security.PrivateKey ; 26 import java.security.cert.Certificate ; 27 28 import javax.security.auth.callback.Callback ; 29 import javax.security.auth.x500.X500Principal ; 30 31 33 40 public class PrivateKeyCallback implements Callback 41 { 42 45 public static interface Request 46 { 47 } 48 49 50 53 public static class AliasRequest implements Request 54 { 55 private String alias = null; 56 57 65 public AliasRequest(String alias) 66 { 67 this.alias = alias; 68 } 69 70 74 public String getAlias() 75 { 76 return alias; 77 } 78 } 79 80 83 public static class IssuerSerialNumRequest 84 { 85 private X500Principal issuer; 86 private java.math.BigInteger serialNumber; 87 88 94 public IssuerSerialNumRequest(X500Principal issuer, BigInteger serialNumber) 95 { 96 this.issuer = issuer; 97 this.serialNumber = serialNumber; 98 } 99 100 104 public X500Principal getIssuer() 105 { 106 return issuer; 107 } 108 109 113 public BigInteger getSerialNumber() 114 { 115 return serialNumber; 116 } 117 } 118 121 public static class SubjectKeyIDRequest 122 { 123 private byte[] subjectKeyID; 124 125 136 public SubjectKeyIDRequest(byte[] keyID) 137 { 138 subjectKeyID = keyID; 139 } 140 141 145 public byte[] getSubjectKeyID() 146 { 147 return subjectKeyID; 148 } 149 } 150 151 private Request request = null; 153 private Certificate [] chain = null; 154 private PrivateKey key = null; 155 156 167 public PrivateKeyCallback(Request request) 168 { 169 this.request = request; 170 } 171 172 176 public Certificate [] getChain() 177 { 178 return chain; 179 } 180 181 185 public PrivateKey getKey() 186 { 187 return key; 188 } 189 190 195 public Request getRequest() 196 { 197 return request; 198 } 199 200 208 public void setKey(PrivateKey key, Certificate [] chain) 209 { 210 this.key = key; 211 this.chain = chain; 212 } 213 } 214 | Popular Tags |