| Constructor: |
public CRLNumberExtension(int crlNum) throws IOException {
this(PKIXExtensions.CRLNumber_Id, false, BigInteger.valueOf(crlNum),
NAME, LABEL);
}
Create a CRLNumberExtension with the integer value .
The criticality is set to false. Parameters:
crlNum - the value to be set for the extension.
|
public CRLNumberExtension(BigInteger crlNum) throws IOException {
this(PKIXExtensions.CRLNumber_Id, false, crlNum, NAME, LABEL);
}
Create a CRLNumberExtension with the BigInteger value .
The criticality is set to false. Parameters:
crlNum - the value to be set for the extension.
|
public CRLNumberExtension(Boolean critical,
Object value) throws IOException {
this(PKIXExtensions.CRLNumber_Id, critical, value, NAME, LABEL);
}
Create the extension from the passed DER encoded value of the same. Parameters:
critical - true if the extension is to be treated as critical.
value - an array of DER encoded bytes of the actual value.
Throws:
ClassCastException - if value is not an array of bytes
IOException - on error.
- exception:
ClassCastException - if value is not an array of bytes
- exception:
IOException - on error.
|
protected CRLNumberExtension(ObjectIdentifier extensionId,
boolean isCritical,
BigInteger crlNum,
String extensionName,
String extensionLabel) throws IOException {
this.extensionId = extensionId;
this.critical = isCritical;
this.crlNumber = crlNum;
this.extensionName = extensionName;
this.extensionLabel = extensionLabel;
encodeThis();
}
Creates the extension (also called by the subclass). |
protected CRLNumberExtension(ObjectIdentifier extensionId,
Boolean critical,
Object value,
String extensionName,
String extensionLabel) throws IOException {
this.extensionId = extensionId;
this.critical = critical.booleanValue();
this.extensionValue = (byte[]) value;
DerValue val = new DerValue(this.extensionValue);
this.crlNumber = val.getBigInteger();
this.extensionName = extensionName;
this.extensionLabel = extensionLabel;
}
Creates the extension (also called by the subclass). |
| Method from sun.security.x509.CRLNumberExtension Detail: |
public void delete(String name) throws IOException {
if (name.equalsIgnoreCase(NUMBER)) {
crlNumber = null;
} else {
throw new IOException("Attribute name not recognized by"
+ " CertAttrSet:" + extensionName + ".");
}
encodeThis();
}
Delete the attribute value. |
public void encode(OutputStream out) throws IOException {
DerOutputStream tmp = new DerOutputStream();
encode(out, PKIXExtensions.CRLNumber_Id, true);
}
Write the extension to the DerOutputStream. |
protected void encode(OutputStream out,
ObjectIdentifier extensionId,
boolean isCritical) throws IOException {
DerOutputStream tmp = new DerOutputStream();
if (this.extensionValue == null) {
this.extensionId = extensionId;
this.critical = isCritical;
encodeThis();
}
super.encode(tmp);
out.write(tmp.toByteArray());
}
Write the extension to the DerOutputStream.
(Also called by the subclass) |
public Object get(String name) throws IOException {
if (name.equalsIgnoreCase(NUMBER)) {
if (crlNumber == null) return null;
else return crlNumber;
} else {
throw new IOException("Attribute name not recognized by"
+ " CertAttrSet:" + extensionName + ".");
}
}
|
public Enumeration getElements() {
AttributeNameEnumeration elements = new AttributeNameEnumeration();
elements.addElement(NUMBER);
return (elements.elements());
}
Return an enumeration of names of attributes existing within this
attribute. |
public String getName() {
return (extensionName);
}
Return the name of this attribute. |
public void set(String name,
Object obj) throws IOException {
if (name.equalsIgnoreCase(NUMBER)) {
if (!(obj instanceof BigInteger)) {
throw new IOException("Attribute must be of type BigInteger.");
}
crlNumber = (BigInteger)obj;
} else {
throw new IOException("Attribute name not recognized by"
+ " CertAttrSet:" + extensionName + ".");
}
encodeThis();
}
|
public String toString() {
String s = super.toString() + extensionLabel + ": " +
((crlNumber == null) ? "" : Debug.toHexString(crlNumber))
+ "\n";
return (s);
}
Returns a printable representation of the CRLNumberExtension. |