View Javadoc

1   /*
2    * Copyright [2007] [University Corporation for Advanced Internet Development, Inc.]
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.opensaml.xml.security.credential;
18  
19  import java.util.Map;
20  
21  import org.opensaml.xml.security.CriteriaSet;
22  
23  //TODO amend docs (and impl) for symmetric key storage and retrieval
24  
25  
26  /**
27   * <strong>NOTE:</strong> this class is not yet implemented
28   * A {@link CredentialResolver} that pulls credential information from the file system.
29   * 
30   * This credential resolver attempts to retrieve credential information from the file system. Specifically it will
31   * attempt to find key, cert, and crl information from files within the given directory. The filename must start with
32   * the entity ID and be followed by one of the follow extensions:
33   * 
34   * <ul>
35   * <li>.name - for key names. File must contain a carriage return seperated list of key names</li>
36   * <li>.priv - for private key. File must contain one PEM or DER encoded private key</li>
37   * <li>.pub - for public keys. File must contain one or more PEM or DER encoded private key</li>
38   * <li>.crt - for public certificates. File must contain one or more PEM or DER encoded X.509 certificates</li>
39   * <li>.crl - for certificate revocation lists. File must contain one or more CRLs</li>
40   * </ul>
41   */
42  public class FilesystemCredentialResolver extends AbstractCriteriaFilteringCredentialResolver {
43  
44      /**
45       * Constructor.
46       * 
47       * @param credentialDirectory directory credential information can be found in
48       * @param passwords passwords for encrypted private keys, key is the entity ID, value is the password
49       */
50      public FilesystemCredentialResolver(String credentialDirectory, Map<String, String> passwords) {
51          super();
52      }
53  
54      /** {@inheritDoc} */
55      protected Iterable<Credential> resolveFromSource(CriteriaSet criteriaSet) {
56          throw new UnsupportedOperationException("Functionality not yet implemented");
57      }
58  }