org.bouncycastle.asn1.ASN1Set.toArray()方法的使用及代码示例

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

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

ASN1Set.toArray介绍

暂无

代码示例

代码示例来源:origin: igniterealtime/Openfire

private String doPrimitive(ASN1Primitive primitive) throws IOException {
  if (primitive == null || primitive instanceof ASN1Null) {
    return "";
  } else if (primitive instanceof ASN1Sequence) {
    return doCollection(((ASN1Sequence) primitive).toArray());
  } else if (primitive instanceof ASN1Set) {
    return doCollection(((ASN1Set) primitive).toArray());
  } else if (primitive instanceof DERTaggedObject) {
    final DERTaggedObject tagged = ((DERTaggedObject) primitive);
    return "<table><tr><td>" + /* tagged.getTagNo() + */ "</td><td>" + doPrimitive(tagged.getObject()) + "</td></tr></table>";
  } else {
    return "<table><tr><td colspan='2'>" + asString(primitive) + "</td></tr></table>";
  }
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

public ASN1Encodable[] getAttributeValues()
{
  return attrValues.toArray();
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

public ASN1Encodable[] getAttributeValues()
{
  return attrValues.toArray();
}

代码示例来源:origin: redfish64/TinyTravelTracker

public ASN1Encodable[] getAttributeValues()
{
  return attrValues.toArray();
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

public ASN1Encodable[] getAttributeValues()
{
  return attrValues.toArray();
}

代码示例来源:origin: redfish64/TinyTravelTracker

public ASN1Encodable[] getAttributeValues()
{
  return attrValues.toArray();
}

代码示例来源:origin: redfish64/TinyTravelTracker

public ASN1Encodable[] getAttributeValues()
{
  return attrValues.toArray();
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

public Iterator<ASN1Encodable> iterator()
  {
    return new Arrays.Iterator<ASN1Encodable>(toArray());
  }
}

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

private String getVeriSignNonVerified(byte[] octets) throws IOException {

    /*
      NonVerified ::= SET OF ATTRIBUTE
     */

    StringBuilder sb = new StringBuilder();

    ASN1Set asn1Set = ASN1Set.getInstance(octets);
    for (ASN1Encodable attribute : asn1Set.toArray()) {

      ASN1ObjectIdentifier attributeId = ((Attribute) attribute).getAttrType();
      ASN1Set attributeValues = ((Attribute) attribute).getAttrValues();

      for (ASN1Encodable attributeValue : attributeValues.toArray()) {

        String attributeValueStr = getAttributeValueString(attributeId, attributeValue);

        sb.append(MessageFormat.format("{0}={1}", attributeId.getId(), attributeValueStr));
        sb.append(NEWLINE);
      }
    }

    return sb.toString();
  }
}

代码示例来源:origin: arhs/sd-dss

for (final org.bouncycastle.asn1.x509.Attribute claimedRole : signerAttrValueArray) {
  final ASN1Encodable[] attrValues1 = claimedRole.getAttrValues().toArray();
  for (final ASN1Encodable asn1Encodable : attrValues1) {
    if (asn1Encodable instanceof ASN1String) {

代码示例来源:origin: org.igniterealtime.openfire/xmppserver

private String doPrimitive(ASN1Primitive primitive) throws IOException {
  if (primitive == null || primitive instanceof ASN1Null) {
    return "";
  } else if (primitive instanceof ASN1Sequence) {
    return doCollection(((ASN1Sequence) primitive).toArray());
  } else if (primitive instanceof ASN1Set) {
    return doCollection(((ASN1Set) primitive).toArray());
  } else if (primitive instanceof DERTaggedObject) {
    final DERTaggedObject tagged = ((DERTaggedObject) primitive);
    return "<table><tr><td>" + /* tagged.getTagNo() + */ "</td><td>" + doPrimitive(tagged.getObject()) + "</td></tr></table>";
  } else {
    return "<table><tr><td colspan='2'>" + asString(primitive) + "</td></tr></table>";
  }
}

代码示例来源:origin: arhs/sd-dss

if (certificates != null) {
  final byte[] certificatesBytes = new DERTaggedObject(false, 0, new DERSequence(certificates.toArray())).getEncoded();
  if (LOG.isTraceEnabled()) {
    LOG.trace("Certificates: {}", DSSUtils.toHex(certificatesBytes));

代码示例来源:origin: arhs/sd-dss

private List<TimestampToken> createTimestamps(final ASN1ObjectIdentifier attrType, final TimestampType timestampType, final ArchiveTimestampType archiveTimestampType) {
  final List<TimestampToken> timestampTokenList = new ArrayList<TimestampToken>();
  final AttributeTable attributes = attrType.equals(id_aa_ets_contentTimestamp) ? signerInformation.getSignedAttributes() : signerInformation.getUnsignedAttributes();
  if (attributes != null) {
    final ASN1EncodableVector allAttributes = attributes.getAll(attrType);
    for (int ii = 0; ii < allAttributes.size(); ii++) {
      final Attribute attribute = (Attribute) allAttributes.get(ii);
      final ASN1Set attrValues = attribute.getAttrValues();
      for (final ASN1Encodable value : attrValues.toArray()) {
        try {
          final byte[] encoded = value.toASN1Primitive().getEncoded(); // getEncoded(ASN1Encoding.DER)
          final CMSSignedData signedData = new CMSSignedData(encoded);
          final TimeStampToken token = new TimeStampToken(signedData);
          final TimestampToken timestampToken = new TimestampToken(token, timestampType, certPool);
          timestampToken.setArchiveTimestampType(archiveTimestampType);
          timestampTokenList.add(timestampToken);
        } catch (Exception e) {
          throw new DSSException(e);
        }
      }
    }
  }
  return timestampTokenList;
}

相关文章