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
28namespace decaf {
29namespace security {
30
35 private:
36
37 std::auto_ptr<SecureRandomSpi> secureRandom;
38
39 public:
40
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_ */
SecureRandom()
Creates a new instance of a secure random number generator that implements the default random number ...
virtual void setSeed(const unsigned char *seed, int size)
Supplements or sets the seed of this secure random number generator, calls to this method never reduc...
virtual void setSeed(const std::vector< unsigned char > &seed)
Supplements or sets the seed of this secure random number generator, calls to this method never reduc...
SecureRandom(const unsigned char *seed, int size)
Creates a new instance of a secure random number generator that implements the default random number ...
SecureRandom(const std::vector< unsigned char > &seed)
Creates a new instance of a secure random number generator that implements the default random number ...
virtual int next(int bits)
Answers a pseudo-random uniformly distributed int value of the number of bits specified by the argume...
virtual void setSeed(unsigned long long seed)
Modifies the seed using linear congruential formula presented in The Art of Computer Programming,...
virtual void nextBytes(std::vector< unsigned char > &buf)
Modifies the byte array by a random sequence of bytes generated by this random number generator.
virtual void nextBytes(unsigned char *buf, int size)
Modifies the byte array by a random sequence of bytes generated by this random number generator.
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 Engine.h:26
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition AprPool.h:25