public interface 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 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.
Modifier and Type | Method | Description |
---|---|---|
void |
encode |
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. |
String getId()
boolean isCritical()
byte[] getValue()
null
if no extension value is present.void encode(OutputStream out) throws IOException
out
- the output streamIOException
- on encoding or output error.NullPointerException
- if out
is null
.
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/security/cert/Extension.html