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.encryption;
18  
19  import java.util.List;
20  
21  /**
22   * Interface for resolving {@link EncryptedKey} elements based on a particular
23   * {@link EncryptedData} context, primarily for use during the decryption process.
24   * 
25   * The resolved EncryptedKey element(s) will contain the data encryption key used to encrypt
26   * the specified EncryptedData.
27   */
28  public interface EncryptedKeyResolver {
29      
30      /**
31       * Resolve the EncryptedKey elements containing the data encryption key used to 
32       * encrypt the specified EncryptedData element.
33       * 
34       * @param encryptedData  the EncryptedData element context in which to resolve
35       * @return an iterable of EncryptedKey elements
36       */
37      Iterable<EncryptedKey> resolve(EncryptedData encryptedData);
38      
39      /**
40       * Get the list of recipient criteria used by this resolver, and against which a candidate 
41       * EncryptedKey's Recipient attribute is evaluated.
42       * 
43       * @return the list of  recipient criteria
44       */
45      List<String> getRecipients();
46  
47  }