public class HashingSubjectIdentifierGenerator extends PairwiseSubjectIdentifierGenerator
Algorithm:
sub = SHA-256 ( sector_identifier | local_account_id | salt )
Related specifications:
Modifier and Type | Field and Description |
---|---|
static String |
HASH_ALGORITHM
The hashing algorithm.
|
Constructor and Description |
---|
HashingSubjectIdentifierGenerator(String salt)
Creates a new SHA-256 based generator of pairwise subject
identifiers.
|
Modifier and Type | Method and Description |
---|---|
Subject |
generate(String sectorIdentifier,
Subject localSub)
Generates a new pairwise subject identifier from the specified
sector identifier and local subject.
|
byte[] |
saltBytes()
Returns the salt bytes.
|
generate
public static final String HASH_ALGORITHM
public HashingSubjectIdentifierGenerator(String salt) throws NoSuchAlgorithmException
salt
- The string to use for the salt. Must not be empty, blank
or null
.NoSuchAlgorithmException
- If SHA-256 isn't supported by the
underlying JVM.public byte[] saltBytes()
public Subject generate(String sectorIdentifier, Subject localSub)
PairwiseSubjectIdentifierGenerator
generate
in class PairwiseSubjectIdentifierGenerator
sectorIdentifier
- The sector identifier. Must not be
null
.localSub
- The local subject identifier. Must not be
null
.Copyright © 2014 NimbusDS. All Rights Reserved.