Merge branch '1.x' of ssh://authdev.it.ohio-state.edu/~scantor/git/cpp-xmltooling...
[shibboleth/cpp-xmltooling.git] / xmltooling / security / CredentialCriteria.h
index c7b711d..e1b65e6 100644 (file)
@@ -1,17 +1,21 @@
-/*
- *  Copyright 2001-2009 Internet2
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/**
+ * Licensed to the University Corporation for Advanced Internet
+ * Development, Inc. (UCAID) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for
+ * additional information regarding copyright ownership.
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ * UCAID licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the
+ * License at
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific
+ * language governing permissions and limitations under the License.
  */
 
 /**
@@ -102,12 +106,13 @@ namespace xmltooling {
         /**
          * Set the key algorithm criteria.
          * 
-         * @param keyAlgorithm The key algorithm to set
+         * @param keyAlgorithm the key algorithm to set
          */
         void setKeyAlgorithm(const char* keyAlgorithm);
 
         /**
          * Get the key size criteria.
+         * <p>If a a maximum size is also set, this is treated as a minimum.
          *
          * @return  the key size, or 0
          */
@@ -115,11 +120,26 @@ namespace xmltooling {
 
         /**
          * Set the key size criteria.
+         * <p>If a a maximum size is also set, this is treated as a minimum.
          *
-         * @param keySize Key size to set
+         * @param keySize key size to set
          */
         void setKeySize(unsigned int keySize);
-    
+
+        /**
+         * Get the maximum key size criteria.
+         *
+         * @return  the maximum key size, or 0
+         */
+        unsigned int getMaxKeySize() const;
+
+        /**
+         * Set the maximum key size criteria.
+         *
+         * @param keySize maximum key size to set
+         */
+        void setMaxKeySize(unsigned int keySize);
+
         /**
          * Set the key algorithm and size criteria based on an XML algorithm specifier.
          *
@@ -205,9 +225,14 @@ namespace xmltooling {
          */
         void setSignature(const xmlsignature::Signature& sig, int extraction=0);
 
+        /**
+         * Resets object to a default state.
+         */
+        virtual void reset();
+
     private:
         unsigned int m_keyUsage;
-        unsigned int m_keySize;
+        unsigned int m_keySize,m_maxKeySize;
         std::string m_peerName,m_keyAlgorithm;
         std::set<std::string> m_keyNames;
         XSECCryptoKey* m_key;