File tree Expand file tree Collapse file tree 1 file changed +28
-12
lines changed
crypto/src/crypto/generators Expand file tree Collapse file tree 1 file changed +28
-12
lines changed Original file line number Diff line number Diff line change 6
6
7
7
namespace Org . BouncyCastle . Crypto . Generators
8
8
{
9
- /**
10
- * Generator for PBE derived keys and ivs as usd by OpenSSL.
11
- * <p>
12
- * The scheme is a simple extension of PKCS 5 V2.0 Scheme 1 using MD5 with an
13
- * iteration count of 1.
14
- * </p>
15
- */
9
+ ///
10
+ /// <description>
11
+ ///
12
+ /// Generator for PBE derived keys and ivs as usd by OpenSSL.
13
+ /// <p>
14
+ /// Originally this scheme was a simple extension of PKCS 5 V2.0 Scheme 1 using MD5 with an
15
+ /// iteration count of 1. The default digest was changed to SHA-256 with OpenSSL 1.1.0. This
16
+ /// implementation still defaults to MD5, but the digest can now be set.
17
+ /// </description>
18
+ ///
16
19
public class OpenSslPbeParametersGenerator
17
20
: PbeParametersGenerator
18
21
{
19
- private readonly IDigest digest = new MD5Digest ( ) ;
22
+ private readonly IDigest digest ;
23
+
24
+ ///
25
+ /// <description>
26
+ /// Construct a OpenSSL Parameters generator - digest the original MD5.
27
+ /// </description>
28
+ ///
29
+ public OpenSslPbeParametersGenerator ( ) : this ( new MD5Digest ( ) )
30
+ {
31
+ }
20
32
21
- /**
22
- * Construct a OpenSSL Parameters generator.
23
- */
24
- public OpenSslPbeParametersGenerator ( )
33
+ ///
34
+ /// <description>
35
+ /// Construct a OpenSSL Parameters generator - digest as specified.
36
+ /// </description>
37
+ /// <param name="digest">the digest to use as the PRF.</param>
38
+ ///
39
+ public OpenSslPbeParametersGenerator ( IDigest digest )
25
40
{
41
+ this . digest = digest ;
26
42
}
27
43
28
44
public override void Init (
You can’t perform that action at this time.
0 commit comments