Example usage for org.bouncycastle.asn1.x509 ExtendedKeyUsage getEncoded

List of usage examples for org.bouncycastle.asn1.x509 ExtendedKeyUsage getEncoded

Introduction

In this page you can find the example usage for org.bouncycastle.asn1.x509 ExtendedKeyUsage getEncoded.

Prototype

public byte[] getEncoded() throws IOException 

Source Link

Document

Return the default BER or DER encoding for this object.

Usage

From source file:org.kse.gui.dialogs.extensions.DSelectStandardExtensionTemplate.java

License:Open Source License

private void addExtKeyUsage(X509ExtensionSet extensionSet, String ekuOid) throws IOException {
    ExtendedKeyUsage eku = new ExtendedKeyUsage(
            new KeyPurposeId[] { KeyPurposeId.getInstance(new ASN1ObjectIdentifier(ekuOid)) });
    byte[] ekuEncoded = wrapInOctetString(eku.getEncoded());
    extensionSet.addExtension(X509ExtensionType.EXTENDED_KEY_USAGE.oid(), false, ekuEncoded);
}