1 2 18 package com.sun.org.apache.xml.internal.security.keys.storage.implementations; 19 20 21 22 import java.security.cert.X509Certificate ; 23 import java.util.Iterator ; 24 25 import com.sun.org.apache.xml.internal.security.keys.storage.StorageResolverSpi; 26 27 28 34 public class SingleCertificateResolver extends StorageResolverSpi { 35 36 37 X509Certificate _certificate = null; 38 39 40 Iterator _iterator = null; 41 42 47 public SingleCertificateResolver(X509Certificate x509cert) { 48 this._certificate = x509cert; 49 this._iterator = new InternalIterator(this._certificate); 50 } 51 52 53 public Iterator getIterator() { 54 return this._iterator; 55 } 56 57 63 class InternalIterator implements Iterator { 64 65 66 boolean _alreadyReturned = false; 67 68 69 X509Certificate _certificate = null; 70 71 76 public InternalIterator(X509Certificate x509cert) { 77 this._certificate = x509cert; 78 } 79 80 81 public boolean hasNext() { 82 return (!this._alreadyReturned); 83 } 84 85 86 public Object next() { 87 88 this._alreadyReturned = true; 89 90 return this._certificate; 91 } 92 93 97 public void remove() { 98 throw new UnsupportedOperationException ( 99 "Can't remove keys from KeyStore"); 100 } 101 } 102 } 103 | Popular Tags |