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

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

Introduction

In this page you can find the example usage for org.bouncycastle.asn1.x509 SubjectKeyIdentifier 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 addSubjectKeyIdentifier(X509ExtensionSet extensionSet) throws CryptoException, IOException {
    KeyIdentifierGenerator skiGenerator = new KeyIdentifierGenerator(subjectPublicKey);
    SubjectKeyIdentifier ski = new SubjectKeyIdentifier(skiGenerator.generate160BitHashId());
    byte[] skiEncoded = wrapInOctetString(ski.getEncoded());
    extensionSet.addExtension(X509ExtensionType.SUBJECT_KEY_IDENTIFIER.oid(), false, skiEncoded);
}