93 * @param baseURI
94 * @param storage
95 * @return resolved public key from the registered from the element.
96 *
97 * @throws KeyResolverException
98 */
99 public PublicKey engineLookupAndResolvePublicKey(
100 Element element, String baseURI, StorageResolver storage
101 ) throws KeyResolverException {
102 KeyResolverSpi tmp = cloneIfNeeded();
103 if (!tmp.engineCanResolve(element, baseURI, storage)) {
104 return null;
105 }
106 return tmp.engineResolvePublicKey(element, baseURI, storage);
107 }
108
109 private KeyResolverSpi cloneIfNeeded() throws KeyResolverException {
110 KeyResolverSpi tmp = this;
111 if (globalResolver) {
112 try {
113 tmp = getClass().newInstance();
114 } catch (InstantiationException e) {
115 throw new KeyResolverException("", e);
116 } catch (IllegalAccessException e) {
117 throw new KeyResolverException("", e);
118 }
119 }
120 return tmp;
121 }
122
123 /**
124 * Method engineResolveCertificate
125 *
126 * @param element
127 * @param baseURI
128 * @param storage
129 * @return resolved X509Certificate key from the registered from the elements
130 *
131 * @throws KeyResolverException
132 */
133 public X509Certificate engineResolveX509Certificate(
|
93 * @param baseURI
94 * @param storage
95 * @return resolved public key from the registered from the element.
96 *
97 * @throws KeyResolverException
98 */
99 public PublicKey engineLookupAndResolvePublicKey(
100 Element element, String baseURI, StorageResolver storage
101 ) throws KeyResolverException {
102 KeyResolverSpi tmp = cloneIfNeeded();
103 if (!tmp.engineCanResolve(element, baseURI, storage)) {
104 return null;
105 }
106 return tmp.engineResolvePublicKey(element, baseURI, storage);
107 }
108
109 private KeyResolverSpi cloneIfNeeded() throws KeyResolverException {
110 KeyResolverSpi tmp = this;
111 if (globalResolver) {
112 try {
113 @SuppressWarnings("deprecation")
114 KeyResolverSpi krs = getClass().newInstance();
115 tmp = krs;
116 } catch (InstantiationException e) {
117 throw new KeyResolverException("", e);
118 } catch (IllegalAccessException e) {
119 throw new KeyResolverException("", e);
120 }
121 }
122 return tmp;
123 }
124
125 /**
126 * Method engineResolveCertificate
127 *
128 * @param element
129 * @param baseURI
130 * @param storage
131 * @return resolved X509Certificate key from the registered from the elements
132 *
133 * @throws KeyResolverException
134 */
135 public X509Certificate engineResolveX509Certificate(
|