You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2013/03/16 22:14:12 UTC
svn commit: r1457307 [4/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...
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/MessageDigestSpi.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/MessageDigestSpi.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/MessageDigestSpi.h?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/MessageDigestSpi.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/MessageDigestSpi.h Sat Mar 16 21:14:01 2013
@@ -0,0 +1,172 @@
+/*
+ * 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_MESSAGEDIGESTSPI_H_
+#define _DECAF_SECURITY_MESSAGEDIGESTSPI_H_
+
+#include <decaf/util/Config.h>
+
+#include <decaf/nio/ByteBuffer.h>
+#include <decaf/security/SecuritySpi.h>
+
+#include <vector>
+
+namespace decaf {
+namespace security {
+
+ class MessageDigest;
+
+ /**
+ * This class defines the Service Provider Interface (SPI) for the MessageDigest class,
+ * which provides 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.
+ *
+ * All the pure virtual methods in this class must be implemented by a cryptographic
+ * service provider who wishes to supply the implementation of a particular message digest
+ * algorithm.
+ *
+ * Implementations are free to implement clone method or throw a CloneNotSupportedException..
+ *
+ * @since 1.0
+ */
+ class DECAF_API MessageDigestSpi : public SecuritySpi {
+ public:
+
+ MessageDigestSpi();
+
+ virtual ~MessageDigestSpi();
+
+ /**
+ * Queries the SPI implementation and returns true if the SPI can be
+ * cloned.
+ *
+ * @returns true if the SPI is clonable.
+ */
+ virtual bool isCloneable() const;
+
+ /**
+ * Returns a clone if the implementation supports being cloned.
+ *
+ * @returns a new pointer that is a copy of this object.
+ *
+ * @throws CloneNotSupportedException
+ * if this is called on an implementation that does not support cloning.
+ */
+ virtual MessageDigestSpi* clone();
+
+ protected:
+
+ /**
+ * Returns the digest length in bytes.
+ *
+ * @returns The digest length in bytes.
+ */
+ virtual int engineGetDigestLength() = 0;
+
+ /**
+ * Updates the digest using the specified byte.
+ *
+ * @param input
+ * The byte to use for the update.
+ */
+ virtual void engineUpdate(unsigned char input) = 0;
+
+ /**
+ * Updates the digest using the specified array of bytes, starting at the specified offset.
+ *
+ * @param input
+ * The array of bytes to use for the update.
+ * @param size
+ * 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.
+ *
+ * @throws NullPointerException if the input array pointer is NULL.
+ */
+ virtual void engineUpdate(const unsigned char* input, int size, int offset, int length) = 0;
+
+ /**
+ * Resets the digest for further use.
+ */
+ virtual void engineReset() = 0;
+
+ /**
+ * Update the digest using the specified Vector of Bytes.
+ *
+ * @param input
+ * The vector of bytes that will be used to update the digest.
+ */
+ virtual void engineUpdate(const std::vector<unsigned char>& input) = 0;
+
+ /**
+ * 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 ByteBuffer instance that will be used to update the digest.
+ */
+ virtual void engineUpdate(decaf::nio::ByteBuffer& input) = 0;
+
+ /**
+ * Completes the hash computation by performing final operations such as padding.
+ * Once engineDigest has been called, the engine should be reset (see engineReset).
+ * Resetting is the responsibility of the engine implementor.
+ *
+ * @returns an STL vector of bytes containing the resulting hash value.
+ */
+ virtual std::vector<unsigned char> engineDigest() = 0;
+
+ /**
+ * Completes the hash computation by performing final operations such as padding.
+ * Once engineDigest has been called, the engine should be reset (see engineReset).
+ * Resetting is the responsibility of the engine implementor.
+ *
+ * @param buffer
+ * The output buffer in which to store the digest
+ * @param size
+ * The size of the given input buffer
+ * @param offset
+ * The offset to start from in the output buffer
+ * @param length
+ * The number of bytes within buffer allotted for the digest.
+ * Both this default implementation and the SUN provider do not
+ * return partial digests. The presence of this parameter is solely
+ * for consistency in our API's. If the value of this parameter is
+ * less than the actual digest length, the method will throw a
+ * DigestException. This parameter is ignored if its value is greater
+ * than or equal to the actual digest length.
+ *
+ * @returns the length of the digest stored in the output buffer.
+ *
+ * @throws DigestException if an error occurs.
+ * @throws NullPointerException if the buffer pointer is NULL.
+ */
+ virtual int engineDigest(unsigned char* buffer, int size, int offset, int length) = 0;
+
+ private:
+
+ friend class MessageDigest;
+
+ };
+
+}}
+
+#endif /* _DECAF_SECURITY_MESSAGEDIGESTSPI_H_ */
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/MessageDigestSpi.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/NoSuchAlgorithmException.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/NoSuchAlgorithmException.cpp?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/NoSuchAlgorithmException.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/NoSuchAlgorithmException.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 "NoSuchAlgorithmException.h"
+
+using namespace decaf;
+using namespace decaf::security;
+
+////////////////////////////////////////////////////////////////////////////////
+NoSuchAlgorithmException::NoSuchAlgorithmException() : GeneralSecurityException() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+NoSuchAlgorithmException::NoSuchAlgorithmException(const Exception& ex) : GeneralSecurityException() {
+ *(Exception*) this = ex;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+NoSuchAlgorithmException::NoSuchAlgorithmException(const NoSuchAlgorithmException& ex) : GeneralSecurityException() {
+ *(Exception*) this = ex;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+NoSuchAlgorithmException::NoSuchAlgorithmException(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);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+NoSuchAlgorithmException::NoSuchAlgorithmException(const std::exception* cause) : GeneralSecurityException(cause) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+NoSuchAlgorithmException::NoSuchAlgorithmException(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);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+NoSuchAlgorithmException::~NoSuchAlgorithmException() throw () {
+}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/NoSuchAlgorithmException.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/NoSuchAlgorithmException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/NoSuchAlgorithmException.h?rev=1457307&r1=1457306&r2=1457307&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/NoSuchAlgorithmException.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/NoSuchAlgorithmException.h Sat Mar 16 21:14:01 2013
@@ -20,72 +20,62 @@
#include <decaf/security/GeneralSecurityException.h>
-namespace decaf{
-namespace security{
+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 NoSuchAlgorithmException : public GeneralSecurityException
- {
+ class DECAF_API NoSuchAlgorithmException : public GeneralSecurityException {
public:
/**
* Default Constructor
*/
- NoSuchAlgorithmException() throw() {};
+ NoSuchAlgorithmException();
/**
* Conversion Constructor from some other Exception
+ *
* @param ex
* An exception that should become this type of Exception
*/
- NoSuchAlgorithmException(const Exception& ex) throw()
- : Exception()
- {
- *(Exception*)this = ex;
- }
+ NoSuchAlgorithmException(const Exception& ex);
/**
* Copy Constructor
* @param ex
* An exception that should become this type of Exception
*/
- NoSuchAlgorithmException(const NoSuchAlgorithmException& ex) throw()
- : Exception()
- {
- *(Exception*)this = ex;
- }
+ NoSuchAlgorithmException(const NoSuchAlgorithmException& 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
- */
- NoSuchAlgorithmException( 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 );
- }
+ * 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
+ */
+ NoSuchAlgorithmException(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.
*/
- NoSuchAlgorithmException( const std::exception* cause ) throw() : Exception( cause ) {}
+ NoSuchAlgorithmException(const std::exception* cause);
/**
* Constructor - Initializes the file name and line number where
@@ -101,18 +91,7 @@ namespace security{
* @param ...
* list of primitives that are formatted into the message
*/
- NoSuchAlgorithmException( 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);
- }
+ NoSuchAlgorithmException(const char* file, const int lineNumber, const char* msg, ...);
/**
* Clones this exception. This is useful for cases where you need
@@ -121,13 +100,13 @@ namespace security{
*
* @return A deep copy of this exception.
*/
- virtual NoSuchAlgorithmException* clone() const{
+ virtual NoSuchAlgorithmException* clone() const {
return new NoSuchAlgorithmException(*this);
}
- virtual ~NoSuchAlgorithmException() throw() {}
+ virtual ~NoSuchAlgorithmException() throw();
- };
+ };
}}
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/NoSuchProviderException.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/NoSuchProviderException.cpp?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/NoSuchProviderException.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/NoSuchProviderException.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 "NoSuchProviderException.h"
+
+using namespace decaf;
+using namespace decaf::security;
+
+////////////////////////////////////////////////////////////////////////////////
+NoSuchProviderException::NoSuchProviderException() : GeneralSecurityException() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+NoSuchProviderException::NoSuchProviderException(const Exception& ex) : GeneralSecurityException() {
+ *(Exception*) this = ex;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+NoSuchProviderException::NoSuchProviderException(const NoSuchProviderException& ex) : GeneralSecurityException() {
+ *(Exception*) this = ex;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+NoSuchProviderException::NoSuchProviderException(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);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+NoSuchProviderException::NoSuchProviderException(const std::exception* cause) : GeneralSecurityException(cause) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+NoSuchProviderException::NoSuchProviderException(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);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+NoSuchProviderException::~NoSuchProviderException() throw () {
+}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/NoSuchProviderException.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/NoSuchProviderException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/NoSuchProviderException.h?rev=1457307&r1=1457306&r2=1457307&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/NoSuchProviderException.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/NoSuchProviderException.h Sat Mar 16 21:14:01 2013
@@ -21,76 +21,67 @@
#include <decaf/util/Config.h>
#include <decaf/security/GeneralSecurityException.h>
-namespace decaf{
-namespace security{
+namespace decaf {
+namespace security {
/*
* This exception is thrown when a particular security provider is requested
* but is not available in the environment.
*/
- class DECAF_API NoSuchProviderException : public GeneralSecurityException
- {
+ class DECAF_API NoSuchProviderException : public GeneralSecurityException {
public:
/**
* Default Constructor
*/
- NoSuchProviderException() throw() {};
+ NoSuchProviderException();
/**
* Conversion Constructor from some other Exception
+ *
* @param ex
* An exception that should become this type of Exception
*/
- NoSuchProviderException(const Exception& ex) throw()
- : Exception()
- {
- *(Exception*)this = ex;
- }
+ NoSuchProviderException(const Exception& ex);
/**
* Copy Constructor
+ *
* @param ex
* An exception that should become this type of Exception
*/
- NoSuchProviderException(const NoSuchProviderException& ex) throw()
- : Exception()
- {
- *(Exception*)this = ex;
- }
+ NoSuchProviderException(const NoSuchProviderException& 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
- */
- NoSuchProviderException( 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 );
- }
+ * 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
+ */
+ NoSuchProviderException(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.
*/
- NoSuchProviderException( const std::exception* cause ) throw() : Exception( cause ) {}
+ NoSuchProviderException(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
@@ -102,18 +93,7 @@ namespace security{
* @param ...
* list of primitives that are formatted into the message
*/
- NoSuchProviderException( 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);
- }
+ NoSuchProviderException(const char* file, const int lineNumber, const char* msg, ...);
/**
* Clones this exception. This is useful for cases where you need
@@ -122,13 +102,13 @@ namespace security{
*
* @return A deep copy of this exception.
*/
- virtual NoSuchProviderException* clone() const{
+ virtual NoSuchProviderException* clone() const {
return new NoSuchProviderException(*this);
}
- virtual ~NoSuchProviderException() throw() {}
+ virtual ~NoSuchProviderException() throw ();
- };
+ };
}}
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Principal.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Principal.cpp?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Principal.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Principal.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 "Principal.h"
+
+using namespace decaf;
+using namespace decaf::security;
+
+////////////////////////////////////////////////////////////////////////////////
+Principal::~Principal() {
+}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Principal.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Principal.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Principal.h?rev=1457307&r1=1457306&r2=1457307&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Principal.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Principal.h Sat Mar 16 21:14:01 2013
@@ -20,6 +20,8 @@
#include <decaf/util/Config.h>
+#include <string>
+
namespace decaf {
namespace security {
@@ -30,7 +32,7 @@ namespace security {
class DECAF_API Principal {
public:
- virtual ~Principal() {}
+ virtual ~Principal();
/**
* Compares two principals to see if they are the same.
@@ -39,7 +41,7 @@ namespace security {
* A principal to be tested for equality to this one.
* @return true if the given principal is equivalent to this one.
*/
- virtual bool equals( const Principal& another ) const = 0;
+ virtual bool equals(const Principal& another) const = 0;
/**
* Provides the name of this principal.
@@ -47,6 +49,7 @@ namespace security {
* @return the name of this principal.
*/
virtual std::string getName() const = 0;
+
};
}}
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Provider.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Provider.cpp?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Provider.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Provider.cpp Sat Mar 16 21:14:01 2013
@@ -0,0 +1,77 @@
+/*
+ * 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 "Provider.h"
+
+#include <decaf/util/StlSet.h>
+#include <decaf/lang/Pointer.h>
+
+#include <decaf/security/ProviderService.h>
+
+using namespace decaf;
+using namespace decaf::security;
+using namespace decaf::util;
+using namespace decaf::lang;
+
+////////////////////////////////////////////////////////////////////////////////
+namespace decaf {
+namespace security {
+
+ class ProviderImpl {
+ public:
+
+ StlSet<ProviderService*> services;
+
+ ~ProviderImpl() {
+ try {
+ Pointer< Iterator<ProviderService*> > iter(services.iterator());
+ while (iter->hasNext()) {
+ delete iter->next();
+ }
+ services.clear();
+ }
+ DECAF_CATCHALL_NOTHROW()
+ }
+
+ };
+
+}}
+
+////////////////////////////////////////////////////////////////////////////////
+Provider::Provider(const std::string& name, double version, const std::string& info) :
+ name(name), version(version), info(info), impl(new ProviderImpl) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+Provider::~Provider() {
+ try {
+ delete this->impl;
+ }
+ DECAF_CATCHALL_NOTHROW()
+}
+
+////////////////////////////////////////////////////////////////////////////////
+const Set<ProviderService*>& Provider::getServices() const {
+ return this->impl->services;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void Provider::addService(ProviderService* service) {
+ if (service != NULL) {
+ this->impl->services.add(service);
+ }
+}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Provider.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Provider.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Provider.h?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Provider.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Provider.h Sat Mar 16 21:14:01 2013
@@ -0,0 +1,94 @@
+/*
+ * 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_PROVIDER_H_
+#define _DECAF_SECURITY_PROVIDER_H_
+
+#include <decaf/util/Config.h>
+#include <decaf/util/Set.h>
+
+#include <string>
+
+#include <decaf/security/ProviderService.h>
+
+namespace decaf {
+namespace security {
+
+ class ProviderImpl;
+
+ /**
+ * This class represents a "provider" for the Decaf Security API, where a provider
+ * implements some or all parts of Decaf Security. Services that a provider may implement
+ * include:
+ *
+ * Algorithms (such as DSA, RSA, MD5 or SHA-1).
+ * Key generation, conversion, and management facilities (such as for algorithm-specific keys).
+ *
+ * Each provider has a name and a version number, and is configured in each runtime it
+ * is installed in.
+ *
+ * @since 1.0
+ */
+ class DECAF_API Provider {
+ private:
+
+ std::string name;
+ double version;
+ std::string info;
+
+ ProviderImpl* impl;
+
+ private:
+
+ Provider(const Provider&);
+ Provider& operator= (const Provider&);
+
+ protected:
+
+ Provider(const std::string& name, double version, const std::string& info);
+
+ public:
+
+ virtual ~Provider();
+
+ public:
+
+ std::string getName() const {
+ return name;
+ }
+
+ double getVersion() const {
+ return version;
+ }
+
+ std::string getInfo() const {
+ return info;
+ }
+
+ const decaf::util::Set<ProviderService*>& getServices() const;
+
+ protected:
+
+ virtual void initialize() {}
+
+ void addService(ProviderService* service);
+
+ };
+
+}}
+
+#endif /* _DECAF_SECURITY_PROVIDER_H_ */
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Provider.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/ProviderException.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/ProviderException.cpp?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/ProviderException.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/ProviderException.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 "ProviderException.h"
+
+using namespace decaf;
+using namespace decaf::security;
+using namespace decaf::lang;
+using namespace decaf::lang::exceptions;
+
+////////////////////////////////////////////////////////////////////////////////
+ProviderException::ProviderException() : RuntimeException() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+ProviderException::ProviderException(const Exception& ex) : RuntimeException() {
+ *(Exception*) this = ex;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+ProviderException::ProviderException(const ProviderException& ex) : RuntimeException() {
+ *(Exception*) this = ex;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+ProviderException::ProviderException(const char* file, const int lineNumber, const std::exception* cause, const char* msg, ...) : RuntimeException(cause) {
+
+ va_list vargs;
+ va_start(vargs, msg);
+ buildMessage(msg, vargs);
+
+ // Set the first mark for this exception.
+ setMark(file, lineNumber);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+ProviderException::ProviderException(const std::exception* cause) : RuntimeException(cause) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+ProviderException::ProviderException(const char* file, const int lineNumber, const char* msg, ...) : RuntimeException() {
+
+ va_list vargs;
+ va_start(vargs, msg);
+ buildMessage(msg, vargs);
+
+ // Set the first mark for this exception.
+ setMark(file, lineNumber);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+ProviderException::~ProviderException() throw () {
+}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/ProviderException.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/ProviderException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/ProviderException.h?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/ProviderException.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/ProviderException.h Sat Mar 16 21:14:01 2013
@@ -0,0 +1,111 @@
+/*
+ * 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_PROVIDEREXCEPTION_H_
+#define _DECAF_SECURITY_PROVIDEREXCEPTION_H_
+
+#include <decaf/util/Config.h>
+
+#include <decaf/lang/exceptions/RuntimeException.h>
+
+namespace decaf {
+namespace security {
+
+ class DECAF_API ProviderException: public decaf::lang::exceptions::RuntimeException {
+ public:
+
+ /**
+ * Default Constructor
+ */
+ ProviderException();
+
+ /**
+ * Conversion Constructor from some other Exception
+ *
+ * @param ex
+ * An exception that should become this type of Exception
+ */
+ ProviderException(const Exception& ex);
+
+ /**
+ * Copy Constructor
+ *
+ * @param ex
+ * An exception that should become this type of Exception
+ */
+ ProviderException(const ProviderException& 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
+ */
+ ProviderException(const char* file, const int lineNumber, const std::exception* cause, const char* msg, ...);
+
+ /**
+ * Convenience Constructor
+ *
+ * @param cause
+ * Pointer to the exception that caused this one to
+ * be thrown, the object is cloned caller retains ownership.
+ */
+ ProviderException(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
+ */
+ ProviderException(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 ProviderException* clone() const {
+ return new ProviderException(*this);
+ }
+
+ virtual ~ProviderException() throw();
+ };
+
+}}
+
+#endif /* _DECAF_SECURITY_PROVIDEREXCEPTION_H_ */
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/ProviderException.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/ProviderService.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/ProviderService.cpp?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/ProviderService.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/ProviderService.cpp Sat Mar 16 21:14:01 2013
@@ -0,0 +1,33 @@
+/*
+ * 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 "ProviderService.h"
+
+#include <decaf/security/Provider.h>
+
+using namespace decaf;
+using namespace decaf::security;
+
+////////////////////////////////////////////////////////////////////////////////
+ProviderService::ProviderService(const Provider* provider, const std::string& type, const std::string& algorithm) :
+ provider(provider), type(type), algorithm(algorithm) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+ProviderService::~ProviderService() {
+}
+
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/ProviderService.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/ProviderService.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/ProviderService.h?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/ProviderService.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/ProviderService.h Sat Mar 16 21:14:01 2013
@@ -0,0 +1,98 @@
+/*
+ * 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_PROVIDERSERVICE_H_
+#define _DECAF_SECURITY_PROVIDERSERVICE_H_
+
+#include <decaf/util/Config.h>
+
+#include <string>
+
+namespace decaf {
+namespace security {
+
+ class Provider;
+ class SecuritySpi;
+
+ class DECAF_API ProviderService {
+ private:
+
+ const Provider* provider;
+ std::string type;
+ std::string algorithm;
+
+ public:
+
+ ProviderService(const Provider* provider, const std::string& type, const std::string& algorithm);
+
+ virtual ~ProviderService();
+
+ /**
+ * Gets the type of service this ProviderService instance supports.
+ *
+ * @return type name of the service this ProviderService supports.
+ */
+ std::string getType() const {
+ return this->type;
+ }
+
+ /**
+ * Gets the algorithm name that this ProviderService supplies for its
+ * service type.
+ *
+ * @return the algorithm this ProviderService supports.
+ */
+ std::string getAlgorithm() const {
+ return this->algorithm;
+ }
+
+ /**
+ * Returns a pointer to the Provider that owns this ProviderService.
+ *
+ * The returned pointer is owned by the Security framework an should not be
+ * deleted by the caller at any time.
+ *
+ * @return pointer to the security provider that owns this service.
+ */
+ const Provider* getProvider() const {
+ return provider;
+ }
+
+ /**
+ * Return a new instance of the implementation described by this service. The
+ * security provider framework uses this method to construct implementations.
+ * Applications will typically not need to call it.
+ *
+ * @returns a new instance of the SecuritySpi provided by this ProviderService.
+ */
+ virtual SecuritySpi* newInstance() = 0;
+
+ /**
+ * Return a String representation of this service. The format of this string is
+ * always, "type.algorithm"
+ *
+ * @returns string describing this ProviderService.
+ */
+ std::string toString() const {
+ return getType() + "." + getAlgorithm();
+ }
+
+ };
+
+}}
+
+#endif /* _DECAF_SECURITY_PROVIDERSERVICE_H_ */
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/ProviderService.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/PublicKey.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/PublicKey.cpp?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/PublicKey.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/PublicKey.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 "PublicKey.h"
+
+using namespace decaf;
+using namespace decaf::security;
+
+////////////////////////////////////////////////////////////////////////////////
+PublicKey::~PublicKey() {
+}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/PublicKey.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/PublicKey.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/PublicKey.h?rev=1457307&r1=1457306&r2=1457307&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/PublicKey.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/PublicKey.h Sat Mar 16 21:14:01 2013
@@ -18,9 +18,10 @@
#ifndef _DECAF_SECURITY_PUBLICKEY_H_
#define _DECAF_SECURITY_PUBLICKEY_H_
-#include <decaf/security/Key.h>
#include <decaf/util/Config.h>
+#include <decaf/security/Key.h>
+
namespace decaf {
namespace security {
@@ -29,10 +30,9 @@ namespace security {
* serves to group (and provide type safety for) all public key interfaces.
*/
class DECAF_API PublicKey : public Key {
-
public:
- virtual ~PublicKey() {}
+ virtual ~PublicKey();
};
}}
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/SecureRandomSpi.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/SecureRandomSpi.cpp?rev=1457307&r1=1457306&r2=1457307&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/SecureRandomSpi.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/SecureRandomSpi.cpp Sat Mar 16 21:14:01 2013
@@ -21,7 +21,7 @@ using namespace decaf;
using namespace decaf::security;
////////////////////////////////////////////////////////////////////////////////
-SecureRandomSpi::SecureRandomSpi() {
+SecureRandomSpi::SecureRandomSpi() : SecuritySpi() {
}
////////////////////////////////////////////////////////////////////////////////
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/SecureRandomSpi.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/SecureRandomSpi.h?rev=1457307&r1=1457306&r2=1457307&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/SecureRandomSpi.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/SecureRandomSpi.h Sat Mar 16 21:14:01 2013
@@ -20,6 +20,8 @@
#include <decaf/util/Config.h>
+#include <decaf/security/SecuritySpi.h>
+
namespace decaf {
namespace security {
@@ -29,7 +31,7 @@ namespace security {
*
* @since 1.0
*/
- class DECAF_API SecureRandomSpi {
+ class DECAF_API SecureRandomSpi : public SecuritySpi {
public:
SecureRandomSpi();
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Security.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Security.cpp?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Security.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Security.cpp Sat Mar 16 21:14:01 2013
@@ -0,0 +1,29 @@
+/*
+ * 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 "Security.h"
+
+using namespace decaf;
+using namespace decaf::security;
+
+////////////////////////////////////////////////////////////////////////////////
+Security::Security() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+Security::~Security() {
+}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Security.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Security.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Security.h?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Security.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Security.h Sat Mar 16 21:14:01 2013
@@ -0,0 +1,40 @@
+/*
+ * 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_SECURITY_H_
+#define _DECAF_SECURITY_SECURITY_H_
+
+#include <decaf/util/Config.h>
+
+namespace decaf {
+namespace security {
+
+ /**
+ * @since 1.0
+ */
+ class DECAF_API Security {
+ public:
+
+ Security();
+
+ virtual ~Security();
+
+ };
+
+}}
+
+#endif /* _DECAF_SECURITY_SECURITY_H_ */
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/Security.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/SecuritySpi.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/SecuritySpi.cpp?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/SecuritySpi.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/SecuritySpi.cpp Sat Mar 16 21:14:01 2013
@@ -0,0 +1,29 @@
+/*
+ * 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 "SecuritySpi.h"
+
+using namespace decaf;
+using namespace decaf::security;
+
+////////////////////////////////////////////////////////////////////////////////
+SecuritySpi::SecuritySpi() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+SecuritySpi::~SecuritySpi() {
+}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/SecuritySpi.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/SecuritySpi.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/SecuritySpi.h?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/SecuritySpi.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/SecuritySpi.h Sat Mar 16 21:14:01 2013
@@ -0,0 +1,47 @@
+/*
+ * 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_SECURITYSPI_H_
+#define _DECAF_SECURITY_SECURITYSPI_H_
+
+#include <decaf/util/Config.h>
+
+namespace decaf {
+namespace security {
+
+ /**
+ * Base class used as a Marker for all Security Provider Interface classes
+ * in the Decaf Security API.
+ *
+ * @since 1.0
+ */
+ class DECAF_API SecuritySpi {
+ private:
+
+ SecuritySpi(const SecuritySpi&);
+ SecuritySpi& operator= (const SecuritySpi&);
+
+ public:
+
+ SecuritySpi();
+ virtual ~SecuritySpi();
+
+ };
+
+}}
+
+#endif /* _DECAF_SECURITY_SECURITYSPI_H_ */
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/SecuritySpi.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/SignatureException.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/SignatureException.cpp?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/SignatureException.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/SignatureException.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 "SignatureException.h"
+
+using namespace decaf;
+using namespace decaf::security;
+
+////////////////////////////////////////////////////////////////////////////////
+SignatureException::SignatureException() : GeneralSecurityException() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+SignatureException::SignatureException(const Exception& ex) : GeneralSecurityException() {
+ *(Exception*) this = ex;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+SignatureException::SignatureException(const SignatureException& ex) : GeneralSecurityException() {
+ *(Exception*) this = ex;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+SignatureException::SignatureException(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);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+SignatureException::SignatureException(const std::exception* cause) : GeneralSecurityException(cause) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+SignatureException::SignatureException(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);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+SignatureException::~SignatureException() throw () {
+}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/SignatureException.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/SignatureException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/SignatureException.h?rev=1457307&r1=1457306&r2=1457307&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/SignatureException.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/SignatureException.h Sat Mar 16 21:14:01 2013
@@ -21,71 +21,62 @@
#include <decaf/util/Config.h>
#include <decaf/security/GeneralSecurityException.h>
-namespace decaf{
-namespace security{
+namespace decaf {
+namespace security {
/*
* Generic signature exception.
*/
- class DECAF_API SignatureException : public GeneralSecurityException
- {
+ class DECAF_API SignatureException: public GeneralSecurityException {
public:
/**
* Default Constructor
*/
- SignatureException() throw() {};
+ SignatureException();
/**
* Conversion Constructor from some other Exception
+ *
* @param ex
* An exception that should become this type of Exception
*/
- SignatureException(const Exception& ex) throw()
- : Exception()
- {
- *(Exception*)this = ex;
- }
+ SignatureException(const Exception& ex);
/**
* Copy Constructor
+ *
* @param ex
* An exception that should become this type of Exception
*/
- SignatureException(const SignatureException& ex) throw()
- : Exception()
- {
- *(Exception*)this = ex;
- }
+ SignatureException(const SignatureException& 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
- */
- SignatureException( 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 );
- }
+ * 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
+ */
+ SignatureException(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.
+ * Convenience Constructor
+ *
+ * @param cause
+ * Pointer to the exception that caused this one to
+ * be thrown, the object is cloned caller retains ownership.
*/
- SignatureException( const std::exception* cause ) throw() : Exception( cause ) {}
+ SignatureException(const std::exception* cause);
/**
* Constructor - Initializes the file name and line number where
@@ -101,18 +92,7 @@ namespace security{
* @param ...
* list of primitives that are formatted into the message
*/
- SignatureException( 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 );
- }
+ SignatureException(const char* file, const int lineNumber, const char* msg, ...);
/**
* Clones this exception. This is useful for cases where you need
@@ -121,13 +101,13 @@ namespace security{
*
* @return A deep copy of this exception.
*/
- virtual SignatureException* clone() const{
+ virtual SignatureException* clone() const {
return new SignatureException(*this);
}
- virtual ~SignatureException() throw() {}
+ virtual ~SignatureException() throw();
- };
+ };
}}
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/auth/x500/X500Principal.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/auth/x500/X500Principal.cpp?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/auth/x500/X500Principal.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/auth/x500/X500Principal.cpp Sat Mar 16 21:14:01 2013
@@ -0,0 +1,28 @@
+/*
+ * 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 "X500Principal.h"
+
+using namespace decaf;
+using namespace decaf::security;
+using namespace decaf::security::auth;
+using namespace decaf::security::auth::x500;
+
+////////////////////////////////////////////////////////////////////////////////
+X500Principal::~X500Principal() {
+
+}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/auth/x500/X500Principal.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/auth/x500/X500Principal.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/auth/x500/X500Principal.h?rev=1457307&r1=1457306&r2=1457307&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/auth/x500/X500Principal.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/auth/x500/X500Principal.h Sat Mar 16 21:14:01 2013
@@ -32,27 +32,27 @@ namespace x500 {
class X500Principal : public Principal {
public:
-
+
/*X500Principal( unsigned char* name, int offset, int len );
X500Principal( decaf::io::InputStream& is );
X500Principal( const std::string& name );
- X500Principal( const std::string& name,
+ X500Principal( const std::string& name,
const decaf::util::Map<std::string, std::string>& keywordMap );*/
-
- virtual ~X500Principal() {}
-
+
+ virtual ~X500Principal();
+
virtual std::string getName() const = 0;
-
+
virtual void getEncoded( std::vector<unsigned char>& output ) const = 0;
-
+
virtual int hashCode() const = 0;
-
+
/*virtual std::string getName( const std::string& format ) const;
-
- virtual std::string getName(const std::string& format,
- const decaf::util::Map<std::string, std::string>& oldMap );*/
+
+ virtual std::string getName(const std::string& format,
+ const decaf::util::Map<std::string, std::string>& oldMap );*/
};
-
+
}}}}
#endif /*_DECAF_SECURITY_AUTH_X500_X500PRINCIPAL_H_*/
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/cert/Certificate.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/cert/Certificate.cpp?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/cert/Certificate.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/cert/Certificate.cpp Sat Mar 16 21:14:01 2013
@@ -0,0 +1,24 @@
+/*
+ * 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 "Certificate.h"
+
+using namespace decaf;
+using namespace decaf::security;
+using namespace decaf::security::cert;
+
+////////////////////////////////////////////////////////////////////////////////
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/cert/Certificate.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/cert/Certificate.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/cert/Certificate.h?rev=1457307&r1=1457306&r2=1457307&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/cert/Certificate.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/cert/Certificate.h Sat Mar 16 21:14:01 2013
@@ -33,6 +33,8 @@ namespace decaf {
namespace security {
namespace cert {
+ class PublicKey;
+
/**
* Base interface for all identity certificates.
*/
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/cert/CertificateEncodingException.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/cert/CertificateEncodingException.cpp?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/cert/CertificateEncodingException.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/cert/CertificateEncodingException.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 "CertificateEncodingException.h"
+
+using namespace decaf;
+using namespace decaf::security;
+using namespace decaf::security::cert;
+
+////////////////////////////////////////////////////////////////////////////////
+CertificateEncodingException::CertificateEncodingException() : CertificateException() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+CertificateEncodingException::CertificateEncodingException(const Exception& ex) : CertificateException() {
+ *(Exception*) this = ex;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+CertificateEncodingException::CertificateEncodingException(const CertificateEncodingException& ex) : CertificateException() {
+ *(Exception*) this = ex;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+CertificateEncodingException::CertificateEncodingException(const char* file, const int lineNumber, const std::exception* cause, const char* msg, ...) : CertificateException(cause) {
+
+ va_list vargs;
+ va_start(vargs, msg);
+ buildMessage(msg, vargs);
+
+ // Set the first mark for this exception.
+ setMark(file, lineNumber);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+CertificateEncodingException::CertificateEncodingException(const std::exception* cause) : CertificateException(cause) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+CertificateEncodingException::CertificateEncodingException(const char* file, const int lineNumber, const char* msg, ...) : CertificateException() {
+
+ va_list vargs;
+ va_start(vargs, msg);
+ buildMessage(msg, vargs);
+
+ // Set the first mark for this exception.
+ setMark(file, lineNumber);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+CertificateEncodingException::~CertificateEncodingException() throw () {
+}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/cert/CertificateEncodingException.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/cert/CertificateEncodingException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/cert/CertificateEncodingException.h?rev=1457307&r1=1457306&r2=1457307&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/cert/CertificateEncodingException.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/cert/CertificateEncodingException.h Sat Mar 16 21:14:01 2013
@@ -21,44 +21,62 @@
#include <decaf/util/Config.h>
#include <decaf/security/cert/CertificateException.h>
-namespace decaf{
-namespace security{
-namespace cert{
+namespace decaf {
+namespace security {
+namespace cert {
/*
* Certificate Encoding Exception. This is thrown whenever an error occurs
* while attempting to encode a certificate.
*/
- class DECAF_API CertificateEncodingException : public CertificateException
- {
+ class DECAF_API CertificateEncodingException : public CertificateException {
public:
/**
* Default Constructor
*/
- CertificateEncodingException() throw() {};
+ CertificateEncodingException();
/**
* Conversion Constructor from some other Exception
* @param ex
* An exception that should become this type of Exception
*/
- CertificateEncodingException(const Exception& ex) throw()
- : Exception()
- {
- *(Exception*)this = ex;
- }
+ CertificateEncodingException(const Exception& ex);
/**
* Copy Constructor
* @param ex
* An exception that should become this type of Exception
*/
- CertificateEncodingException(const CertificateEncodingException& ex) throw()
- : Exception()
- {
- *(Exception*)this = ex;
- }
+ CertificateEncodingException(const CertificateEncodingException& 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
+ */
+ CertificateEncodingException(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.
+ */
+ CertificateEncodingException(const std::exception* cause);
/**
* Constructor - Initializes the file name and line number where
@@ -74,18 +92,7 @@ namespace cert{
* @param ...
* list of primitives that are formatted into the message
*/
- CertificateEncodingException( 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);
- }
+ CertificateEncodingException(const char* file, const int lineNumber, const char* msg, ...);
/**
* Clones this exception. This is useful for cases where you need
@@ -94,13 +101,13 @@ namespace cert{
*
* @return A deep copy of this exception.
*/
- virtual CertificateEncodingException* clone() const{
+ virtual CertificateEncodingException* clone() const {
return new CertificateEncodingException(*this);
}
- virtual ~CertificateEncodingException() throw() {}
+ virtual ~CertificateEncodingException() throw();
- };
+ };
}}}
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/cert/CertificateException.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/cert/CertificateException.cpp?rev=1457307&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/cert/CertificateException.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/cert/CertificateException.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 "CertificateException.h"
+
+using namespace decaf;
+using namespace decaf::security;
+using namespace decaf::security::cert;
+
+////////////////////////////////////////////////////////////////////////////////
+CertificateException::CertificateException() : GeneralSecurityException() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+CertificateException::CertificateException(const Exception& ex) : GeneralSecurityException() {
+ *(Exception*) this = ex;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+CertificateException::CertificateException(const CertificateException& ex) : GeneralSecurityException() {
+ *(Exception*) this = ex;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+CertificateException::CertificateException(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);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+CertificateException::CertificateException(const std::exception* cause) : GeneralSecurityException(cause) {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+CertificateException::CertificateException(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);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+CertificateException::~CertificateException() throw () {
+}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/security/cert/CertificateException.cpp
------------------------------------------------------------------------------
svn:eol-style = native