All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nimbusds.openid.connect.sdk.id.PairwiseSubjectIdentifierGenerator Maven / Gradle / Ivy

Go to download

OAuth 2.0 SDK with OpenID Connection extensions for developing client and server applications.

There is a newer version: 11.19.1
Show newest version
package com.nimbusds.openid.connect.sdk.id;


import java.net.URI;

import com.nimbusds.oauth2.sdk.id.Subject;


/**
 * Generator of pairwise subject identifiers.
 *
 * 

Related specifications: * *

    *
  • OpenID Connect Core 1.0, section 8.1. *
*/ public abstract class PairwiseSubjectIdentifierGenerator { /** * Generates a new pairwise subject identifier from the specified * sector identifier URI and local subject. * * @param sectorURI The sector identifier URI. Its scheme must be * "https", must include a host portion and must not * be {@code null}. * @param localSub The local subject identifier. Must not be * {@code null}. * * @return The pairwise subject identifier. */ public Subject generate(final URI sectorURI, final Subject localSub) { if (! sectorURI.getScheme().equalsIgnoreCase("https")) throw new IllegalArgumentException("The sector identifier URI scheme must be HTTPS"); if (sectorURI.getHost() == null) throw new IllegalArgumentException("The sector identifier URI must specify a host"); return generate(sectorURI.getHost(), localSub); } /** * Generates a new pairwise subject identifier from the specified * sector identifier and local subject. * * @param sectorIdentifier The sector identifier. Must not be * {@code null}. * @param localSub The local subject identifier. Must not be * {@code null}. * * @return The pairwise subject identifier. */ public abstract Subject generate(final String sectorIdentifier, final Subject localSub); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy