org.bouncycastle.asn1.x509.AuthorityKeyIdentifier.getEncoded()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(102)

本文整理了Java中org.bouncycastle.asn1.x509.AuthorityKeyIdentifier.getEncoded()方法的一些代码示例,展示了AuthorityKeyIdentifier.getEncoded()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AuthorityKeyIdentifier.getEncoded()方法的具体详情如下:
包路径:org.bouncycastle.asn1.x509.AuthorityKeyIdentifier
类名称:AuthorityKeyIdentifier
方法名:getEncoded

AuthorityKeyIdentifier.getEncoded介绍

暂无

代码示例

代码示例来源:origin: org.xipki/cmpclient

private static Extensions getCertTempExtensions(byte[] authorityKeyIdentifier)
  throws CmpClientException {
 AuthorityKeyIdentifier aki = new AuthorityKeyIdentifier(authorityKeyIdentifier);
 byte[] encodedAki;
 try {
  encodedAki = aki.getEncoded();
 } catch (IOException ex) {
  throw new CmpClientException("could not encoded AuthorityKeyIdentifier", ex);
 }
 Extension extAki = new Extension(Extension.authorityKeyIdentifier, false, encodedAki);
 Extensions certTempExts = new Extensions(extAki);
 return certTempExts;
}

代码示例来源:origin: kaikramer/keystore-explorer

value = authorityKeyIdentifier.getEncoded(ASN1Encoding.DER);
} catch (IOException e) {
  DError.displayError(this, e);

代码示例来源:origin: kaikramer/keystore-explorer

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);
}

代码示例来源:origin: xipki/xipki

public boolean revokeCert(BigInteger serialNumber, CRLReason reason) throws Exception {
 ProtectedPKIMessageBuilder builder = new ProtectedPKIMessageBuilder(
   PKIHeader.CMP_2000, requestorSubject, responderSubject);
 builder.setMessageTime(new Date());
 builder.setTransactionID(randomTransactionId());
 builder.setSenderNonce(randomSenderNonce());
 CertTemplateBuilder certTempBuilder = new CertTemplateBuilder();
 certTempBuilder.setIssuer(caSubject);
 certTempBuilder.setSerialNumber(new ASN1Integer(serialNumber));
 AuthorityKeyIdentifier aki = new AuthorityKeyIdentifier(caSubjectKeyIdentifier);
 byte[] encodedAki = aki.getEncoded();
 Extension extAki = new Extension(Extension.authorityKeyIdentifier, false, encodedAki);
 Extensions certTempExts = new Extensions(extAki);
 certTempBuilder.setExtensions(certTempExts);
 ASN1Enumerated asn1Reason = new ASN1Enumerated(reason.getValue().intValue());
 Extensions exts = new Extensions(
   new Extension(Extension.reasonCode, true, new DEROctetString(asn1Reason.getEncoded())));
 RevDetails revDetails = new RevDetails(certTempBuilder.build(), exts);
 RevReqContent content = new RevReqContent(revDetails);
 builder.setBody(new PKIBody(PKIBody.TYPE_REVOCATION_REQ, content));
 ProtectedPKIMessage request = build(builder);
 PKIMessage response = transmit(request, null);
 return parseRevocationResult(response, serialNumber);
}

相关文章