activemq-cpp-3.9.5
SecureRandom.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef _DECAF_SECURITY_SECURERANDOM_H_
19 #define _DECAF_SECURITY_SECURERANDOM_H_
20 
21 #include <decaf/util/Config.h>
22 
23 #include <decaf/util/Random.h>
25 
26 #include <memory>
27 
28 namespace decaf {
29 namespace security {
30 
35  private:
36 
37  std::auto_ptr<SecureRandomSpi> secureRandom;
38 
39  public:
40 
49  SecureRandom();
50 
61  SecureRandom(const std::vector<unsigned char>& seed);
62 
78  SecureRandom(const unsigned char* seed, int size);
79 
80  virtual ~SecureRandom();
81 
82  public: // Virtual Methods
83 
84  virtual void nextBytes(std::vector<unsigned char>& buf);
85 
86  virtual void nextBytes(unsigned char* buf, int size);
87 
88  virtual void setSeed(unsigned long long seed);
89 
97  virtual void setSeed(const std::vector<unsigned char>& seed);
98 
111  virtual void setSeed(const unsigned char* seed, int size);
112 
113  protected: // Virtual method used by all non-virtual methods in Random.
114 
115  virtual int next(int bits);
116 
117  };
118 
119 }}
120 
121 #endif /* _DECAF_SECURITY_SECURERANDOM_H_ */
Random Value Generator which is used to generate a stream of pseudorandom numbers.
Definition: Random.h:37
#define DECAF_API
Definition: Config.h:29
Definition: SecureRandom.h:34