Class ByteArrayAttribute


  • public class ByteArrayAttribute
    extends Attribute
    Objects of this class represent a byte-array attribute of a PKCS#11 object as specified by PKCS#11.
    Author:
    Karl Scheibelhofer (SIC), Lijun Liao (xipki)
    • Constructor Detail

      • ByteArrayAttribute

        public ByteArrayAttribute​(long type)
        Constructor taking the PKCS#11 type of the attribute.
        Parameters:
        type - The PKCS#11 type of this attribute; e.g. CKA_VALUE.
    • Method Detail

      • byteArrayValue

        public ByteArrayAttribute byteArrayValue​(byte[] value)
        Set the byte-array value of this attribute. Null, is also valid. A call to this method sets the present flag to true.
        Parameters:
        value - The byte-array value to set. May be null.
        Returns:
        a reference to this object.
      • bigIntValue

        public ByteArrayAttribute bigIntValue​(BigInteger value)
        Set the big integer value whose unsigned byte-array representation is the content of this attribute. Null, is also valid. A call to this method sets the present flag to true.
        Parameters:
        value - The byte-array value to set. May be null.
        Returns:
        a reference to this object.
      • getValue

        public byte[] getValue()
        Get the byte-array value of this attribute. Null, is also possible.
        Specified by:
        getValue in class Attribute
        Returns:
        The byte-array value of this attribute or null.
      • getBigIntValue

        public BigInteger getBigIntValue()
      • getSignedBigIntValue

        public BigInteger getSignedBigIntValue()
      • getValueString

        protected String getValueString()
        Get a string representation of the value of this attribute.
        Overrides:
        getValueString in class Attribute
        Returns:
        A string representation of the value of this attribute.