-
public interface Extension
This interface represents an X.509 extension.Extensions provide a means of associating additional attributes with users or public keys and for managing a certification hierarchy. The extension format also allows communities to define private extensions to carry information unique to those communities.
Each extension contains an object identifier, a criticality setting indicating whether it is a critical or a non-critical extension, and and an ASN.1 DER-encoded value. Its ASN.1 definition is:
Extension ::= SEQUENCE { extnId OBJECT IDENTIFIER, critical BOOLEAN DEFAULT FALSE, extnValue OCTET STRING -- contains a DER encoding of a value -- of the type registered for use with -- the extnId object identifier value }
This interface is designed to provide access to a single extension, unlike
X509Extension
which is more suitable for accessing a set of extensions.- Since:
- 1.7
-
-
Method Summary
Methods Modifier and Type Method and Description void
encode(OutputStream out)
Generates the extension's DER encoding and writes it to the output stream.String
getId()
Gets the extensions's object identifier.byte[]
getValue()
Gets the extensions's DER-encoded value.boolean
isCritical()
Gets the extension's criticality setting.
-
-
-
Method Detail
-
getId
String getId()
Gets the extensions's object identifier.- Returns:
- the object identifier as a String
-
isCritical
boolean isCritical()
Gets the extension's criticality setting.- Returns:
- true if this is a critical extension.
-
getValue
byte[] getValue()
Gets the extensions's DER-encoded value. Note, this is the bytes that are encoded as an OCTET STRING. It does not include the OCTET STRING tag and length.- Returns:
- a copy of the extension's value, or
null
if no extension value is present.
-
encode
void encode(OutputStream out) throws IOException
Generates the extension's DER encoding and writes it to the output stream.- Parameters:
out
- the output stream- Throws:
IOException
- on encoding or output error.NullPointerException
- ifout
isnull
.
-
-
Document created the 11/06/2005, last modified the 04/03/2020
Source of the printed document:https://www.gaudry.be/en/java-api-rf-java/security/cert/extension.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.