Initial Commit
This commit is contained in:
39
iTechSharp/srcbc/crypto/parameters/ParametersWithSalt.cs
Normal file
39
iTechSharp/srcbc/crypto/parameters/ParametersWithSalt.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
using Org.BouncyCastle.Crypto;
|
||||
|
||||
namespace Org.BouncyCastle.Crypto.Parameters
|
||||
{
|
||||
|
||||
/// <summary> Cipher parameters with a fixed salt value associated with them.</summary>
|
||||
public class ParametersWithSalt : ICipherParameters
|
||||
{
|
||||
private byte[] salt;
|
||||
private ICipherParameters parameters;
|
||||
|
||||
public ParametersWithSalt(ICipherParameters parameters, byte[] salt):this(parameters, salt, 0, salt.Length)
|
||||
{
|
||||
}
|
||||
|
||||
public ParametersWithSalt(ICipherParameters parameters, byte[] salt, int saltOff, int saltLen)
|
||||
{
|
||||
this.salt = new byte[saltLen];
|
||||
this.parameters = parameters;
|
||||
|
||||
Array.Copy(salt, saltOff, this.salt, 0, saltLen);
|
||||
}
|
||||
|
||||
public byte[] GetSalt()
|
||||
{
|
||||
return salt;
|
||||
}
|
||||
|
||||
public ICipherParameters Parameters
|
||||
{
|
||||
get
|
||||
{
|
||||
return parameters;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user