Class ProxySAMLExtension

java.lang.Object
org.bouncycastle.asn1.ASN1Object
eu.emi.security.authn.x509.helpers.proxy.ProxySAMLExtension
All Implemented Interfaces:
org.bouncycastle.asn1.ASN1Encodable, org.bouncycastle.util.Encodable

public class ProxySAMLExtension extends org.bouncycastle.asn1.ASN1Object
A class for handling the SAML extension in the Certificate. OID: 1.3.6.1.4.1.3536.1.1.1.12
Author:
joni.hahkala@cern.ch, K. Benedyczak
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The legacy OID for the SAML assertion.
    static final String
    The OID for the SAML assertion.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ProxySAMLExtension(byte[] bytes)
    Generates a new SAMLExtension object from the byte array
    Used to generate an instance from the SAML assertion in String format.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the SAML extension from the certificate.
    Used to get the SAML assertion in String format.
    org.bouncycastle.asn1.ASN1Primitive

    Methods inherited from class org.bouncycastle.asn1.ASN1Object

    encodeTo, encodeTo, equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • SAML_OID

      public static final String SAML_OID
      The OID for the SAML assertion.
      See Also:
    • LEGACY_SAML_OID

      public static final String LEGACY_SAML_OID
      The legacy OID for the SAML assertion. Not supported as format is flawed.
      See Also:
  • Constructor Details

    • ProxySAMLExtension

      public ProxySAMLExtension(byte[] bytes) throws IOException
      Generates a new SAMLExtension object from the byte array
      Parameters:
      bytes - byte array
      Throws:
      IOException - IO exception
    • ProxySAMLExtension

      public ProxySAMLExtension(String samlString)
      Used to generate an instance from the SAML assertion in String format.
      Parameters:
      samlString - SAML string
  • Method Details

    • getInstance

      public static ProxySAMLExtension getInstance(X509Certificate cert) throws IOException
      Returns the SAML extension from the certificate.
      Parameters:
      cert - certificate
      Returns:
      The SAML assertion extension object. In no SAML extension was found, null is returned.
      Throws:
      IOException - In case there is a problem parsing the certificate.
    • getSAML

      public String getSAML()
      Used to get the SAML assertion in String format.
      Returns:
      The SAML sertion in string format.
    • toASN1Primitive

      public org.bouncycastle.asn1.ASN1Primitive toASN1Primitive()
      Specified by:
      toASN1Primitive in interface org.bouncycastle.asn1.ASN1Encodable
      Specified by:
      toASN1Primitive in class org.bouncycastle.asn1.ASN1Object