List of usage examples for org.bouncycastle.asn1.x509 AuthorityKeyIdentifier getEncoded
public byte[] getEncoded() throws IOException
From source file:org.kse.gui.dialogs.extensions.DSelectStandardExtensionTemplate.java
License:Open Source License
private void addAuthorityKeyIdentifier(X509ExtensionSet extensionSet) throws CryptoException, IOException { KeyIdentifierGenerator akiGenerator = new KeyIdentifierGenerator(authorityPublicKey); AuthorityKeyIdentifier aki = new AuthorityKeyIdentifier(akiGenerator.generate160BitHashId()); byte[] akiEncoded = wrapInOctetString(aki.getEncoded()); extensionSet.addExtension(X509ExtensionType.AUTHORITY_KEY_IDENTIFIER.oid(), false, akiEncoded); }
From source file:org.xipki.pki.ca.client.impl.X509CmpRequestor.java
License:Open Source License
private static Extensions getCertTempExtensions(byte[] authorityKeyIdentifier) throws CmpRequestorException { AuthorityKeyIdentifier aki = new AuthorityKeyIdentifier(authorityKeyIdentifier); byte[] encodedAki; try {//from w ww . j av a 2 s . c o m encodedAki = aki.getEncoded(); } catch (IOException ex) { throw new CmpRequestorException("could not encoded AuthorityKeyIdentifier", ex); } Extension extAki = new Extension(Extension.authorityKeyIdentifier, false, encodedAki); Extensions certTempExts = new Extensions(extAki); return certTempExts; }