public class DistributionPoint
extends java.lang.Object
DistributionPoint as used
within a CRLDistributionPoints X.509v3 extension for identifying
how CRL information is obtained.
The X.509 Certificate and CRL profile presented in RFC 3280 specifies a DistributionPoint
as ASN.1 SEQUENCE structure specifying a distribution point name which may be an
URI pointing to the current CRL for the associated reasons, issued by the associated
cRLIssuer:
DistributionPoint ::= SEQUENCE {
distributionPoint [0] DistributionPointName OPTIONAL,
reasons [1] ReasonFlags OPTIONAL,
cRLIssuer [2] GeneralNames OPTIONAL }
DistributionPointName ::= CHOICE {
fullName [0] GeneralNames,
nameRelativeToCRLIssuer [1] RelativeDistinguishedName }
ReasonFlags ::= BIT STRING {
unused (0),
keyCompromise (1),
cACompromise (2),
affiliationChanged (3),
superseded (4),
cessationOfOperation (5),
certificateHold (6) }
If the distributionPoint omits reasons, the CRL shall include revocations for all reasons. If the distributionPoint omits cRLIssuer, the CRL shall be issued by the CA that issued the certificate.
More information can be found in the X.509 Certificate and CRL profile presented in RFC 3280, section 4.2.1.14 "CRLDistributionPoints".
When creating a DistributionPoint object to be used for the CRLDistributionPoints extension, you
may supply the distributionPointName immediately, and subsequently perhaps use the
setReasonFlags and/or
setCrlIssuer methods for setting the reasons
and/or cRLIssuer, e.g.:
e.g.:
GeneralName dpName = new GeneralName(GeneralName.uniformResourceIdentifier, "http://www.test-ca.at/repository"); DistributionPoint dp = new DistributionPoint(new GeneralNames(dpName)); dp.setReasonFlags(DistributionPoint.keyCompromise);
CRLDistributionPoints,
GeneralNames,
GeneralName,
Name| Modifier and Type | Field and Description |
|---|---|
static int |
affiliationChanged
The
affiliationChanged reason flag. |
static int |
cACompromise
The
cACompromise reason flag. |
static int |
certificateHold
The
certificateHold reason flag. |
static int |
cessationOfOperation
The
cessationOfOperation reason flag. |
static int |
keyCompromise
The
keyCompromise reason flag. |
static int |
superseded
The
superseded reason flag. |
static int |
unused
The
unused reason flag. |
| Constructor and Description |
|---|
DistributionPoint()
Default constructor.
|
DistributionPoint(ASN1Object distributionPoint)
Constructs a DistributionPoint from an ASN1Object.
|
DistributionPoint(ASN1Type distributionPointName)
Creates a new DistributionPoint for the given distribution point name,
specified as
RDN or a GeneralNames. |
| Modifier and Type | Method and Description |
|---|---|
GeneralNames |
getCrlIssuer()
Returns the CRL Issuer parameter of this distribution point.
|
ASN1Type |
getDistributionPointName()
Returns the distribution point name of this distribution point.
|
int |
getReasonFlags()
Returns the reason flags specification of this distribution point.
|
void |
setCrlIssuer(GeneralNames crlIssuer)
Sets the CRL Issuer parameter of this extension.
|
void |
setDistributionPointName(ASN1Type distributionPointName)
Sets the distribution point name parameter of this extension.
|
void |
setReasonFlags(int reasonFlags)
Sets the reason flags parameter of this extension.
|
ASN1Object |
toASN1Object()
Returns this DistributionPoint as (SEQUENCE) ASN1Object.
|
java.lang.String |
toString()
Returns a string that represents the contents of this DistributionPoint.
|
public static int unused
unused reason flag.public static int keyCompromise
keyCompromise reason flag.public static int cACompromise
cACompromise reason flag.public static int affiliationChanged
affiliationChanged reason flag.public static int superseded
superseded reason flag.public static int cessationOfOperation
cessationOfOperation reason flag.public static int certificateHold
certificateHold reason flag.public DistributionPoint()
DistributionPoint object.
Per default, reasonFlag is set to -1 indicating that no
reason is selected, DistributionPointName and CrlIssuer
are set to null. Use setReasonFlags,
setDistributionPointName,
setCrlIssuer for setting the corresponding
values.
public DistributionPoint(ASN1Type distributionPointName) throws java.lang.IllegalArgumentException
RDN or a GeneralNames.
The supplied distribution point name has to be a RDN or a GeneralNames object:
For instance:
RDN distributionPointName = new RDN(); distributionPointName.addAVA(ObjectID.country, "AT"); distributionPointName.addAVA(ObjectID.locality, "Graz"); distributionPointName.addAVA(ObjectID.organization ,"UT Graz"); distributionPointName.addAVA(ObjectID.organizationalUnit ,"IAIK"); distributionPointName.addAVA(ObjectID.commonName ,"http://ca.iaik.com/"); DistributionPoint distributionPoint = new DistributionPoint(distributionPointName);
distributionPointName - the name of the distribution point as RDN or GeneralNames objectjava.lang.IllegalArgumentException - if the given name is not an instance of RDN
or GeneralNamesGeneralName,
RDNpublic DistributionPoint(ASN1Object distributionPoint) throws CodingException
The given distribution point ASN1Object is parsed for any distribution point name, reasons specification and CRLIssuer.
distributionPoint - the DistributionPoint as ASN1ObjectCodingException - if the ASN1Object is not a DistributionPointpublic ASN1Object toASN1Object() throws CodingException
CodingException - if there was an error while constructing the ASN1Objectpublic void setDistributionPointName(ASN1Type distributionPointName) throws java.lang.IllegalArgumentException
Only instances of RDN or GeneralNames are accepted!
For instance:
RDN distributionPointName = new RDN(); distributionPointName.addAVA(ObjectID.country, "AT"); distributionPointName.addAVA(ObjectID.locality, "Graz"); distributionPointName.addAVA(ObjectID.organization ,"UT Graz"); distributionPointName.addAVA(ObjectID.organizationalUnit ,"IAIK"); distributionPointName.addAVA(ObjectID.commonName ,"http://ca.iaik.com/"); DistributionPoint distributionPoint = new DistributionPoint(); distributionPoint.setDistributionPointName(distributionPointName);
distributionPointName - the name to be setjava.lang.IllegalArgumentException - if the given name is not an instance of RDN
or GeneralNamesGeneralNames,
RDNpublic void setReasonFlags(int reasonFlags)
For instance:
distributionPoint.setReasonFlags(DistributionPoint.keyCompromise);
reasonFlags - the reasons value as intpublic void setCrlIssuer(GeneralNames crlIssuer)
For instance:
GeneralNames generalNames = new GeneralNames(); generalNames.addName(new GeneralName(GeneralName.uniformResourceIdentifier, "http://ca.iaik.com/"));
crlIssuer - the CRL Issuer value to be set as GeneralNamespublic ASN1Type getDistributionPointName()
GeneralNames or as RDNGeneralNames,
RDN,
setDistributionPointName(iaik.asn1.ASN1Type)public int getReasonFlags()
Note the "big endian" representation of the BIT STRING representing the
reason flag value of this DistributionPoint: the least significant
bit indicates the reason flag with the lowest bit value, meaning that the integer
value 1 specifies the "unused" flag, and the integer value 64 (binary 1000000,
hexadecimal 40) specifies the "certificateHold" purpose.
intsetReasonFlags(int)public GeneralNames getCrlIssuer()
GeneralNames objectGeneralNames,
setCrlIssuer(iaik.asn1.structures.GeneralNames)public java.lang.String toString()
toString in class java.lang.Object