com.ibm.as400.access

Class AS400CertificateAttribute

  • java.lang.Object
    • com.ibm.as400.access.AS400CertificateAttribute
  • All Implemented Interfaces:
    java.io.Serializable


    public class AS400CertificateAttribute
    extends java.lang.Object
    implements java.io.Serializable

    The AS400CertificateAttribute class represents a certificate attribute. This attribute is used to identify certificates during a list operation. This class contains a single attribute which can be either a String or byte array value.

    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int PUBLIC_KEY_BYTES
      The byte array attribute type representing the subjectPublicKeyInfo field from the certificate.
      static int SUBJECT_COMMON_NAME
      Constant indicating the attribute represents the subject's common name in the certificate.
      static int SUBJECT_COUNTRY
      Constant indicating the attribute represents the subject's country in the certificate.
      static int SUBJECT_LOCALITY
      Constant indicating the attribute represents the subject's locality in the certificate.
      static int SUBJECT_ORGANIZATION
      Constant indicating the attribute represents the subject's organization in the certificate.
      static int SUBJECT_ORGANIZATION_UNIT
      Constant indicating the attribute represents the subject's organizational unit in the certificate.
      static int SUBJECT_STATE
      Contant indicating the attribute represents the subject's state or province in the certificate.
    • Constructor Summary

      Constructors 
      Constructor and Description
      AS400CertificateAttribute()
      Constructs an AS400CertificateAttribute object.
      AS400CertificateAttribute(int attributeType, byte[] attributeValue)
      Constructs an AS400CertificateAttribute object.
      AS400CertificateAttribute(int attributeType, java.lang.String attributeValue)
      Constructs an AS400CertificateAttribute object.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      int getAttributeType()
      Returns the attribute type.
      java.lang.Object getAttributeValue()
      Returns the attribute value.
      boolean isString()
      Indicates if the attribute is a String.
      void setAttribute(int attributeType, byte[] attributeValue)
      Sets the byte attribute value.
      void setAttribute(int attributeType, java.lang.String attributeValue)
      Sets the String attribute value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • PUBLIC_KEY_BYTES

        public static final int PUBLIC_KEY_BYTES
        The byte array attribute type representing the subjectPublicKeyInfo field from the certificate.
        See Also:
        Constant Field Values
      • SUBJECT_COMMON_NAME

        public static final int SUBJECT_COMMON_NAME
        Constant indicating the attribute represents the subject's common name in the certificate.
        See Also:
        Constant Field Values
      • SUBJECT_COUNTRY

        public static final int SUBJECT_COUNTRY
        Constant indicating the attribute represents the subject's country in the certificate.
        See Also:
        Constant Field Values
      • SUBJECT_LOCALITY

        public static final int SUBJECT_LOCALITY
        Constant indicating the attribute represents the subject's locality in the certificate.
        See Also:
        Constant Field Values
      • SUBJECT_STATE

        public static final int SUBJECT_STATE
        Contant indicating the attribute represents the subject's state or province in the certificate.
        See Also:
        Constant Field Values
      • SUBJECT_ORGANIZATION

        public static final int SUBJECT_ORGANIZATION
        Constant indicating the attribute represents the subject's organization in the certificate.
        See Also:
        Constant Field Values
      • SUBJECT_ORGANIZATION_UNIT

        public static final int SUBJECT_ORGANIZATION_UNIT
        Constant indicating the attribute represents the subject's organizational unit in the certificate.
        See Also:
        Constant Field Values
    • Constructor Detail

      • AS400CertificateAttribute

        public AS400CertificateAttribute()
        Constructs an AS400CertificateAttribute object.
      • AS400CertificateAttribute

        public AS400CertificateAttribute(int attributeType,
                                 byte[] attributeValue)
                                  throws ExtendedIllegalArgumentException
        Constructs an AS400CertificateAttribute object.
        Parameters:
        attributeType - The attribute type. Valid values are:
        • PUBLIC_KEY_BYTES
        attributeValue - The attribute value.
        Throws:
        ExtendedIllegalArgumentException - If the attribute Type is invalid.
      • AS400CertificateAttribute

        public AS400CertificateAttribute(int attributeType,
                                 java.lang.String attributeValue)
                                  throws ExtendedIllegalArgumentException
        Constructs an AS400CertificateAttribute object.
        Parameters:
        attributeType - The attribute type. Valid values are:
        • SUBJECT_COMMON_NAME
        • SUBJECT_COUNTRY
        • SUBJECT_LOCALITY
        • SUBJECT_ORGANIZATION
        • SUBJECT_ORGANIZATION_UNIT
        • SUBJECT_STATE
        attributeValue - The attribute value.
        Throws:
        ExtendedIllegalArgumentException - If the attribute Type is invalid.
    • Method Detail

      • getAttributeType

        public int getAttributeType()
        Returns the attribute type.
        Returns:
        The attribute type.
      • getAttributeValue

        public java.lang.Object getAttributeValue()
        Returns the attribute value.
        Returns:
        The attribute value.
      • isString

        public boolean isString()
        Indicates if the attribute is a String.
        Returns:
        Returns true if the attribute is a String; false otherwise.
      • setAttribute

        public void setAttribute(int attributeType,
                        byte[] attributeValue)
                          throws ExtendedIllegalArgumentException
        Sets the byte attribute value.
        Parameters:
        attributeType - The attribute type. Valid values are:
        • PUBLIC_KEY_BYTES
        attributeValue - The attribute value.
        Throws:
        ExtendedIllegalArgumentException - If the attribute Type is invalid.
      • setAttribute

        public void setAttribute(int attributeType,
                        java.lang.String attributeValue)
                          throws ExtendedIllegalArgumentException
        Sets the String attribute value.
        Parameters:
        attributeType - The attribute type. Valid values are:
        • SUBJECT_COMMON_NAME
        • SUBJECT_COUNTRY
        • SUBJECT_LOCALITY
        • SUBJECT_ORGANIZATION
        • SUBJECT_ORGANIZATION_UNIT
        • SUBJECT_STATE
        attributeValue - The attribute value.
        Throws:
        ExtendedIllegalArgumentException - If the attribute Type is invalid.