Class 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.
    • Constructor Detail

      • HashBasedPairwiseSubjectCodec

        public HashBasedPairwiseSubjectCodec​(byte[] salt)
        Creates a new hash-based codec for pairwise subject identifiers.
        Parameters:
        salt - The salt, must not be null.
      • 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 be null.
    • 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 class PairwiseSubjectCodec
        Parameters:
        sectorID - The sector identifier. Must not be null.
        localSub - The local subject identifier. Must not be null.
        Returns:
        The pairwise subject identifier.