FileDocCategorySizeDatePackage
KeyStoreResolver.javaAPI DocJava SE 6 API4051Tue Jun 10 00:23:02 BST 2008com.sun.org.apache.xml.internal.security.keys.storage.implementations

KeyStoreResolver

public class KeyStoreResolver extends StorageResolverSpi
Makes the Certificates from a JAVA {@link KeyStore} object available to the {@link com.sun.org.apache.xml.internal.security.keys.storage.StorageResolver}.
author
$Author: raul $

Fields Summary
KeyStore
_keyStore
Field _keyStore
Iterator
_iterator
Field _iterator
Constructors Summary
public KeyStoreResolver(KeyStore keyStore)
Constructor KeyStoreResolver

param
keyStore is the keystore which contains the Certificates
throws
StorageResolverException


                    
        
      this._keyStore = keyStore;
      this._iterator = new KeyStoreIterator(this._keyStore);
   
Methods Summary
public java.util.IteratorgetIterator()

inheritDoc

      return this._iterator;
   
public static voidmain(java.lang.String[] unused)
Method main

param
unused
throws
Exception


      KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());

      ks.load(
         new java.io.FileInputStream(
         "data/com/sun/org/apache/xml/internal/security/samples/input/keystore.jks"),
            "xmlsecurity".toCharArray());

      KeyStoreResolver krs = new KeyStoreResolver(ks);

      for (Iterator i = krs.getIterator(); i.hasNext(); ) {
         X509Certificate cert = (X509Certificate) i.next();
         byte[] ski =
            com.sun.org.apache.xml.internal.security.keys.content.x509.XMLX509SKI
               .getSKIBytesFromCert(cert);

         System.out.println(com.sun.org.apache.xml.internal.security.utils.Base64.encode(ski));
      }