public abstract class IetfAttrSyntax extends AttributeValue
IetfAttrSyntax
type specified by the
PKIX X.509 Attribute Certificate profile (
RFC 5755) to be used as base type for the Charging Identity
and Group
attribute types.
The ASN.1 definition for the IetfAttrSyntax
type is as follows
(see RFC 5755):
IetfAttrSyntax ::= SEQUENCE { policyAuthority [0] GeneralNames OPTIONAL, values SEQUENCE OF CHOICE { octets OCTET STRING, oid OBJECT IDENTIFIER, string UTF8String } }The
policyAuthority
field maybe set to separate between the
AC issuer and the attribute policy authority.
Although the values
field is specified as SEQUENCE OF CHOICE
of OCTET_STRING
, ObjectID
, or UTF8String
types, only one of
these types must be present. This means that in practice values
only can be a SEQUENCE OF OCTET_STRING objects, a SEQUENCE OF ObjectID objects,
or a SEQUENCE OF UTF8String objects.ChargingIdentity
,
Group
,
AttributeCertificate
,
Attribute
,
GeneralNames
,
OCTET_STRING
,
ObjectID
,
UTF8String
Modifier | Constructor and Description |
---|---|
protected |
IetfAttrSyntax(ASN1Object obj)
Creates an IetfAttrSyntax from its ASN.1 representation.
|
protected |
IetfAttrSyntax(boolean multipleValuesAllowed)
Creates a new empty IetfAttrSyntax.
|
protected |
IetfAttrSyntax(byte[][] values,
boolean multipleValuesAllowed)
Creates an IetfAttrSyntax for the given byte[] values array.
|
protected |
IetfAttrSyntax(ObjectID[] values,
boolean multipleValuesAllowed)
Creates an IetfAttrSyntax for the given ObjectID values array.
|
protected |
IetfAttrSyntax(java.lang.String[] values,
boolean multipleValuesAllowed)
Creates an IetfAttrSyntax for the given String values array.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsValue(java.lang.Object value)
Checks whether the given value is included in this IetfAttrSyntax.
|
void |
decode(ASN1Object obj)
Decodes an IetfAttrSyntax from its ASN.1 representation.
|
ASN |
getASN1TypeOfValues()
Gets the ASN.1 type of the values contained in this
IetfAttrSyntax.
|
GeneralNames |
getPolicyAuthority()
Gets the
policyAuthority field of this IetfAttrSyntax. |
java.util.Enumeration |
getValues()
Gets an enumeration with all values included in this
IetfAttrSyntax.
|
int |
numberOfValues()
Gets the number of values included in this IetfAttrSyntax.
|
void |
setPolicyAuthority(GeneralNames policyAuthority)
Sets the
policyAuthority field of this IetfAttrSyntax. |
ASN1Object |
toASN1Object()
Returns this IetfAttrSyntax as ASN1Object.
|
java.lang.String |
toString()
Returns a String representation of this IetfAttrSyntax object.
|
getAttributeType, getName, multipleAllowed
protected IetfAttrSyntax(boolean multipleValuesAllowed)
multipleValuesAllowed
- whether multiple values are allowed
in the values
field of this IetfAttrSyntax
(default: true). This does only concern the values field
of the IetfAttrSyntax, but not the SET OF AttributeValue
of the general Attribute
type. For instance, it maybe possible to have multiple
IetfAttrSyntax elemnets in the SET OF AttributeValue,
but each IetfAttrSyntax itself only must contain one single
(OCTET_STRING, ObjectID or UTF8String) valueprotected IetfAttrSyntax(byte[][] values, boolean multipleValuesAllowed) throws java.lang.IllegalArgumentException
Use method setPolicyAuthority
for
specifying an attribute policy authority, if required.
values
- a number of byte arrays representing the
OCTET_STRING values of this IetfAttrSyntaxmultipleValuesAllowed
- whether multiple values are allowed
in the values
field of this IetfAttrSyntax
(default: true). This does only concern the values field
of the IetfAttrSyntax, but not the SET OF AttributeValue
of the general Attribute
type. For instance, it maybe possible to have multiple
IetfAttrSyntax elemnets in the SET OF AttributeValue,
but each IetfAttrSyntax itself only must contain one single
OCTET_STRING valuejava.lang.IllegalArgumentException
- if this IetfAttrSyntax only
allows one value but the given array contains more than
one valuejava.lang.NullPointerException
- if values is null
protected IetfAttrSyntax(java.lang.String[] values, boolean multipleValuesAllowed) throws java.lang.IllegalArgumentException
Use method setPolicyAuthority
for
specifying an attribute policy authority, if required.
values
- a String array representing the
UTF8String values of this IetfAttrSyntaxmultipleValuesAllowed
- whether multiple values are allowed
in the values
field of this IetfAttrSyntax
(default: true). This does only concern the values field
of the IetfAttrSyntax, but not the SET OF AttributeValue
of the general Attribute
type. For instance, it maybe possible to have multiple
IetfAttrSyntax elemnets in the SET OF AttributeValue,
but each IetfAttrSyntax itself only must contain one single
UTF8String valuejava.lang.IllegalArgumentException
- if this IetfAttrSyntax only
allows one value but the given array contains more than
one valuejava.lang.NullPointerException
- if values is null
protected IetfAttrSyntax(ObjectID[] values, boolean multipleValuesAllowed) throws java.lang.IllegalArgumentException
Use method setPolicyAuthority
for
specifying an attribute policy authority, if required.
values
- an ObjectID array representing the
ObjectID values of this IetfAttrSyntaxmultipleValuesAllowed
- whether multiple values are allowed
in the values
field of this IetfAttrSyntax
(default: true). This does only concern the values field
of the IetfAttrSyntax, but not the SET OF AttributeValue
of the general Attribute
type. For instance, it maybe possible to have multiple
IetfAttrSyntax elemnets in the SET OF AttributeValue,
but each IetfAttrSyntax itself only must contain one single
ObjectID valuejava.lang.IllegalArgumentException
- if this IetfAttrSyntax only
allows one value but the given array contains more than
one valuejava.lang.NullPointerException
- if values is null
protected IetfAttrSyntax(ASN1Object obj) throws CodingException
policyAuthority
and values
fields from the given ASN.1 object:
IetfAttrSyntax ::= SEQUENCE { policyAuthority [0] GeneralNames OPTIONAL, values SEQUENCE OF CHOICE { octets OCTET STRING, oid OBJECT IDENTIFIER, string UTF8String } }The
policyAuthority
field maybe set to separate between the
AC issuer and the attribute policy authority.
Although the values
field is specified as SEQUENCE OF CHOICE
of OCTET_STRING
, ObjectID
, or UTF8String
types, only one of
these types must be present. This means that in practice values
only can be a SEQUENCE OF OCTET_STRING objects, a SEQUENCE OF ObjectID objects,
or a SEQUENCE OF UTF8String objects.obj
- the IetfAttrSyntax as ASN1ObjectCodingException
- if the ASN.1 object cannot be parsed or is
invalid structured (e.g. if the values
component
does not contain only OCTET_STRING
, ObjectID
, or
UTF8String
objectspublic boolean containsValue(java.lang.Object value)
ASN.1 type
of
the values contained in this IetfAttrSyntax, the given value
to be checked may either be a byte[] array (for OCTET_STRING),
String (for UTF8String), or ObjectID object.value
- the value to be checked if being includedtrue
if the value is included,
false
if it is not includedpublic ASN getASN1TypeOfValues()
OCTET_STRING
,
ObjectID
, or UTF8String
)OCTET_STRING
,
ObjectID
, or UTF8String
, or null
if this IetfAttrSyntax does
not contain any valuespublic java.util.Enumeration getValues()
ASN.1 type
of the values, the array returned by this method
may either contain byte[] array (for OCTET_STRING values), String
(for UTF8String values), or ObjectID values.public int numberOfValues()
public GeneralNames getPolicyAuthority()
policyAuthority
field of this IetfAttrSyntax.
The policyAuthority
field maybe set to separate between the
AC issuer and the attribute policy authority.null
if no policyAuthority is includedpublic void setPolicyAuthority(GeneralNames policyAuthority)
policyAuthority
field of this IetfAttrSyntax.
The policyAuthority
field maybe set to separate between the
AC issuer and the attribute policy authority.policyAuthority
- the policy authority to be setpublic void decode(ASN1Object obj) throws CodingException
policyAuthority
and values
fields from the given ASN.1 object:
IetfAttrSyntax ::= SEQUENCE { policyAuthority [0] GeneralNames OPTIONAL, values SEQUENCE OF CHOICE { octets OCTET STRING, oid OBJECT IDENTIFIER, string UTF8String } }The
policyAuthority
field maybe set to separate between the
AC issuer and the attribute policy authority.
Although the values
field is specified as SEQUENCE OF CHOICE
of OCTET_STRING
, ObjectID
, or UTF8String
types, only one of
these types must be present. This means that in practice values
only can be a SEQUENCE OF OCTET_STRING objects, a SEQUENCE OF ObjectID objects,
or a SEQUENCE OF UTF8String objects.obj
- the IetfAttrSyntax as ASN1ObjectCodingException
- if the ASN.1 object cannot be parsed or is
invalid structured (e.g. if the values
component
does not contain only OCTET_STRING
, ObjectID
, or
UTF8String
objectspublic ASN1Object toASN1Object() throws CodingException
IetfAttrSyntax
type is as follows
(see RFC 5755):
IetfAttrSyntax ::= SEQUENCE { policyAuthority [0] GeneralNames OPTIONAL, values SEQUENCE OF CHOICE { octets OCTET STRING, oid OBJECT IDENTIFIER, string UTF8String } }The
policyAuthority
field maybe set to separate between the
AC issuer and the attribute policy authority.
Although the values
field is specified as SEQUENCE OF CHOICE
of OCTET_STRING
, ObjectID
, or UTF8String
types, only one of
these types must be present. This means that in practice values
only can be a SEQUENCE OF OCTET_STRING objects, a SEQUENCE OF ObjectID objects,
or a SEQUENCE OF UTF8String objects.CodingException
- if an error occurs when creating the ASN1Objectpublic java.lang.String toString()
toString
in class AttributeValue