[java-opensaml COMMIT] in /trunk: opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/encryption/EncryptedElement...

noreply at shibboleth.net noreply at shibboleth.net
Wed May 28 21:40:41 EDT 2014


Author: putmanb
Date: Wed May 28 21:40:41 2014
New Revision: 3901

URL: http://svn.shibboleth.net/view/java-opensaml?rev=3901&view=rev
Log:
For EncryptedKeyResolver impls, add an overload constructor that takes a single String recipient.

Modified:
    trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/encryption/EncryptedElementTypeEncryptedKeyResolver.java
    trunk/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/encryption/support/AbstractEncryptedKeyResolver.java
    trunk/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/encryption/support/ChainingEncryptedKeyResolver.java
    trunk/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/encryption/support/InlineEncryptedKeyResolver.java
    trunk/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/encryption/support/SimpleKeyInfoReferenceEncryptedKeyResolver.java
    trunk/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/encryption/support/SimpleRetrievalMethodEncryptedKeyResolver.java

Modified: trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/encryption/EncryptedElementTypeEncryptedKeyResolver.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/encryption/EncryptedElementTypeEncryptedKeyResolver.java?rev=3901&r1=3900&r2=3901&view=diff
==============================================================================
--- trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/encryption/EncryptedElementTypeEncryptedKeyResolver.java (original)
+++ trunk/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/encryption/EncryptedElementTypeEncryptedKeyResolver.java Wed May 28 21:40:41 2014
@@ -29,6 +29,8 @@
 import org.opensaml.xmlsec.encryption.support.AbstractEncryptedKeyResolver;
 import org.opensaml.xmlsec.encryption.support.EncryptedKeyResolver;
 
+import com.google.common.collect.Sets;
+
 /**
  * An implementation of {@link EncryptedKeyResolver} which resolves {@link EncryptedKey}
  * elements which appear as immediate children of the {@link EncryptedElementType} which 
@@ -41,12 +43,22 @@
         super();
     }
 
-    /** Constructor. 
+    /** 
+     * Constructor. 
      * 
      * @param recipients the set of recipients
      */
     public EncryptedElementTypeEncryptedKeyResolver(@Nullable final Set<String> recipients) {
         super(recipients);
+    }
+
+    /** 
+     * Constructor. 
+     * 
+     * @param recipient the recipient
+     */
+    public EncryptedElementTypeEncryptedKeyResolver(@Nullable final String recipient) {
+        this(Sets.newHashSet(recipient));
     }
 
     /** {@inheritDoc} */

Modified: trunk/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/encryption/support/AbstractEncryptedKeyResolver.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/encryption/support/AbstractEncryptedKeyResolver.java?rev=3901&r1=3900&r2=3901&view=diff
==============================================================================
--- trunk/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/encryption/support/AbstractEncryptedKeyResolver.java (original)
+++ trunk/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/encryption/support/AbstractEncryptedKeyResolver.java Wed May 28 21:40:41 2014
@@ -53,12 +53,27 @@
         recipients = Collections.emptySet();
     }
 
-    /** Constructor. 
+    /** 
+     * Constructor. 
      * 
      * @param newRecipents set of recipients
-     * */
+     */
     public AbstractEncryptedKeyResolver(@Nullable final Set<String> newRecipents) {
         recipients = Sets.newHashSet(StringSupport.normalizeStringCollection(newRecipents));
+    }
+
+    /** 
+     * Constructor. 
+     * 
+     * @param recipient the recipient
+     */
+    public AbstractEncryptedKeyResolver(@Nullable final String recipient) {
+        String trimmed = StringSupport.trimOrNull(recipient);
+        if (trimmed != null) {
+            recipients = Sets.newHashSet(trimmed);
+        } else {
+            recipients = Collections.emptySet();
+        }
     }
 
     /** {@inheritDoc} */

Modified: trunk/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/encryption/support/ChainingEncryptedKeyResolver.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/encryption/support/ChainingEncryptedKeyResolver.java?rev=3901&r1=3900&r2=3901&view=diff
==============================================================================
--- trunk/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/encryption/support/ChainingEncryptedKeyResolver.java (original)
+++ trunk/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/encryption/support/ChainingEncryptedKeyResolver.java Wed May 28 21:40:41 2014
@@ -39,6 +39,7 @@
 import com.google.common.collect.Collections2;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
 
 /**
  * An implementation of {@link EncryptedKeyResolver} which chains multiple other resolver implementations together,

[... 160 lines stripped ...]


More information about the commits mailing list