public class HashContext extends Object implements IHashContext
| 构造器和说明 |
|---|
HashContext() |
| 限定符和类型 | 方法和说明 |
|---|---|
String |
algorithmName()
Returns the name of the hash algorithm the
HashService should use when computing the Hash, or
null if the default algorithm configuration of the HashService should be used. |
HashContext |
algorithmName(String algorithmName) |
static HashContext |
newInstance() |
byte[] |
salt()
Returns a salt to be used by the
IHash during hash computation, or null if no salt is
provided as part of the request. |
HashContext |
salt(byte[] salt) |
byte[] |
source()
Returns the source data that will be hashed by a
IHash. |
HashContext |
source(byte[] source) |
int |
times()
Returns the number of requested hash iterations to be performed when computing the final
Hash result. |
HashContext |
times(int times) |
String |
toString() |
public static HashContext newInstance()
public byte[] source()
IHashContextIHash. For example, this might be a
ByteSource representation of a password, or file, etc.source 在接口中 IHashContextIHash.public HashContext source(byte[] source)
public byte[] salt()
IHashContextIHash during hash computation, or null if no salt is
provided as part of the request.
Note that a null value does not necessarily mean a salt won't be used at all - it just
means that the request didn't include one. The servicing IHash is free to provide a salting
strategy for a request, even if the request did not specify one.salt 在接口中 IHashContextIHash during hash computation, or null if no salt is
provided as part of the request.public HashContext salt(byte[] salt)
public String algorithmName()
IHashContextHashService should use when computing the Hash, or
null if the default algorithm configuration of the HashService should be used. A non-null value
overrides the HashService's configuration for a single request.
Note that a HashService is free to ignore this value if it determines that the algorithm is not
sufficient to meet a desired level of security.algorithmName 在接口中 IHashContextHashService should use when computing the Hash, or
null if the default algorithm configuration of the HashService should be used.public HashContext algorithmName(String algorithmName)
public int times()
IHashContextHash result.
A non-positive (0 or less) indicates that the HashService's default iteration configuration should
be used. A positive value overrides the HashService's configuration for a single request.
Note that a HashService is free to ignore this number if it determines the number is not sufficient
to meet a desired level of security.times 在接口中 IHashContextHash result.public HashContext times(int times)
Copyright © 2020. All rights reserved.