Class Extension
-
- All Implemented Interfaces:
-
io.anyline.nfc.bouncycastle.asn1.ASN1Encodable,io.anyline.nfc.bouncycastle.util.Encodable
public class Extension extends ASN1Object
an object for the elements in the X.509 V3 extension block.
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Extension(ASN1ObjectIdentifier extnId, ASN1Boolean critical, ASN1OctetString value)Constructor using an ASN1Boolean and an OCTET STRING for the value. Extension(ASN1ObjectIdentifier extnId, boolean critical, Array<byte> value)Constructor using a byte[] for the value. Extension(ASN1ObjectIdentifier extnId, boolean critical, ASN1OctetString value)Constructor using an OCTET STRING for the value.
-
Method Summary
Modifier and Type Method Description ASN1ObjectIdentifiergetExtnId()static Extensioncreate(ASN1ObjectIdentifier extnId, boolean critical, ASN1Encodable value)Helper method to create an extension from any ASN.1 encodable object. static ExtensiongetInstance(Object obj)booleanisCritical()ASN1OctetStringgetExtnValue()ASN1EncodablegetParsedValue()inthashCode()booleanequals(Object o)ASN1PrimitivetoASN1Primitive()Method providing a primitive representation of this object suitable for encoding. -
-
Constructor Detail
-
Extension
Extension(ASN1ObjectIdentifier extnId, ASN1Boolean critical, ASN1OctetString value)
Constructor using an ASN1Boolean and an OCTET STRING for the value.- Parameters:
extnId- the OID associated with this extension.critical- will evaluate to true if the extension is critical, false otherwise.value- the extension's value wrapped in an OCTET STRING.
-
Extension
Extension(ASN1ObjectIdentifier extnId, boolean critical, Array<byte> value)
Constructor using a byte[] for the value.- Parameters:
extnId- the OID associated with this extension.critical- true if the extension is critical, false otherwise.value- the extension's value as a byte[] to be wrapped in an OCTET STRING.
-
Extension
Extension(ASN1ObjectIdentifier extnId, boolean critical, ASN1OctetString value)
Constructor using an OCTET STRING for the value.- Parameters:
extnId- the OID associated with this extension.critical- true if the extension is critical, false otherwise.value- the extension's value wrapped in an OCTET STRING.
-
-
Method Detail
-
getExtnId
ASN1ObjectIdentifier getExtnId()
-
create
static Extension create(ASN1ObjectIdentifier extnId, boolean critical, ASN1Encodable value)
Helper method to create an extension from any ASN.1 encodable object.
- Parameters:
extnId- the OID associated with this extension.critical- true if the extension is critical, false otherwise.value- the value to be encoded into the extension's OCTET STRING.- Returns:
a new Extension with the encoding of value in the bytes of the extension's OCTET STRING.
-
getInstance
static Extension getInstance(Object obj)
-
isCritical
boolean isCritical()
-
getExtnValue
ASN1OctetString getExtnValue()
-
getParsedValue
ASN1Encodable getParsedValue()
-
hashCode
int hashCode()
-
toASN1Primitive
ASN1Primitive toASN1Primitive()
Method providing a primitive representation of this object suitable for encoding.
- Returns:
a primitive representation of this object.
-
-
-
-