activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1457307 [3/6] - in /activemq/activemq-cpp/trunk/activemq-cpp/src: main/ main/decaf/internal/ main/decaf/internal/net/ main/decaf/internal/security/ main/decaf/internal/security/provider/ main/decaf/internal/security/provider/crypto/ main/d...
Date Sat, 16 Mar 2013 21:14:12 GMT
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Long.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Long.h?rev=1457307&r1=1457306&r2=1457307&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Long.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Long.h Sat Mar 16 21:14:01 2013
@@ -37,20 +37,20 @@ namespace lang{
     public:
 
         /** The size in bits of the primitive long long type */
-        static const int SIZE = 64;
+        static const int SIZE;
 
         /** The maximum value that the primitive type can hold */
-        static const long long MAX_VALUE = (long long)0x7FFFFFFFFFFFFFFFLL;
+        static const long long MAX_VALUE;
 
         /** The minimum value that the primitive type can hold */
-        static const long long MIN_VALUE = (long long)0x8000000000000000LL;
+        static const long long MIN_VALUE;
 
     public:
 
         /**
          * @param value - the primitive long long to wrap
          */
-        Long( long long value );
+        Long(long long value);
 
         /**
          * Constructs a new Long and attempts to convert the given string to an long long
@@ -62,9 +62,10 @@ namespace lang{
          *
          * @throws NumberFormatException if the string is not a a valid 64bit long.
          */
-        Long( const std::string& value );
+        Long(const std::string& value);
 
-        virtual ~Long() {}
+        virtual ~Long() {
+        }
 
         /**
          * Compares this Long instance with another.
@@ -74,13 +75,13 @@ namespace lang{
          * than the passed in value, and -1 if this object represents a value
          * less than the passed in value.
          */
-        virtual int compareTo( const Long& l ) const;
+        virtual int compareTo(const Long& l) const;
 
         /**
          * @param l - the Long object to compare against.
          * @returns true if the two Integer Objects have the same value.
          */
-        bool equals( const Long& l ) const {
+        bool equals(const Long& l) const {
             return this->value == l.value;
         }
 
@@ -89,7 +90,7 @@ namespace lang{
          * @param l - the value to be compared to this one.
          * @return true if this object is equal to the one passed.
          */
-        virtual bool operator==( const Long& l ) const {
+        virtual bool operator==(const Long& l) const {
             return this->value == l.value;
         }
 
@@ -99,7 +100,7 @@ namespace lang{
          * @param l - the value to be compared to this one.
          * @return true if this object is equal to the one passed.
          */
-        virtual bool operator<( const Long& l ) const {
+        virtual bool operator<(const Long& l) const {
             return this->value < l.value;
         }
 
@@ -111,13 +112,13 @@ namespace lang{
          * than the passed in value, and -1 if this object represents a value
          * less than the passed in value.
          */
-        virtual int compareTo( const long long& l ) const;
+        virtual int compareTo(const long long& l) const;
 
         /**
          * @param l - the Long object to compare against.
          * @returns true if the two Integer Objects have the same value.
          */
-        bool equals( const long long& l ) const {
+        bool equals(const long long& l) const {
             return this->value == l;
         }
 
@@ -126,7 +127,7 @@ namespace lang{
          * @param l - the value to be compared to this one.
          * @return true if this object is equal to the one passed.
          */
-        virtual bool operator==( const long long& l ) const {
+        virtual bool operator==(const long long& l) const {
             return this->value == l;
         }
 
@@ -136,7 +137,7 @@ namespace lang{
          * @param l - the value to be compared to this one.
          * @return true if this object is equal to the one passed.
          */
-        virtual bool operator<( const long long& l ) const {
+        virtual bool operator<(const long long& l) const {
             return this->value < l;
         }
 
@@ -150,7 +151,7 @@ namespace lang{
          * @return double the value of the receiver.
          */
         virtual double doubleValue() const {
-            return (double)this->value;
+            return (double) this->value;
         }
 
         /**
@@ -158,7 +159,7 @@ namespace lang{
          * @return float the value of the receiver.
          */
         virtual float floatValue() const {
-            return (float)this->value;
+            return (float) this->value;
         }
 
         /**
@@ -166,7 +167,7 @@ namespace lang{
          * @return int the value of the receiver.
          */
         virtual unsigned char byteValue() const {
-            return (unsigned char)this->value;
+            return (unsigned char) this->value;
         }
 
         /**
@@ -174,7 +175,7 @@ namespace lang{
          * @return int the value of the receiver.
          */
         virtual short shortValue() const {
-            return (short)this->value;
+            return (short) this->value;
         }
 
         /**
@@ -182,7 +183,7 @@ namespace lang{
          * @return int the value of the receiver.
          */
         virtual int intValue() const {
-            return (int)this->value;
+            return (int) this->value;
         }
 
         /**
@@ -203,7 +204,7 @@ namespace lang{
          * @return the number of one-bits in the two's complement binary
          * representation of the specified long long value.
          */
-        static int bitCount( long long value );
+        static int bitCount(long long value);
 
         /**
          * Decodes a String into a Long. Accepts decimal, hexadecimal, and octal
@@ -220,7 +221,7 @@ namespace lang{
          * @returns a Long object containing the decoded value
          * @throws NumberFomatException if the string is not formatted correctly.
          */
-        static Long decode( const std::string& value );
+        static Long decode(const std::string& value);
 
         /**
          * Returns an long long value with at most a single one-bit, in the position
@@ -232,7 +233,7 @@ namespace lang{
          * highest-order one-bit in the specified value, or zero if the specified
          * value is itself equal to zero.
          */
-        static long long highestOneBit( long long value );
+        static long long highestOneBit(long long value);
 
         /**
          * Returns an long long value with at most a single one-bit, in the position
@@ -244,7 +245,7 @@ namespace lang{
          * lowest-order one-bit in the specified value, or zero if the specified
          * value is itself equal to zero.
          */
-        static long long lowestOneBit( long long value );
+        static long long lowestOneBit(long long value);
 
         /**
          * Returns the number of zero bits preceding the highest-order ("leftmost")
@@ -263,7 +264,7 @@ namespace lang{
          * one-bit in the two's complement binary representation of the specified
          * long long value, or 64 if the value is equal to zero.
          */
-        static int numberOfLeadingZeros( long long value );
+        static int numberOfLeadingZeros(long long value);
 
         /**
          * Returns the number of zero bits following the lowest-order ("rightmost")
@@ -275,7 +276,7 @@ namespace lang{
          * one-bit in the two's complement binary representation of the specified
          * long long value, or 64 if the value is equal to zero.
          */
-        static int numberOfTrailingZeros( long long value );
+        static int numberOfTrailingZeros(long long value);
 
         /**
          * Parses the string argument as a signed decimal long. The characters in the
@@ -290,7 +291,7 @@ namespace lang{
          * @return long long value
          * @throws NumberFormatException on invalid string value
          */
-        static long long parseLong( const std::string& value );
+        static long long parseLong(const std::string& value);
 
         /**
          * Returns a Long object holding the value extracted from the specified
@@ -304,7 +305,7 @@ namespace lang{
          * @return long long value
          * @throws NumberFormatException on invalid string value
          */
-        static long long parseLong( const std::string& value, int radix );
+        static long long parseLong(const std::string& value, int radix);
 
         /**
          * Returns the value obtained by reversing the order of the bytes in the
@@ -312,7 +313,7 @@ namespace lang{
          * @param value - the long long whose bytes we are to reverse
          * @return the reversed long long.
          */
-        static long long reverseBytes( long long value );
+        static long long reverseBytes(long long value);
 
         /**
          * Returns the value obtained by reversing the order of the bits in the
@@ -320,7 +321,7 @@ namespace lang{
          * @param value - the value whose bits are to be reversed
          * @returns the reversed bits long long.
          */
-        static long long reverse( long long value );
+        static long long reverse(long long value);
 
         /**
          * Returns the value obtained by rotating the two's complement binary
@@ -339,7 +340,7 @@ namespace lang{
          * representation of the specified value left by the specified number
          * of bits.
          */
-        static long long rotateLeft( long long value, int distance );
+        static long long rotateLeft(long long value, int distance);
 
         /**
          * Returns the value obtained by rotating the two's complement binary
@@ -358,7 +359,7 @@ namespace lang{
          * representation of the specified value right by the specified number
          * of bits.
          */
-        static long long rotateRight( long long value, int distance );
+        static long long rotateRight(long long value, int distance);
 
         /**
          * Returns the signum function of the specified value. (The return value
@@ -367,14 +368,14 @@ namespace lang{
          * @param value - the long long to be inspected
          * @return the signum function of the specified long long value.
          */
-        static int signum( long long value );
+        static int signum(long long value);
 
         /**
          * Converts the long to a String representation
          * @param value The long to convert to a std::string.
          * @return string representation
          */
-        static std::string toString( long long value );
+        static std::string toString(long long value);
 
         /*
          * Returns a string representation of the first argument in the radix
@@ -399,7 +400,7 @@ namespace lang{
          * @param radix - the radix to format the string in
          * @returns an long long formatted to the string value of the radix given.
          */
-        static std::string toString( long long value, int radix );
+        static std::string toString(long long value, int radix);
 
         /**
          * Returns a string representation of the integer argument as an unsigned
@@ -420,7 +421,7 @@ namespace lang{
          * @param value - the long long to be translated to an Octal string
          * @returns the unsigned long long value as a Octal string
          */
-        static std::string toHexString( long long value );
+        static std::string toHexString(long long value);
 
         /**
          * Returns a string representation of the long long argument as an unsigned
@@ -440,7 +441,7 @@ namespace lang{
          * @param value - the long long to be translated to an Octal string
          * @returns the unsigned long long value as a Octal string
          */
-        static std::string toOctalString( long long value );
+        static std::string toOctalString(long long value);
 
         /**
          * Returns a string representation of the long long argument as an unsigned
@@ -457,15 +458,15 @@ namespace lang{
          * @param value - the long long to be translated to a binary string
          * @returns the unsigned long long value as a binary string
          */
-        static std::string toBinaryString( long long value );
+        static std::string toBinaryString(long long value);
 
         /**
          * Returns a Long instance representing the specified int value.
          * @param value - the long long to wrap
          * @return the new Integer object wrapping value.
          */
-        static Long valueOf( long long value ) {
-            return Long( value );
+        static Long valueOf(long long value) {
+            return Long(value);
         }
 
         /**
@@ -478,7 +479,7 @@ namespace lang{
          * @return new Long Object wrapping the primitive
          * @throws NumberFormatException if the string is not a decimal long long.
          */
-        static Long valueOf( const std::string& value );
+        static Long valueOf(const std::string& value);
 
         /**
          * Returns a Long object holding the value extracted from the specified
@@ -492,12 +493,11 @@ namespace lang{
          * @return new Long Object wrapping the primitive
          * @throws NumberFormatException if the string is not a valid long long.
          */
-        static Long valueOf( const std::string& value, int radix );
+        static Long valueOf(const std::string& value, int radix);
 
     private:
 
-        static long long parse( const std::string& value, int offset,
-                                int radix, bool negative );
+        static long long parse(const std::string& value, int offset, int radix, bool negative);
 
     };
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Short.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Short.cpp?rev=1457307&r1=1457306&r2=1457307&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Short.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Short.cpp Sat Mar 16 21:14:01 2013
@@ -25,6 +25,11 @@ using namespace decaf::lang;
 using namespace decaf::lang::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
+const int Short::SIZE = 16;
+const short Short::MAX_VALUE = (short)0x7FFF;
+const short Short::MIN_VALUE = (short)0x8000;
+
+////////////////////////////////////////////////////////////////////////////////
 Short::Short( short value ) : value(value) {
 }
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Short.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Short.h?rev=1457307&r1=1457306&r2=1457307&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Short.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Short.h Sat Mar 16 21:14:01 2013
@@ -38,13 +38,13 @@ namespace lang{
     public:
 
         /** Size of this objects primitive type in bits */
-        static const int SIZE = 16;
+        static const int SIZE;
 
         /** Max Value for this Object's primitive type */
-        static const short MAX_VALUE = (short)0x7FFF;
+        static const short MAX_VALUE;
 
         /** Max Value for this Object's primitive type */
-        static const short MIN_VALUE = (short)0x8000;
+        static const short MIN_VALUE;
 
     public:
 

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/exceptions/CloneNotSupportedException.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/exceptions/CloneNotSupportedException.cpp?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/exceptions/CloneNotSupportedException.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/exceptions/CloneNotSupportedException.cpp Sat Mar 16 21:14:01 2013
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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
+ *
+ *     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.
+ */
+
+#include "CloneNotSupportedException.h"
+
+using namespace decaf;
+using namespace decaf::lang;
+using namespace decaf::lang::exceptions;
+
+////////////////////////////////////////////////////////////////////////////////
+CloneNotSupportedException::CloneNotSupportedException() : Exception() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+CloneNotSupportedException::~CloneNotSupportedException() throw () {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+CloneNotSupportedException::CloneNotSupportedException(const Exception& ex) : Exception() {
+    *(Exception*) this = ex;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+CloneNotSupportedException::CloneNotSupportedException(const CloneNotSupportedException& ex) : Exception() {
+    *(Exception*) this = ex;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+CloneNotSupportedException::CloneNotSupportedException(const std::exception* cause) : Exception(cause) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+CloneNotSupportedException::CloneNotSupportedException(const char* file, const int lineNumber, const char* msg, ...) : Exception() {
+
+    va_list vargs;
+    va_start(vargs, msg);
+    buildMessage(msg, vargs);
+
+    // Set the first mark for this exception.
+    setMark(file, lineNumber);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+CloneNotSupportedException::CloneNotSupportedException(const char* file, const int lineNumber, const std::exception* cause, const char* msg, ...) : Exception(cause) {
+
+    va_list vargs;
+    va_start(vargs, msg);
+    buildMessage(msg, vargs);
+
+    // Set the first mark for this exception.
+    setMark(file, lineNumber);
+}

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/exceptions/CloneNotSupportedException.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/exceptions/CloneNotSupportedException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/exceptions/CloneNotSupportedException.h?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/exceptions/CloneNotSupportedException.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/exceptions/CloneNotSupportedException.h Sat Mar 16 21:14:01 2013
@@ -0,0 +1,116 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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
+ *
+ *     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.
+ */
+#ifndef _DECAF_LANG_EXCEPTIONS_CLONENOTSUPPORTEDEXCEPTION_H_
+#define _DECAF_LANG_EXCEPTIONS_CLONENOTSUPPORTEDEXCEPTION_H_
+
+#include <decaf/lang/Exception.h>
+
+namespace decaf {
+namespace lang {
+namespace exceptions {
+
+    /*
+     * Thrown when a subclass of some class that defines a clone method does not support
+     * object cloning.
+     *
+     * @since 1.0
+     */
+    class DECAF_API CloneNotSupportedException : public Exception {
+    public:
+
+        /**
+         * Default Constructor
+         */
+        CloneNotSupportedException();
+
+        /**
+         * Conversion Constructor from some other Exception
+         *
+         * @param ex
+         *      The Exception whose data is to be copied into this one.
+         */
+        CloneNotSupportedException(const Exception& ex);
+
+        /**
+         * Copy Constructor
+         *
+         * @param ex
+         *      The Exception whose data is to be copied into this one.
+         */
+        CloneNotSupportedException(const CloneNotSupportedException& ex);
+
+        /**
+         * Constructor
+         *
+         * @param cause
+         *      Pointer to the exception that caused this one to
+         *      be thrown, the object is cloned caller retains ownership.
+         */
+        CloneNotSupportedException(const std::exception* cause);
+
+        /**
+         * Constructor - Initializes the file name and line number where
+         * this message occurred.  Sets the message to report, using an
+         * optional list of arguments to parse into the message
+         *
+         * @param file
+         *      The file name where exception occurs
+         * @param lineNumber
+         *      The line number where the exception occurred.
+         * @param msg
+         *      The message to report
+         * @param ...
+         *      list of primitives that are formatted into the message
+         */
+        CloneNotSupportedException(const char* file, const int lineNumber, const char* msg, ...);
+
+        /**
+         * Constructor - Initializes the file name and line number where
+         * this message occurred.  Sets the message to report, using an
+         * optional list of arguments to parse into the message
+         *
+         * @param file
+         *      The file name where exception occurs
+         * @param lineNumber
+         *      The line number where the exception occurred.
+         * @param cause
+         *      The exception that was the cause for this one to be thrown.
+         * @param msg
+         *      The message to report
+         * @param ...
+         *      list of primitives that are formatted into the message
+         */
+        CloneNotSupportedException(const char* file, const int lineNumber, const std::exception* cause, const char* msg, ...);
+
+        /**
+         * Clones this exception.  This is useful for cases where you need
+         * to preserve the type of the original exception as well as the message.
+         * All subclasses should override.
+         *
+         * @return an new Exception instance that is a copy of this one.
+         */
+        virtual CloneNotSupportedException* clone() const {
+            return new CloneNotSupportedException(*this);
+        }
+
+        virtual ~CloneNotSupportedException() throw();
+
+    };
+
+}}}
+
+#endif /*_DECAF_LANG_EXCEPTIONS_CLASSCASTEXCEPTION_H_*/

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/exceptions/CloneNotSupportedException.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/DigestException.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/DigestException.cpp?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/DigestException.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/DigestException.cpp Sat Mar 16 21:14:01 2013
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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
+ *
+ *     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.
+ */
+
+#include "DigestException.h"
+
+using namespace decaf;
+using namespace decaf::security;
+
+////////////////////////////////////////////////////////////////////////////////
+DigestException::DigestException() : GeneralSecurityException() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+DigestException::DigestException(const Exception& ex) : GeneralSecurityException() {
+    *(Exception*) this = ex;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+DigestException::DigestException(const DigestException& ex) : GeneralSecurityException() {
+    *(Exception*) this = ex;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+DigestException::DigestException(const char* file, const int lineNumber, const std::exception* cause, const char* msg, ...) : GeneralSecurityException(cause) {
+
+    va_list vargs;
+    va_start(vargs, msg);
+    buildMessage(msg, vargs);
+
+    // Set the first mark for this exception.
+    setMark(file, lineNumber);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+DigestException::DigestException(const std::exception* cause) : GeneralSecurityException(cause) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+DigestException::DigestException(const char* file, const int lineNumber, const char* msg, ...) : GeneralSecurityException() {
+
+    va_list vargs;
+    va_start(vargs, msg);
+    buildMessage(msg, vargs);
+
+    // Set the first mark for this exception.
+    setMark(file, lineNumber);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+DigestException::~DigestException() throw () {
+}

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/DigestException.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/DigestException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/DigestException.h?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/DigestException.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/DigestException.h Sat Mar 16 21:14:01 2013
@@ -0,0 +1,113 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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
+ *
+ *     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.
+ */
+
+#ifndef _DECAF_SECURITY_DIGESTEXCEPTION_H_
+#define _DECAF_SECURITY_DIGESTEXCEPTION_H_
+
+#include <decaf/security/GeneralSecurityException.h>
+
+namespace decaf {
+namespace security {
+
+    /*
+     * This exception is thrown when a particular cryptographic algorithm is
+     * requested but is not available in the environment.
+     */
+    class DECAF_API DigestException : public GeneralSecurityException {
+    public:
+
+        /**
+         * Default Constructor
+         */
+        DigestException();
+
+        /**
+         * Conversion Constructor from some other Exception
+         *
+         * @param ex
+         *      An exception that should become this type of Exception
+         */
+        DigestException(const Exception& ex);
+
+        /**
+         * Copy Constructor
+         * @param ex
+         *      An exception that should become this type of Exception
+         */
+        DigestException(const DigestException& ex);
+
+        /**
+         * Constructor - Initializes the file name and line number where
+         * this message occurred.  Sets the message to report, using an
+         * optional list of arguments to parse into the message.
+         *
+         * @param file
+         *      The file name where exception occurs
+         * @param lineNumber
+         *      The line number where the exception occurred.
+         * @param cause
+         *      The exception that was the cause for this one to be thrown.
+         * @param msg
+         *      The message to report
+         * @param ...
+         *      list of primitives that are formatted into the message
+         */
+        DigestException(const char* file, const int lineNumber, const std::exception* cause, const char* msg, ...);
+
+        /**
+         * Constructor
+         *
+         * @param cause
+         *      Pointer to the exception that caused this one to
+         *      be thrown, the object is cloned caller retains ownership.
+         */
+        DigestException(const std::exception* cause);
+
+        /**
+         * Constructor - Initializes the file name and line number where
+         * this message occurred.  Sets the message to report, using an
+         * optional list of arguments to parse into the message
+         *
+         * @param file
+         *      name where exception occurs
+         * @param lineNumber
+         *      line number where the exception occurred.
+         * @param msg
+         *      message to report
+         * @param ...
+         *      list of primitives that are formatted into the message
+         */
+        DigestException(const char* file, const int lineNumber, const char* msg, ...);
+
+        /**
+         * Clones this exception.  This is useful for cases where you need
+         * to preserve the type of the original exception as well as the message.
+         * All subclasses should override.
+         *
+         * @return A deep copy of this exception.
+         */
+        virtual DigestException* clone() const {
+            return new DigestException(*this);
+        }
+
+        virtual ~DigestException() throw();
+
+    };
+
+}}
+
+#endif /*_DECAF_SECURITY_DIGESTEXCEPTION_H_*/

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/DigestException.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/GeneralSecurityException.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/GeneralSecurityException.cpp?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/GeneralSecurityException.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/GeneralSecurityException.cpp Sat Mar 16 21:14:01 2013
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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
+ *
+ *     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.
+ */
+
+#include "GeneralSecurityException.h"
+
+using namespace decaf;
+using namespace decaf::security;
+
+////////////////////////////////////////////////////////////////////////////////
+GeneralSecurityException::GeneralSecurityException() {}
+
+////////////////////////////////////////////////////////////////////////////////
+GeneralSecurityException::GeneralSecurityException(const decaf::lang::Exception& ex) : decaf::lang::Exception() {
+    *(decaf::lang::Exception*)this = ex;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+GeneralSecurityException::GeneralSecurityException(const GeneralSecurityException& ex) : decaf::lang::Exception() {
+    *(decaf::lang::Exception*)this = ex;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+GeneralSecurityException::GeneralSecurityException(const char* file, const int lineNumber, const std::exception* cause, const char* msg, ...) :
+    decaf::lang::Exception(cause) {
+
+    va_list vargs;
+    va_start(vargs, msg);
+    buildMessage(msg, vargs);
+
+    // Set the first mark for this exception.
+    setMark(file, lineNumber);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+GeneralSecurityException::GeneralSecurityException( const std::exception* cause ) :
+    decaf::lang::Exception(cause) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+GeneralSecurityException::GeneralSecurityException(const char* file, const int lineNumber, const char* msg, ...) :
+    decaf::lang::Exception() {
+
+    va_list vargs;
+    va_start(vargs, msg);
+    buildMessage(msg, vargs);
+
+    // Set the first mark for this exception.
+    setMark(file, lineNumber);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+GeneralSecurityException::~GeneralSecurityException() throw() {
+}

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/GeneralSecurityException.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/GeneralSecurityException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/GeneralSecurityException.h?rev=1457307&r1=1457306&r2=1457307&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/GeneralSecurityException.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/GeneralSecurityException.h Sat Mar 16 21:14:01 2013
@@ -21,8 +21,8 @@
 #include <decaf/util/Config.h>
 #include <decaf/lang/Exception.h>
 
-namespace decaf{
-namespace security{
+namespace decaf {
+namespace security {
 
     /*
      * The GeneralSecurityException class is a generic security exception class
@@ -35,58 +35,49 @@ namespace security{
         /**
          * Default Constructor
          */
-        GeneralSecurityException() throw() {};
+        GeneralSecurityException();
 
         /**
-         * Conversion Constructor from some other Exception
+         * Conversion Constructor from some other Exception.
+         *
          * @param ex
          *      An exception that should become this type of Exception
          */
-        GeneralSecurityException( const decaf::lang::Exception& ex ) throw()
-        : decaf::lang::Exception()
-        {
-            *(decaf::lang::Exception*)this = ex;
-        }
+        GeneralSecurityException(const decaf::lang::Exception& ex);
 
         /**
          * Copy Constructor
+         *
          * @param ex
          *      An exception that should become this type of Exception
          */
-        GeneralSecurityException(const GeneralSecurityException& ex) throw()
-        : decaf::lang::Exception()
-        {
-            *(decaf::lang::Exception*)this = ex;
-        }
+        GeneralSecurityException(const GeneralSecurityException& ex);
 
         /**
          * Constructor - Initializes the file name and line number where
          * this message occurred.  Sets the message to report, using an
-         * optional list of arguments to parse into the message
-         * @param file The file name where exception occurs
-         * @param lineNumber The line number where the exception occurred.
-         * @param cause The exception that was the cause for this one to be thrown.
-         * @param msg The message to report
-         * @param ... list of primitives that are formatted into the message
-         */
-        GeneralSecurityException( const char* file, const int lineNumber,
-                                  const std::exception* cause,
-                                  const char* msg, ... ) throw() : decaf::lang::Exception( cause )
-        {
-            va_list vargs;
-            va_start( vargs, msg );
-            buildMessage( msg, vargs );
-
-            // Set the first mark for this exception.
-            setMark( file, lineNumber );
-        }
+         * optional list of arguments to parse into the message.
+         *
+         * @param file
+         *      The file name where exception occurs
+         * @param lineNumber
+         *      The line number where the exception occurred.
+         * @param cause
+         *      The exception that was the cause for this one to be thrown.
+         * @param msg
+         *      The message to report
+         * @param ...
+         *      list of primitives that are formatted into the message
+         */
+        GeneralSecurityException(const char* file, const int lineNumber, const std::exception* cause, const char* msg, ... );
 
         /**
          * Constructor
-         * @param cause Pointer to the exception that caused this one to
-         * be thrown, the object is cloned caller retains ownership.
+         * @param cause
+         *      Pointer to the exception that caused this one to
+         *      be thrown, the object is cloned caller retains ownership.
          */
-        GeneralSecurityException( const std::exception* cause ) throw() : decaf::lang::Exception( cause ) {}
+        GeneralSecurityException(const std::exception* cause);
 
         /**
          * Constructor - Initializes the file name and line number where
@@ -102,18 +93,7 @@ namespace security{
          * @param ...
          *      list of primitives that are formatted into the message
          */
-        GeneralSecurityException( const char* file,
-                                  const int lineNumber,
-                                  const char* msg, ...) throw()
-        : decaf::lang::Exception()
-        {
-            va_list vargs;
-            va_start( vargs, msg );
-            buildMessage( msg, vargs );
-
-            // Set the first mark for this exception.
-            setMark( file, lineNumber );
-        }
+        GeneralSecurityException(const char* file, const int lineNumber, const char* msg, ...);
 
         /**
          * Clones this exception.  This is useful for cases where you need
@@ -122,11 +102,11 @@ namespace security{
          *
          * @return A deep copy of this exception.
          */
-        virtual GeneralSecurityException* clone() const{
-            return new GeneralSecurityException( *this );
+        virtual GeneralSecurityException* clone() const {
+            return new GeneralSecurityException(*this);
         }
 
-        virtual ~GeneralSecurityException() throw() {}
+        virtual ~GeneralSecurityException() throw();
 
    };
 

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/InvalidKeyException.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/InvalidKeyException.cpp?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/InvalidKeyException.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/InvalidKeyException.cpp Sat Mar 16 21:14:01 2013
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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
+ *
+ *     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.
+ */
+
+#include "InvalidKeyException.h"
+
+using namespace decaf;
+using namespace decaf::security;
+
+////////////////////////////////////////////////////////////////////////////////
+InvalidKeyException::InvalidKeyException() : KeyException() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+InvalidKeyException::InvalidKeyException(const Exception& ex) : KeyException() {
+    *(Exception*) this = ex;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+InvalidKeyException::InvalidKeyException(const InvalidKeyException& ex) : KeyException() {
+    *(Exception*) this = ex;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+InvalidKeyException::InvalidKeyException(const char* file, const int lineNumber, const std::exception* cause, const char* msg, ...) : KeyException(cause) {
+
+    va_list vargs;
+    va_start(vargs, msg);
+    buildMessage(msg, vargs);
+
+    // Set the first mark for this exception.
+    setMark(file, lineNumber);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+InvalidKeyException::InvalidKeyException(const std::exception* cause) : KeyException(cause) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+InvalidKeyException::InvalidKeyException(const char* file, const int lineNumber, const char* msg, ...) : KeyException() {
+
+    va_list vargs;
+    va_start(vargs, msg);
+    buildMessage(msg, vargs);
+
+    // Set the first mark for this exception.
+    setMark(file, lineNumber);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+InvalidKeyException::~InvalidKeyException() throw () {
+}

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/InvalidKeyException.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/InvalidKeyException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/InvalidKeyException.h?rev=1457307&r1=1457306&r2=1457307&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/InvalidKeyException.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/InvalidKeyException.h Sat Mar 16 21:14:01 2013
@@ -18,10 +18,11 @@
 #ifndef _DECAF_SECURITY_INVALIDKEYEXCEPTION_H_
 #define _DECAF_SECURITY_INVALIDKEYEXCEPTION_H_
 
+#include <decaf/util/Config.h>
 #include <decaf/security/KeyException.h>
 
-namespace decaf{
-namespace security{
+namespace decaf {
+namespace security {
 
     /*
      * This is the exception for invalid Keys (invalid encoding, wrong length,
@@ -33,29 +34,23 @@ namespace security{
         /**
          * Default Constructor
          */
-        InvalidKeyException() throw() {};
+        InvalidKeyException();
 
         /**
          * Conversion Constructor from some other Exception
+         *
          * @param ex
          *      An exception that should become this type of Exception
          */
-        InvalidKeyException(const Exception& ex) throw()
-        : Exception()
-        {
-            *(Exception*)this = ex;
-        }
+        InvalidKeyException(const Exception& ex);
 
         /**
          * Copy Constructor
+         *
          * @param ex
          *      An exception that should become this type of Exception
          */
-        InvalidKeyException(const InvalidKeyException& ex) throw()
-        : Exception()
-        {
-            *(Exception*)this = ex;
-        }
+        InvalidKeyException(const InvalidKeyException& ex);
 
         /**
          * Constructor - Initializes the file name and line number where
@@ -67,28 +62,20 @@ namespace security{
          * @param msg The message to report
          * @param ... list of primitives that are formatted into the message
          */
-        InvalidKeyException( const char* file, const int lineNumber,
-                             const std::exception* cause,
-                             const char* msg, ... ) throw() : Exception( cause )
-        {
-            va_list vargs;
-            va_start( vargs, msg );
-            buildMessage( msg, vargs );
-
-            // Set the first mark for this exception.
-            setMark( file, lineNumber );
-        }
+        InvalidKeyException(const char* file, const int lineNumber, const std::exception* cause, const char* msg, ...);
 
         /**
          * Constructor
-         * @param cause Pointer to the exception that caused this one to
-         * be thrown, the object is cloned caller retains ownership.
+         *
+         * @param cause
+         *      Pointer to the exception that caused this one to
+         *      be thrown, the object is cloned caller retains ownership.
          */
-        InvalidKeyException( const std::exception* cause ) throw() : Exception( cause ) {}
+        InvalidKeyException(const std::exception* cause);
 
         /**
          * Constructor - Initializes the file name and line number where
-         * this message occured.  Sets the message to report, using an
+         * this message occurred.  Sets the message to report, using an
          * optional list of arguments to parse into the message
          *
          * @param file
@@ -100,18 +87,7 @@ namespace security{
          * @param ...
          *      list of primitives that are formatted into the message
          */
-        InvalidKeyException( const char* file,
-                             const int lineNumber,
-                             const char* msg, ...) throw()
-        : Exception()
-        {
-            va_list vargs;
-            va_start(vargs, msg);
-            buildMessage(msg, vargs);
-
-            // Set the first mark for this exception.
-            setMark(file, lineNumber);
-        }
+        InvalidKeyException(const char* file, const int lineNumber, const char* msg, ...);
 
         /**
          * Clones this exception.  This is useful for cases where you need
@@ -120,13 +96,13 @@ namespace security{
          *
          * @return A deep copy of this exception.
          */
-        virtual InvalidKeyException* clone() const{
+        virtual InvalidKeyException* clone() const {
             return new InvalidKeyException(*this);
         }
 
-        virtual ~InvalidKeyException() throw() {}
+        virtual ~InvalidKeyException() throw();
 
-   };
+    };
 
 }}
 

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Key.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Key.cpp?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Key.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Key.cpp Sat Mar 16 21:14:01 2013
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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
+ *
+ *     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.
+ */
+
+#include "Key.h"
+
+using namespace decaf;
+using namespace decaf::security;
+
+////////////////////////////////////////////////////////////////////////////////
+Key::~Key() {
+}

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Key.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Key.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Key.h?rev=1457307&r1=1457306&r2=1457307&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Key.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Key.h Sat Mar 16 21:14:01 2013
@@ -18,9 +18,10 @@
 #ifndef _DECAF_SECURITY_KEY_H
 #define _DECAF_SECURITY_KEY_H
 
+#include <decaf/util/Config.h>
+
 #include <vector>
 #include <string>
-#include <decaf/util/Config.h>
 
 namespace decaf {
 namespace security {
@@ -61,10 +62,9 @@ namespace security {
      * getFormat method.
      */
     class DECAF_API Key {
-
     public:
 
-        virtual ~Key() {}
+        virtual ~Key();
 
         /**
          * Returns the standard algorithm name for this key. For example, "DSA"
@@ -82,7 +82,7 @@ namespace security {
          *      Receives the encoded key, or nothing if the key does not support
          *      encoding.
          */
-        virtual void getEncoded( std::vector<unsigned char>& output) const = 0;
+        virtual void getEncoded(std::vector<unsigned char>& output) const = 0;
 
         /**
          * Returns the name of the primary encoding format of this key, or
@@ -98,6 +98,7 @@ namespace security {
          * @return the primary encoding format of the key.
          */
         virtual std::string getFormat() const = 0;
+
     };
 }}
 

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyException.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyException.cpp?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyException.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyException.cpp Sat Mar 16 21:14:01 2013
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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
+ *
+ *     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.
+ */
+
+#include "KeyException.h"
+
+using namespace decaf;
+using namespace decaf::security;
+
+////////////////////////////////////////////////////////////////////////////////
+KeyException::KeyException() : GeneralSecurityException() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+KeyException::KeyException(const Exception& ex) : GeneralSecurityException() {
+    *(Exception*) this = ex;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+KeyException::KeyException(const KeyException& ex) : GeneralSecurityException() {
+    *(Exception*) this = ex;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+KeyException::KeyException(const char* file, const int lineNumber, const std::exception* cause, const char* msg, ...) : GeneralSecurityException(cause) {
+
+    va_list vargs;
+    va_start(vargs, msg);
+    buildMessage(msg, vargs);
+
+    // Set the first mark for this exception.
+    setMark(file, lineNumber);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+KeyException::KeyException(const std::exception* cause) : GeneralSecurityException(cause) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+KeyException::KeyException(const char* file, const int lineNumber, const char* msg, ...) : GeneralSecurityException() {
+
+    va_list vargs;
+    va_start(vargs, msg);
+    buildMessage(msg, vargs);
+
+    // Set the first mark for this exception.
+    setMark(file, lineNumber);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+KeyException::~KeyException() throw () {
+}

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyException.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyException.h?rev=1457307&r1=1457306&r2=1457307&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyException.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyException.h Sat Mar 16 21:14:01 2013
@@ -21,70 +21,62 @@
 #include <decaf/util/Config.h>
 #include <decaf/security/GeneralSecurityException.h>
 
-namespace decaf{
-namespace security{
+namespace decaf {
+namespace security {
 
     /*
      * A basic key exception
      */
-    class DECAF_API KeyException : public GeneralSecurityException {
+    class DECAF_API KeyException: public GeneralSecurityException {
     public:
 
         /**
          * Default Constructor
          */
-        KeyException() throw() {};
+        KeyException();
 
         /**
          * Conversion Constructor from some other Exception
+         *
          * @param ex
          *      An exception that should become this type of Exception
          */
-        KeyException( const decaf::lang::Exception& ex ) throw()
-        : GeneralSecurityException()
-        {
-            *(Exception*)this = ex;
-        }
+        KeyException(const decaf::lang::Exception& ex);
 
         /**
          * Copy Constructor
+         *
          * @param ex
          *      An exception that should become this type of Exception
          */
-        KeyException( const KeyException& ex ) throw()
-        : GeneralSecurityException()
-        {
-            *(Exception*)this = ex;
-        }
+        KeyException(const KeyException& ex);
 
         /**
          * Constructor - Initializes the file name and line number where
          * this message occurred.  Sets the message to report, using an
-         * optional list of arguments to parse into the message
-         * @param file The file name where exception occurs
-         * @param lineNumber The line number where the exception occurred.
-         * @param cause The exception that was the cause for this one to be thrown.
-         * @param msg The message to report
-         * @param ... list of primitives that are formatted into the message
-         */
-        KeyException( const char* file, const int lineNumber,
-                      const std::exception* cause,
-                      const char* msg, ... ) throw() : GeneralSecurityException( cause )
-        {
-            va_list vargs;
-            va_start( vargs, msg );
-            buildMessage( msg, vargs );
-
-            // Set the first mark for this exception.
-            setMark( file, lineNumber );
-        }
+         * optional list of arguments to parse into the message.
+         *
+         * @param file
+         *      The file name where exception occurs
+         * @param lineNumber
+         *      The line number where the exception occurred.
+         * @param cause
+         *      The exception that was the cause for this one to be thrown.
+         * @param msg
+         *      The message to report
+         * @param ...
+         *      list of primitives that are formatted into the message
+         */
+        KeyException(const char* file, const int lineNumber, const std::exception* cause, const char* msg, ...);
 
         /**
          * Constructor
-         * @param cause Pointer to the exception that caused this one to
-         * be thrown, the object is cloned caller retains ownership.
+         *
+         * @param cause
+         *      Pointer to the exception that caused this one to be
+         *      thrown, the object is cloned caller retains ownership.
          */
-        KeyException( const std::exception* cause ) throw() : GeneralSecurityException( cause ) {}
+        KeyException(const std::exception* cause);
 
         /**
          * Constructor - Initializes the file name and line number where
@@ -100,16 +92,7 @@ namespace security{
          * @param ...
          *      list of primitives that are formatted into the message
          */
-        KeyException( const char* file, const int lineNumber, const char* msg, ...) throw()
-        : GeneralSecurityException()
-        {
-            va_list vargs;
-            va_start(vargs, msg);
-            buildMessage( msg, vargs );
-
-            // Set the first mark for this exception.
-            setMark( file, lineNumber );
-        }
+        KeyException(const char* file, const int lineNumber, const char* msg, ...);
 
         /**
          * Clones this exception.  This is useful for cases where you need
@@ -118,13 +101,13 @@ namespace security{
          *
          * @return A deep copy of this exception.
          */
-        virtual KeyException* clone() const{
+        virtual KeyException* clone() const {
             return new KeyException(*this);
         }
 
-        virtual ~KeyException() throw() {}
+        virtual ~KeyException() throw();
 
-   };
+    };
 
 }}
 

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyManagementException.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyManagementException.cpp?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyManagementException.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyManagementException.cpp Sat Mar 16 21:14:01 2013
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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
+ *
+ *     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.
+ */
+
+#include "KeyManagementException.h"
+
+using namespace decaf;
+using namespace decaf::security;
+
+////////////////////////////////////////////////////////////////////////////////
+KeyManagementException::KeyManagementException() : KeyException() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+KeyManagementException::KeyManagementException(const Exception& ex) : KeyException() {
+    *(Exception*) this = ex;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+KeyManagementException::KeyManagementException(const KeyManagementException& ex) : KeyException() {
+    *(Exception*) this = ex;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+KeyManagementException::KeyManagementException(const char* file, const int lineNumber, const std::exception* cause, const char* msg, ...) : KeyException(cause) {
+
+    va_list vargs;
+    va_start(vargs, msg);
+    buildMessage(msg, vargs);
+
+    // Set the first mark for this exception.
+    setMark(file, lineNumber);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+KeyManagementException::KeyManagementException(const std::exception* cause) : KeyException(cause) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+KeyManagementException::KeyManagementException(const char* file, const int lineNumber, const char* msg, ...) : KeyException() {
+
+    va_list vargs;
+    va_start(vargs, msg);
+    buildMessage(msg, vargs);
+
+    // Set the first mark for this exception.
+    setMark(file, lineNumber);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+KeyManagementException::~KeyManagementException() throw () {
+}

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyManagementException.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyManagementException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyManagementException.h?rev=1457307&r1=1457306&r2=1457307&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyManagementException.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/KeyManagementException.h Sat Mar 16 21:14:01 2013
@@ -21,8 +21,8 @@
 #include <decaf/util/Config.h>
 #include <decaf/security/KeyException.h>
 
-namespace decaf{
-namespace security{
+namespace decaf {
+namespace security {
 
     /*
      * A basic key exception
@@ -33,58 +33,50 @@ namespace security{
         /**
          * Default Constructor
          */
-        KeyManagementException() throw() {};
+        KeyManagementException();
 
         /**
          * Conversion Constructor from some other Exception
+         *
          * @param ex
          *      An exception that should become this type of Exception
          */
-        KeyManagementException(const Exception& ex) throw()
-        : KeyException()
-        {
-            *(Exception*)this = ex;
-        }
+        KeyManagementException(const Exception& ex);
 
         /**
          * Copy Constructor
+         *
          * @param ex
          *      An exception that should become this type of Exception
          */
-        KeyManagementException(const KeyManagementException& ex) throw()
-        : KeyException()
-        {
-            *(Exception*)this = ex;
-        }
+        KeyManagementException(const KeyManagementException& ex);
 
         /**
          * Constructor - Initializes the file name and line number where
          * this message occurred.  Sets the message to report, using an
          * optional list of arguments to parse into the message
-         * @param file The file name where exception occurs
-         * @param lineNumber The line number where the exception occurred.
-         * @param cause The exception that was the cause for this one to be thrown.
-         * @param msg The message to report
-         * @param ... list of primitives that are formatted into the message
-         */
-        KeyManagementException( const char* file, const int lineNumber,
-                                const std::exception* cause,
-                                const char* msg, ... ) throw() : KeyException( cause )
-        {
-            va_list vargs;
-            va_start( vargs, msg );
-            buildMessage( msg, vargs );
-
-            // Set the first mark for this exception.
-            setMark( file, lineNumber );
-        }
+         *
+         * @param file
+         *      The file name where exception occurs
+         * @param lineNumber
+         *      The line number where the exception occurred.
+         * @param cause
+         *      The exception that was the cause for this one to be thrown.
+         * @param msg
+         *      The message to report
+         * @param ...
+         *      list of primitives that are formatted into the message
+         */
+        KeyManagementException(const char* file, const int lineNumber, const std::exception* cause, const char* msg, ... );
 
         /**
          * Constructor
-         * @param cause Pointer to the exception that caused this one to
-         * be thrown, the object is cloned caller retains ownership.
+         *
+         * @param cause
+         *      Pointer to the exception that caused this one to
+         *      be thrown, the object is cloned caller retains ownership.
          */
-        KeyManagementException( const std::exception* cause ) throw() : KeyException( cause ) {}
+        KeyManagementException(const std::exception* cause);
 
         /**
          * Constructor - Initializes the file name and line number where
@@ -100,16 +92,7 @@ namespace security{
          * @param ...
          *      list of primitives that are formatted into the message
          */
-        KeyManagementException( const char* file, const int lineNumber, const char* msg, ...) throw()
-        : KeyException()
-        {
-            va_list vargs;
-            va_start(vargs, msg);
-            buildMessage(msg, vargs);
-
-            // Set the first mark for this exception.
-            setMark(file, lineNumber);
-        }
+        KeyManagementException(const char* file, const int lineNumber, const char* msg, ...);
 
         /**
          * Clones this exception.  This is useful for cases where you need
@@ -122,7 +105,7 @@ namespace security{
             return new KeyManagementException(*this);
         }
 
-        virtual ~KeyManagementException() throw() {}
+        virtual ~KeyManagementException() throw();
 
    };
 

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/MessageDigest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/MessageDigest.cpp?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/MessageDigest.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/MessageDigest.cpp Sat Mar 16 21:14:01 2013
@@ -0,0 +1,174 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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
+ *
+ *     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.
+ */
+
+#include "MessageDigest.h"
+
+#include <decaf/security/MessageDigestSpi.h>
+#include <decaf/security/Provider.h>
+#include <decaf/security/NoSuchAlgorithmException.h>
+#include <decaf/lang/exceptions/CloneNotSupportedException.h>
+#include <decaf/internal/security/Engine.h>
+#include <decaf/lang/Pointer.h>
+
+using namespace decaf;
+using namespace decaf::lang;
+using namespace decaf::lang::exceptions;
+using namespace decaf::security;
+using namespace decaf::internal::security;
+
+////////////////////////////////////////////////////////////////////////////////
+namespace decaf {
+namespace security {
+
+    class MessageDigestImpl {
+    public:
+    };
+}}
+
+////////////////////////////////////////////////////////////////////////////////
+MessageDigest::MessageDigest(const std::string& name) : impl(NULL), spi(), provider(), algorithm(name) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+MessageDigest::~MessageDigest() {
+    try {
+        delete this->spi;
+        delete this->impl;
+    }
+    DECAF_CATCHALL_NOTHROW()
+}
+
+////////////////////////////////////////////////////////////////////////////////
+MessageDigest* MessageDigest::getInstance(const std::string& algorithm) {
+
+    if (algorithm.empty()) {
+        throw NoSuchAlgorithmException(__FILE__, __LINE__, "Supplied algorithm string is empty.");
+    }
+
+    static Engine engine("MessageDigest");
+
+    SecuritySpi* newSpi = engine.newInstance(algorithm);
+
+    MessageDigestSpi* spi = dynamic_cast<MessageDigestSpi*>(newSpi);
+    if (spi == NULL) {
+        delete newSpi;
+        throw NoSuchAlgorithmException(__FILE__, __LINE__,
+            "Supplied algorithm not a MessageDigest algorithm.");
+    }
+
+    MessageDigest* digest = new MessageDigest(algorithm);
+    digest->provider = engine.getProvider();
+    digest->spi = spi;
+
+    return digest;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool MessageDigest::isEqual(const std::vector<unsigned char>& digesta,
+                            const std::vector<unsigned char>& digestb) {
+    if (digesta.size() != digestb.size()) {
+        return false;
+    }
+
+    // No early return is allowed to avoid timing attack.
+    // We must not return false until all elements are compared
+    // to keep the computing time constant
+    bool result = true;
+    for (int i = 0; i < (int)digesta.size(); i++) {
+        if (digesta[i] != digestb[i]) {
+            result = false;
+        }
+    }
+    return result;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::vector<unsigned char> MessageDigest::digest() {
+    return this->spi->engineDigest();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+int MessageDigest::digest(unsigned char* input, int size, int offset, int length) {
+    return this->spi->engineDigest(input, size, offset, length);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::vector<unsigned char> MessageDigest::digest(const unsigned char* input, int size) {
+    this->spi->engineUpdate(input, size, 0, size);
+    return this->spi->engineDigest();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::vector<unsigned char> MessageDigest::digest(const std::vector<unsigned char>& input) {
+    this->spi->engineUpdate(input);
+    return this->spi->engineDigest();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void MessageDigest::update(unsigned char input) {
+    this->spi->engineUpdate(input);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void MessageDigest::update(unsigned char* input, int size, int offset, int length) {
+    this->spi->engineUpdate(input, size, offset, length);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void MessageDigest::update(const std::vector<unsigned char>& input) {
+    this->spi->engineUpdate(input);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void MessageDigest::update(nio::ByteBuffer& input) {
+    this->spi->engineUpdate(input);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+int MessageDigest::getDigestLength() const {
+
+    if (!this->spi->isCloneable()) {
+        return 0;
+    }
+
+    return this->spi->engineGetDigestLength();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+MessageDigest* MessageDigest::clone() {
+
+    if (!this->spi->isCloneable()) {
+        throw CloneNotSupportedException(__FILE__, __LINE__,
+                "MessageDigestSpi in use not cloneable.");
+    }
+
+    MessageDigest* clone = new MessageDigest(this->algorithm);
+    clone->provider = this->provider;
+    clone->spi = this->spi->clone();
+
+    return clone;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void MessageDigest::reset() {
+    this->spi->engineReset();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::string MessageDigest::toString() const {
+    return std::string("MESSAGE DIGEST ") + algorithm;
+}

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/MessageDigest.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/MessageDigest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/MessageDigest.h?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/MessageDigest.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/MessageDigest.h Sat Mar 16 21:14:01 2013
@@ -0,0 +1,275 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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
+ *
+ *     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.
+ */
+
+#ifndef _DECAF_SECURITY_MESSAGEDIGEST_H_
+#define _DECAF_SECURITY_MESSAGEDIGEST_H_
+
+#include <decaf/util/Config.h>
+
+#include <decaf/security/MessageDigestSpi.h>
+#include <decaf/nio/ByteBuffer.h>
+
+#include <string>
+
+namespace decaf {
+namespace security {
+
+    class MessageDigestSpi;
+    class MessageDigestImpl;
+    class Provider;
+
+    /**
+     * This MessageDigest class provides applications the functionality of a message digest
+     * algorithm, such as MD5 or SHA. Message digests are secure one-way hash functions that
+     * take arbitrary-sized data and output a fixed-length hash value.
+     *
+     * A MessageDigest object starts out initialized. The data is processed through it using
+     * the update methods. At any point reset can be called to reset the digest. Once all the
+     * data to be updated has been updated, one of the digest methods should be called to
+     * complete the hash computation.
+     *
+     * The digest method can be called once for a given number of updates. After digest has
+     * been called, the MessageDigest object is reset to its initialized state.
+     *
+     * Implementations are free to implement the clone method.  Client applications can test
+     * cloneability by attempting cloning and catching the CloneNotSupportedException:
+     *
+     *   MessageDigest* md = MessageDigest::getInstance("SHA");
+     *
+     *   try {
+     *       md->update(toChapter1);
+     *       MessageDigest* tc1 = md.clone();
+     *       byte[] toChapter1Digest = tc1.digest();
+     *       md.update(toChapter2);
+     *       ...etc.
+     *   } catch (CloneNotSupportedException& ex) {
+     *       throw DigestException("couldn't make digest of partial content");
+     *   }
+     *
+     * Note that if a given implementation is not cloneable, it is still possible to compute
+     * intermediate digests by instantiating several instances, if the number of digests is
+     * known in advance.
+     *
+     * @see MessageDigestSpi
+     *
+     * @since 1.0
+     */
+    class DECAF_API MessageDigest {
+    private:
+
+        MessageDigestImpl* impl;
+
+        MessageDigestSpi* spi;
+        const Provider* provider;
+        std::string algorithm;
+
+    private:
+
+        MessageDigest(const MessageDigest&);
+        MessageDigest& operator= (const MessageDigest&);
+
+    protected:
+
+        MessageDigest(const std::string& name);
+
+    public:
+
+        virtual ~MessageDigest();
+
+        /**
+         * Completes the hash computation by performing final operations such as padding.
+         * The digest is reset after this call is made.
+         */
+        std::vector<unsigned char> digest();
+
+        /**
+         * Completes the hash computation by performing final operations such as padding.
+         * The digest is reset after this call is made.
+         *
+         * @param input
+         *      The output buffer for the computed digest.
+         * @param size
+         *      The size of the given input buffer.
+         * @param offset
+         *      The offset into the output buffer to begin storing the digest.
+         * @param length
+         *      The number of bytes within buf allotted for the digest.
+         *
+         * @returns the number of bytes placed into buffer.
+         *
+         * @throws DigestException if an error occurs.
+         */
+        int digest(unsigned char* input, int size, int offset, int length);
+
+        /**
+         * Performs a final update on the digest using the specified array of bytes, then
+         * completes the digest computation. That is, this method first calls update(input),
+         * passing the input array to the update method, then calls digest().
+         *
+         * @param input
+         *      The input to be updated before the digest is completed.
+         * @param size
+         *      The length in bytes of the input buffer.
+         *
+         * @returns the array of bytes for the resulting hash value.
+         */
+        std::vector<unsigned char> digest(const unsigned char* input, int size);
+
+        /**
+         * Performs a final update on the digest using the specified array of bytes, then
+         * completes the digest computation. That is, this method first calls update(input),
+         * passing the input array to the update method, then calls digest().
+         *
+         * @param input
+         *      The input to be updated before the digest is completed.
+         *
+         * @returns the array of bytes for the resulting hash value.
+         */
+        std::vector<unsigned char> digest(const std::vector<unsigned char>& input);
+
+        /**
+         * Returns a string that identifies the algorithm, independent of implementation
+         * details. The name should be a standard name (such as "SHA", "MD5", etc).
+         *
+         * @returns the algorithm name.
+         */
+        std::string getAlgorithmName() const {
+            return this->algorithm;
+        }
+
+        /**
+         * Returns the Provider associated with this MessageDigest.
+         *
+         * The pointer returned by this method remains the property of the Security framework
+         * and should be deleted by the calling application at any time.
+         *
+         * @return the provider associated with this MessageDigest.
+         */
+        const Provider* getProvider() const {
+            return this->provider;
+        }
+
+        /**
+         * Returns the length of the digest in bytes, or 0 if this operation is not supported
+         * by the provider and the implementation is not cloneable.
+         *
+         * @returns the digest length in bytes, or 0 if this operation is not supported by the
+         *          provider and the implementation is not cloneable.
+         */
+        int getDigestLength() const;
+
+        /**
+         * Returns a clone of this MessageDisgest instance if the MessageDigestSpi in use
+         * is cloneable.
+         *
+         * @returns a clone of this MessageDigest if possible.
+         *
+         * @throws CloneNotSupportedException if the SPI in use cannot be cloned.
+         */
+        MessageDigest* clone();
+
+        /**
+         * Resets the digest for further use.
+         */
+        void reset();
+
+        /**
+         * Returns a string representation of this message digest object.
+         *
+         * @returns a string representation of this message digest object.
+         */
+        std::string toString() const;
+
+        /**
+         * Updates the digest using the specified byte.
+         *
+         * @param input
+         *      The byte with which to update the digest.
+         */
+        void update(unsigned char input);
+
+        /**
+         * Updates the digest using the specified array of bytes, starting at the specified offset.
+         *
+         * @param input
+         *      The array of bytes.
+         * @param input
+         *      The size of the given input buffer.
+         * @param offset
+         *      The offset to start from in the array of bytes.
+         * @param length
+         *      The number of bytes to use, starting at offset.
+         */
+        void update(unsigned char* input, int size, int offset, int len);
+
+        /**
+         * Updates the digest using the specified array of bytes.
+         *
+         * @param input
+         *      The array of bytes to use for the update.
+         */
+        void update(const std::vector<unsigned char>& input);
+
+        /**
+         * Update the digest using the specified ByteBuffer. The digest is updated using
+         * the input.remaining() bytes starting at input.position(). Upon return, the
+         * buffer's position will be equal to its limit; its limit will not have changed.
+         *
+         * @param input
+         *      The input ByteBuffer to use for the update.
+         */
+        void update(nio::ByteBuffer& input);
+
+    public:
+
+        /**
+         * Returns a MessageDigest object that implements the specified digest algorithm.
+         *
+         * This method traverses the list of registered security Providers, starting with the
+         * most preferred Provider. A new MessageDigest object encapsulating the MessageDigestSpi
+         * implementation from the first Provider that supports the specified algorithm is returned.
+         *
+         * Note that the list of registered providers may be retrieved via the
+         * Security.getProviders() method.
+         *
+         * @param algorithm
+         *      The name of the algorithm requested. (MD5, SHA-1, etc)
+         *
+         * @returns a Message Digest object that implements the specified algorithm.
+         * @throws NoSuchAlgorithmException if no Provider supports a MessageDigestSpi implementation
+         *         for the specified algorithm.
+         */
+        static MessageDigest* getInstance(const std::string& algorithm);
+
+        /**
+         * Compares two digests for equality. Does a simple byte compare.
+         *
+         * @param digesta
+         *      The first digest for comparison.
+         * @param digesta
+         *      The second digest for comparison.
+         *
+         * @returns true if the two digests are equal.
+         */
+        static bool isEqual(const std::vector<unsigned char>& digesta,
+                            const std::vector<unsigned char>& digestb);
+
+    };
+
+}}
+
+#endif /* _DECAF_SECURITY_MESSAGEDIGEST_H_ */

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/MessageDigest.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/MessageDigestSpi.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/MessageDigestSpi.cpp?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/MessageDigestSpi.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/MessageDigestSpi.cpp Sat Mar 16 21:14:01 2013
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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
+ *
+ *     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.
+ */
+
+#include "MessageDigestSpi.h"
+
+#include <decaf/lang/exceptions/CloneNotSupportedException.h>
+
+using namespace decaf;
+using namespace decaf::security;
+using namespace decaf::lang::exceptions;
+
+////////////////////////////////////////////////////////////////////////////////
+MessageDigestSpi::MessageDigestSpi() : SecuritySpi() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+MessageDigestSpi::~MessageDigestSpi() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool MessageDigestSpi::isCloneable() const {
+    return false;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+MessageDigestSpi* MessageDigestSpi::clone() {
+    throw CloneNotSupportedException(__FILE__, __LINE__, "This MessageDisgestSpi cannot be cloned.");
+}



Mime
View raw message