Class HashBasedPairwiseSubjectCodec
- java.lang.Object
-
- com.nimbusds.openid.connect.sdk.id.PairwiseSubjectCodec
-
- com.nimbusds.openid.connect.sdk.id.HashBasedPairwiseSubjectCodec
-
@ThreadSafe public class HashBasedPairwiseSubjectCodec extends PairwiseSubjectCodec
SHA-256 based encoder of pairwise subject identifiers. Reversal is not supported.Algorithm:
sub = SHA-256 ( sector_id || local_sub || salt )
Related specifications:
- OpenID Connect Core 1.0, section 8.1.
-
-
Field Summary
Fields Modifier and Type Field Description static String
HASH_ALGORITHM
The hashing algorithm.-
Fields inherited from class com.nimbusds.openid.connect.sdk.id.PairwiseSubjectCodec
CHARSET
-
-
Constructor Summary
Constructors Constructor Description HashBasedPairwiseSubjectCodec(byte[] salt)
Creates a new hash-based codec for pairwise subject identifiers.HashBasedPairwiseSubjectCodec(com.nimbusds.jose.util.Base64URL salt)
Creates a new hash-based codec for pairwise subject identifiers.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Subject
encode(SectorID sectorID, Subject localSub)
Encodes a new pairwise subject identifier from the specified sector identifier and local subject.-
Methods inherited from class com.nimbusds.openid.connect.sdk.id.PairwiseSubjectCodec
decode, encode, getProvider, getSalt, setProvider
-
-
-
-
Field Detail
-
HASH_ALGORITHM
public static final String HASH_ALGORITHM
The hashing algorithm.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HashBasedPairwiseSubjectCodec
public HashBasedPairwiseSubjectCodec(byte[] salt)
Creates a new hash-based codec for pairwise subject identifiers.- Parameters:
salt
- The salt, must not benull
.
-
HashBasedPairwiseSubjectCodec
public HashBasedPairwiseSubjectCodec(com.nimbusds.jose.util.Base64URL salt)
Creates a new hash-based codec for pairwise subject identifiers.- Parameters:
salt
- The salt, must not benull
.
-
-
Method Detail
-
encode
public Subject encode(SectorID sectorID, Subject localSub)
Description copied from class:PairwiseSubjectCodec
Encodes a new pairwise subject identifier from the specified sector identifier and local subject.- Specified by:
encode
in classPairwiseSubjectCodec
- Parameters:
sectorID
- The sector identifier. Must not benull
.localSub
- The local subject identifier. Must not benull
.- Returns:
- The pairwise subject identifier.
-
-