Package org.xipki.pkcs11.wrapper.attrs
Class ByteArrayAttribute
- java.lang.Object
-
- org.xipki.pkcs11.wrapper.attrs.Attribute
-
- org.xipki.pkcs11.wrapper.attrs.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)
-
-
Field Summary
-
Fields inherited from class org.xipki.pkcs11.wrapper.attrs.Attribute
ckAttribute, present, sensitive
-
-
Constructor Summary
Constructors Constructor Description ByteArrayAttribute(long type)Constructor taking the PKCS#11 type of the attribute.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteArrayAttributebigIntValue(BigInteger value)Set the big integer value whose unsigned byte-array representation is the content of this attribute.ByteArrayAttributebyteArrayValue(byte[] value)Set the byte-array value of this attribute.BigIntegergetBigIntValue()BigIntegergetSignedBigIntValue()byte[]getValue()Get the byte-array value of this attribute.protected StringgetValueString()Get a string representation of the value of this attribute.-
Methods inherited from class org.xipki.pkcs11.wrapper.attrs.Attribute
ckAttribute, getCkAttribute, getInstance, getInstance, getType, isNullValue, isPresent, isSensitive, present, sensitive, toString, toString, type
-
-
-
-
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.
-
getBigIntValue
public BigInteger getBigIntValue()
-
getSignedBigIntValue
public BigInteger getSignedBigIntValue()
-
getValueString
protected String getValueString()
Get a string representation of the value of this attribute.- Overrides:
getValueStringin classAttribute- Returns:
- A string representation of the value of this attribute.
-
-