public class ExtensionsGenerator
extends java.lang.Object
Constructor and Description |
---|
ExtensionsGenerator() |
Modifier and Type | Method and Description |
---|---|
void |
addExtension(ASN1ObjectIdentifier oid,
boolean critical,
ASN1Encodable value)
Add an extension with the given oid and the passed in value to be included
in the OCTET STRING associated with the extension.
|
void |
addExtension(ASN1ObjectIdentifier oid,
boolean critical,
byte[] value)
Add an extension with the given oid and the passed in byte array to be wrapped in the
OCTET STRING associated with the extension.
|
void |
addExtension(Extension extension)
Add a given extension.
|
void |
addExtension(Extensions extensions) |
Extensions |
generate()
Generate an Extensions object based on the current state of the generator.
|
Extension |
getExtension(ASN1ObjectIdentifier oid)
Return the current value of the extension for OID.
|
boolean |
hasExtension(ASN1ObjectIdentifier oid)
Return if the extension indicated by OID is present.
|
boolean |
isEmpty()
Return true if there are no extension present in this generator.
|
void |
removeExtension(ASN1ObjectIdentifier oid)
Remove a given extension.
|
void |
replaceExtension(ASN1ObjectIdentifier oid,
boolean critical,
ASN1Encodable value)
Replace an extension with the given oid and the passed in value to be included
in the OCTET STRING associated with the extension.
|
void |
replaceExtension(ASN1ObjectIdentifier oid,
boolean critical,
byte[] value)
Replace an extension with the given oid and the passed in byte array to be wrapped in the
OCTET STRING associated with the extension.
|
void |
replaceExtension(Extension extension)
Replace a given extension.
|
void |
reset()
Reset the generator
|
public void reset()
public void addExtension(ASN1ObjectIdentifier oid, boolean critical, ASN1Encodable value) throws java.io.IOException
oid
- OID for the extension.critical
- true if critical, false otherwise.value
- the ASN.1 object to be included in the extension.java.io.IOException
public void addExtension(ASN1ObjectIdentifier oid, boolean critical, byte[] value)
oid
- OID for the extension.critical
- true if critical, false otherwise.value
- the byte array to be wrapped.public void addExtension(Extension extension)
extension
- the full extension value.public void replaceExtension(ASN1ObjectIdentifier oid, boolean critical, ASN1Encodable value) throws java.io.IOException
oid
- OID for the extension.critical
- true if critical, false otherwise.value
- the ASN.1 object to be included in the extension.java.io.IOException
public void replaceExtension(ASN1ObjectIdentifier oid, boolean critical, byte[] value)
oid
- OID for the extension.critical
- true if critical, false otherwise.value
- the byte array to be wrapped.public void replaceExtension(Extension extension)
extension
- the full extension value.public void removeExtension(ASN1ObjectIdentifier oid)
oid
- OID for the extension to remove.public boolean hasExtension(ASN1ObjectIdentifier oid)
oid
- the OID for the extension of interest.public Extension getExtension(ASN1ObjectIdentifier oid)
oid
- the OID for the extension we want to fetch.public boolean isEmpty()
public Extensions generate()
public void addExtension(Extensions extensions)