Tabnine Logo
AssertionUtil.isSignatureValid
Code IndexAdd Tabnine to your IDE (free)

How to use
isSignatureValid
method
in
org.picketlink.identity.federation.core.saml.v2.util.AssertionUtil

Best Java code snippets using org.picketlink.identity.federation.core.saml.v2.util.AssertionUtil.isSignatureValid (Showing top 5 results out of 315)

origin: org.overlord/overlord-commons-auth

/**
 * Validates the SAML assertion's signature is valid.
 */
public static boolean isSAMLAssertionSignatureValid(Document samlAssertion, KeyPair keyPair) {
  return AssertionUtil.isSignatureValid(samlAssertion.getDocumentElement(), keyPair.getPublic());
}
origin: org.picketlink.distribution/picketlink-jbas7

/**
 * This method validates SAML Credential in following steps: <ol> <li>Validate the signing key embedded in SAML token is still
 * valid, not expired</li> <li>Validate the signing key embedded in SAML token is trusted against a local truststore,  such as
 * certpath validation</li> <li>Validate SAML token is still valid, not expired</li> <li>Validate the SAML signature using the
 * embedded signing key in SAML token itself as you indicated below</li> </ol>
 *
 * If something goes wrong throws LoginException.
 *
 * @throws LoginException
 */
private void validateSAMLCredential() throws LoginException, ConfigurationException, CertificateExpiredException, CertificateNotYetValidException {
  X509Certificate cert = getX509Certificate();
  // public certificate validation
  validateCertPath(cert);
  // check time validity of the certificate
  cert.checkValidity();
  boolean sigValid = false;
  try {
    sigValid = AssertionUtil.isSignatureValid(credential.getAssertionAsElement(), cert.getPublicKey());
  } catch (ProcessingException e) {
    logger.processingError(e);
  }
  if (!sigValid) {
    throw logger.authSAMLInvalidSignatureError();
  }
  if (AssertionUtil.hasExpired(assertion)) {
    throw logger.authSAMLAssertionExpiredError();
  }
}
origin: org.picketlink.distribution/picketlink-jbas5

/**
 * This method validates SAML Credential in following steps: <ol> <li>Validate the signing key embedded in SAML token is still
 * valid, not expired</li> <li>Validate the signing key embedded in SAML token is trusted against a local truststore,  such as
 * certpath validation</li> <li>Validate SAML token is still valid, not expired</li> <li>Validate the SAML signature using the
 * embedded signing key in SAML token itself as you indicated below</li> </ol>
 *
 * If something goes wrong throws LoginException.
 *
 * @throws LoginException
 */
private void validateSAMLCredential() throws LoginException, ConfigurationException, CertificateExpiredException, CertificateNotYetValidException {
  X509Certificate cert = getX509Certificate();
  // public certificate validation
  validateCertPath(cert);
  // check time validity of the certificate
  cert.checkValidity();
  boolean sigValid = false;
  try {
    sigValid = AssertionUtil.isSignatureValid(credential.getAssertionAsElement(), cert.getPublicKey());
  } catch (ProcessingException e) {
    logger.processingError(e);
  }
  if (!sigValid) {
    throw logger.authSAMLInvalidSignatureError();
  }
  if (AssertionUtil.hasExpired(assertion)) {
    throw logger.authSAMLAssertionExpiredError();
  }
}
origin: org.picketlink.distribution/picketlink-jbas7

boolean sigValid = AssertionUtil.isSignatureValid(assertionElement, publicKey);
if (!sigValid) {
  throw logger.authSAMLInvalidSignatureError();
origin: org.picketlink.distribution/picketlink-jbas5

boolean sigValid = AssertionUtil.isSignatureValid(assertionElement, publicKey);
if (!sigValid) {
  throw logger.authSAMLInvalidSignatureError();
org.picketlink.identity.federation.core.saml.v2.utilAssertionUtilisSignatureValid

Javadoc

Given an assertion element, validate the signature

Popular methods of AssertionUtil

  • hasExpired
    Verify whether the assertion has expired. You can add in a clock skew to adapt to conditions where i
  • getRoles
    Given an assertion, return the list of roles it may have
  • getExpiration
    Extract the expiration time from an AssertionType
  • asString
    Given AssertionType, convert it into a String
  • createTimedConditions
    Add validity conditions to the SAML2 Assertion
  • createAssertion
    Create an assertion
  • createSAML11TimedConditions
    Add validity conditions to the SAML2 Assertion
  • asDocument
    Given AssertionType, convert it into a DOM Document.
  • createAssertionSubject
    Given a user name, create a SubjectType that can then be inserted into an assertion
  • isAudience
    Checks whether the given assertion is intended for the given org.picketlink.config.federation.SPType

Popular in Java

  • Making http requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • setRequestProperty (URLConnection)
  • scheduleAtFixedRate (Timer)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • JPanel (javax.swing)
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now