public class HashingSubjectIdentifierGenerator extends PairwiseSubjectIdentifierGenerator
Algorithm:
sub = SHA-256 ( sector_identifier | local_account_id | salt )
Related specifications:
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
HASH_ALGORITHM
The hashing algorithm.
|
Constructor and Description |
---|
HashingSubjectIdentifierGenerator(java.lang.String salt)
Creates a new SHA-256 based generator of pairwise subject
identifiers.
|
Modifier and Type | Method and Description |
---|---|
Subject |
generate(java.lang.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 java.lang.String HASH_ALGORITHM
public HashingSubjectIdentifierGenerator(java.lang.String salt) throws java.security.NoSuchAlgorithmException
salt
- The string to use for the salt. Must not be empty, blank
or null
.java.security.NoSuchAlgorithmException
- If SHA-256 isn't supported by the
underlying JVM.public byte[] saltBytes()
public Subject generate(java.lang.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 © 2015 Connect2id Ltd.. All Rights Reserved.