Class ExtensionsGenerator
-
- All Implemented Interfaces:
public class ExtensionsGeneratorGenerator for X.509 extensions
-
-
Constructor Summary
Constructors Constructor Description ExtensionsGenerator()
-
Method Summary
Modifier and Type Method Description voidreset()Reset the generator voidaddExtension(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. voidaddExtension(ASN1ObjectIdentifier oid, boolean critical, Array<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. voidaddExtension(Extension extension)Add a given extension. voidreplaceExtension(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. voidreplaceExtension(ASN1ObjectIdentifier oid, boolean critical, Array<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. voidreplaceExtension(Extension extension)Replace a given extension. voidremoveExtension(ASN1ObjectIdentifier oid)Remove a given extension. booleanhasExtension(ASN1ObjectIdentifier oid)Return if the extension indicated by OID is present. ExtensiongetExtension(ASN1ObjectIdentifier oid)Return the current value of the extension for OID. booleanisEmpty()Return true if there are no extension present in this generator. Extensionsgenerate()Generate an Extensions object based on the current state of the generator. voidaddExtension(Extensions extensions)-
-
Method Detail
-
reset
void reset()
Reset the generator
-
addExtension
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.
- Parameters:
oid- OID for the extension.critical- true if critical, false otherwise.value- the ASN.1 object to be included in the extension.
-
addExtension
void addExtension(ASN1ObjectIdentifier oid, boolean critical, Array<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.
- Parameters:
oid- OID for the extension.critical- true if critical, false otherwise.value- the byte array to be wrapped.
-
addExtension
void addExtension(Extension extension)
Add a given extension.
- Parameters:
extension- the full extension value.
-
replaceExtension
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.
- Parameters:
oid- OID for the extension.critical- true if critical, false otherwise.value- the ASN.1 object to be included in the extension.
-
replaceExtension
void replaceExtension(ASN1ObjectIdentifier oid, boolean critical, Array<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.
- Parameters:
oid- OID for the extension.critical- true if critical, false otherwise.value- the byte array to be wrapped.
-
replaceExtension
void replaceExtension(Extension extension)
Replace a given extension.
- Parameters:
extension- the full extension value.
-
removeExtension
void removeExtension(ASN1ObjectIdentifier oid)
Remove a given extension.
- Parameters:
oid- OID for the extension to remove.
-
hasExtension
boolean hasExtension(ASN1ObjectIdentifier oid)
Return if the extension indicated by OID is present.
- Parameters:
oid- the OID for the extension of interest.- Returns:
the Extension, or null if it is not present.
-
getExtension
Extension getExtension(ASN1ObjectIdentifier oid)
Return the current value of the extension for OID.
- Parameters:
oid- the OID for the extension we want to fetch.- Returns:
true if a matching extension is present, false otherwise.
-
isEmpty
boolean isEmpty()
Return true if there are no extension present in this generator.
- Returns:
true if empty, false otherwise
-
generate
Extensions generate()
Generate an Extensions object based on the current state of the generator.
- Returns:
an X09Extensions object.
-
addExtension
void addExtension(Extensions extensions)
-
-
-
-