|
IAIK CMS/SMIME Toolkit API Documentation
Version 6.1 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectiaik.asn1.structures.AttributeValue
iaik.smime.ess.ESSAttributeValue
iaik.smime.ess.MLExpansionHistory
public class MLExpansionHistory
The S/MIMEv3 ESS MLExpansionHistory attribute.
The Enhanced Security Services
for S/MIMEv3 (ESS) (RFC 2634) specifies the MLExpansionHistory
attribute to may be included as signed attribute in a SignerInfo for recording the mailing list agents (MLA) that have processed a
message. As an MLA distributes a message to members of an ML, the MLA records
its unique identifier, date and time of expansion, and receipt policy in an
MLData structure and adds it to the MLData list
of an MLExpansionHistory attribute. If yet no MLData has been added to the list
the particular MLA MLData will become the first entry in the list:
MLExpansionHistory ::= SEQUENCE
SIZE (1..ub-ml-expansion-history) OF MLData
MLData ::= SEQUENCE {
mailListIdentifier EntityIdentifier,
expansionTime GeneralizedTime,
mlReceiptPolicy MLReceiptPolicy OPTIONAL }
Each MLA processing a message checks if its MLData already is included
in the MLExpansionHistory list. If it detects its own identification
information, then the MLA must discontinue expansion processing and
should provide warning of an expansion loop to a human mail list
administrator. The mail list administrator is responsible for correcting
the loop condition. Please refer to
(RFC 2634) (Section 4) for a more detailed discussion about mail
list expansion and MLA processing.
Since at least one MLData entry has to
be present the MLA creating an
MLExpansionHistory attribute, supplies an MLData object carrying its
identification information,
time of expansion and optional MLReceiptPolicy superseding the originator request for
signed receipts, if present:
// the MLA is identified by an IssuerAndSerialNumber: IssuerAndSerialNumber issuerAndSerialNumber = ...; EntityIdentifier mailListID = new EntityIdentifier(issuerAndSerialNumber); // the time the MLA processed the message Date expansionTime = ...; // create the MLData: MLData mlData = new MLData(mailListID, expansionTime); // a list of recipients to which receipts should be returned in addition to the originator: GeneralNames recipientList = ...; // create a MLReceiptPolicy of appropriate type: MLReceiptPolicy mlReceiptPolicy = new MLReceiptPolicy(MLReceiptPolicy.IN_ADDITION_TO, recipientList); // set the MLReceiptPolicy of the MLData: mlData.setMLReceiptPolicy(mlReceiptPolicy); // Create an MLExpansionHistory attribute and set the MLData as first list entry: MLExpansionHistory mlExpansionHistory = new MLExpansionHistory(mlData);Any further MLA may add its MLData to the list by calling method
addMLData. However, for preventing from causing an expansion
loop the MLA first may check if it already
has added an MLData to the list. When adding its MLData to an MLExpansionHistory
that already has reached its allowed limit of
64 entries, an MLExpansionHistoryOverflowException will be thrown indicating to notify
the ML administrator to correct the overflow condition:
// the mail list identifier of the MLA going to add an MLData entry:
EntityIdentifier myMLId = ...;
// the MLData to be added:
MLData myMLData = ...;
// check for expansion loop
if (mlExpansionHistory.getMLData(myMLId) == null) {
try {
mlExpansionHistory.addMLData(myMLData);
} catch (MLExpansionHistoryOverflowException ex) {
System.err.println("MLExpansionHistory overflow!");
MLData[] mlDataList = ex.getMLDataList();
...
}
}
The array of MLData objects returned when calling method getMLDataList will already include the MLData object just added
and causing the overflow. An MLExpansionHistoryOverflowException
also will be thrown when reading in and attempting to parse an overflowed MLExpansionHistory
attribute from its ASN.1 representation. For that reason
MLExpansionHistoryOverflowException is a RuntimeException because
method decode inherited from class
AttributeValue allows a CodingException only.
EntityIdentifier,
MLReceiptPolicy,
MLData,
MLExpansionHistoryOverflowException| Field Summary | |
|---|---|
static iaik.asn1.ObjectID |
oid
The attributeType object identifier of this MLExpansionHistory attribute. |
static int |
UB_ML_EXPANSION_HISTORY
The maximum number (64) of MLData objects allowed to be in the list. |
| Constructor Summary | |
|---|---|
MLExpansionHistory()
Empty default constructor. |
|
MLExpansionHistory(iaik.asn1.ASN1Object obj)
Creates an MLExpansionHistory from the given ASN1Object. |
|
MLExpansionHistory(MLData mlData)
Creates an MLExpansionHistory attribute for the given MLData. |
|
MLExpansionHistory(MLData[] mlDataList)
Creates an MLExpansionHistory for the given MLData list. |
|
| Method Summary | |
|---|---|
void |
addMLData(MLData mlData)
Adds the given MLData to this MLExpansionHistory. |
int |
countMLDataEntries()
Counts the number of MLData entries included in the list. |
void |
decode(iaik.asn1.ASN1Object obj)
Decodes the MLExpansionHistory from the given ASN1Object. |
boolean |
equals(java.lang.Object obj)
Compares this MLExpansionHistory to the specified object. |
iaik.asn1.ObjectID |
getAttributeType()
Returns the OID identifying the MLExpansionHistory attribute type. |
MLData |
getLastMLData()
Returns the last MLData object in the list. |
MLData |
getMLData(EntityIdentifier mailListIdentifier)
Looks for the MLData belonging to the MLA identified by the given mail list identifier. |
MLData[] |
getMLDataList()
Gets the MLData list contained in this MLExpansionHistory. |
int |
hashCode()
Returns a hashcode for this object. |
void |
setMLDataList(MLData[] mlDataList)
Sets the MLData list of this MLExpansionHistory. |
iaik.asn1.ASN1Object |
toASN1Object()
Returns this MLExpansionHistory as ASN1Object. |
java.lang.String |
toString()
Returns a string giving some information about this MLExpansionHistory. |
java.lang.String |
toString(boolean detailed)
Returns a string giving some information about this MLExpansionHistory. |
| Methods inherited from class iaik.smime.ess.ESSAttributeValue |
|---|
multipleAllowed |
| Methods inherited from class iaik.asn1.structures.AttributeValue |
|---|
getName |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final iaik.asn1.ObjectID oid
MLExpansionHistory attribute.
The corresponding OID string is "1.2.840.113549.1.9.16.2.3".
public static final int UB_ML_EXPANSION_HISTORY
If the number of MLData objects contained
in an MLExpansionHistory exceeds an allowed upper bound of 64 entries an MLExpansionHistoryOverflowException
is thrown to indicate the list overflow. Nevertheless an application might whish to
query for the MLData objects included by calling method getMLDataList of class MLExpansionHistoryOverflowException:
try {
...
} catch (MLExpansionHistoryOverflowException ex) {
System.err.println("MLExpansionHistory overflow!");
MLData[] mlDataList = ex.getMLDataList();
...
}
| Constructor Detail |
|---|
public MLExpansionHistory()
public MLExpansionHistory(MLData mlData)
mlData - the mlData being the first (and maybe only) entry
in the list
public MLExpansionHistory(MLData[] mlDataList)
throws MLExpansionHistoryOverflowException
mlDataList - the MLData list to be set
MLExpansionHistoryOverflowException - if the number of MLData objects
included in the list exceeds the allowed maximum (64 entries)
public MLExpansionHistory(iaik.asn1.ASN1Object obj)
throws iaik.asn1.CodingException,
MLExpansionHistoryOverflowException
obj - the MLExpansionHistory as ASN1Object
iaik.asn1.CodingException - if the ASN1Object cannot be decoded or
is invalid structured
MLExpansionHistoryOverflowException - if the number of MLData objects
included in the list exceeds the allowed maximum (64 entries)| Method Detail |
|---|
public iaik.asn1.ObjectID getAttributeType()
getAttributeType in class iaik.asn1.structures.AttributeValue
public void addMLData(MLData mlData)
throws MLExpansionHistoryOverflowException
If the MLData to be added exceeds an allowed upper bound of 64 entries an MLExpansionHistoryOverflowException is thrown to indicate the
list overflow. Nevertheless an application might whish to
query for the MLData objects included by calling method getMLDataList of class MLExpansionHistoryOverflowException:
try {
mlExpansionHistory.addMLData(mlData);
} catch (MLExpansionHistoryOverflowException ex) {
System.err.println("MLExpansionHistory overflow!");
MLData[] mlDataList = ex.getMLDataList();
...
}
The array of MLData objects returned when calling method getMLDataList will already include the MLData object just added
and causing the overflow.
mlData - the MLData to be added
MLExpansionHistoryOverflowException - if the number of MLData objects
included in the list exceeds the allowed maximum (64 entries) when
adding the new MLData
public void setMLDataList(MLData[] mlDataList)
throws MLExpansionHistoryOverflowException
Any entry included is cleared before setting the list.
mlDataList - the MLData list to be set
MLExpansionHistoryOverflowException - if the number of MLData objects
included in the list exceeds the allowed maximum (64 entries)public MLData getMLData(EntityIdentifier mailListIdentifier)
This method may be used by an MLA to check its own unique identifier already is in the list. If yes the MLA knows that a mail list loop has been formed, and does not send the message to the list again.
mailListIdentifier - the EntityIdentifier of the MLA in mind
null if
no MLData for this MLA is in the list (no loop)public MLData[] getMLDataList()
public MLData getLastMLData()
null if the
MLData list is emptypublic int countMLDataEntries()
This method may be useful for checking if the list would exeed its
maximum allowed number (64) of
entries when adding a new MLData.
public boolean equals(java.lang.Object obj)
MLExpansionHistory to the specified object.
equals in class ESSAttributeValueobj - the object to compare this MLExpansionHistory
against.
true, if the given object is equal to this
MLExpansionHistory,
false otherwisepublic int hashCode()
hashCode in class ESSAttributeValue
public void decode(iaik.asn1.ASN1Object obj)
throws iaik.asn1.CodingException,
MLExpansionHistoryOverflowException
obj - the MLExpansionHistory as ASN1Object
iaik.asn1.CodingException - if the ASN1Object cannot be decoded or
is invalid structured
MLExpansionHistoryOverflowException - if the number of MLData objects
included in the list exceeds the allowed maximum (64 entries)
public iaik.asn1.ASN1Object toASN1Object()
throws iaik.asn1.CodingException
iaik.asn1.CodingException - if an error occurs while creating the ASN.1 SEQUENCEpublic java.lang.String toString(boolean detailed)
detailed - whether to print detailed information about the MLData
objects included
public java.lang.String toString()
toString in class iaik.asn1.structures.AttributeValue
|
IAIK CMS/SMIME Toolkit API Documentation
Version 6.1 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
|
v6.1 (c) 2002 IAIK, (c) 2003 - 2025 SIC |
|