java.lang.Object
com.nimbusds.openid.connect.sdk.assurance.evidences.attachment.Attachment
Direct Known Subclasses:
EmbeddedAttachment, ExternalAttachment

public abstract class Attachment extends Object
Identity evidence attachment.

Related specifications:

  • OpenID Connect for Identity Assurance 1.0, section 5.1.2.
  • Constructor Details

    • Attachment

      protected Attachment(AttachmentType type, String description)
      Creates a new attachment with the specified description.
      Parameters:
      type - The type. Must not be null.
      description - The description, null if not specified.
  • Method Details

    • getType

      Returns the type of this attachment.
      Returns:
      The type.
    • getDescriptionString

      Returns the description.
      Returns:
      The description string.
    • toJSONObject

      public net.minidev.json.JSONObject toJSONObject()
      Returns a JSON object representation of this attachment.
      Returns:
      The JSON object.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toEmbeddedAttachment

      Casts this attachment to an embedded attachment.
      Returns:
      The embedded attachment.
      Throws:
      ClassCastException - If the cast failed.
    • toExternalAttachment

      Casts this attachment to an external attachment.
      Returns:
      The external attachment.
      Throws:
      ClassCastException - If the cast failed.
    • parse

      public static Attachment parse(net.minidev.json.JSONObject jsonObject) throws ParseException
      Parses an identity evidence attachment from the specified JSON object.
      Parameters:
      jsonObject - The JSON object. Must not be null.
      Returns:
      The identity evidence attachment.
      Throws:
      ParseException - If parsing failed.
    • parseList

      public static List<Attachment> parseList(net.minidev.json.JSONArray jsonArray) throws ParseException
      Parses a list of identity evidence attachments from the specified JSON array.
      Parameters:
      jsonArray - The JSON array, null if not specified.
      Returns:
      The list of identity evidence attachments, null if not specified.
      Throws:
      ParseException - If parsing failed.