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>"; } }
public ASN1Encodable[] getAttributeValues() { return attrValues.toArray(); }
public ASN1Encodable[] getAttributeValues() { return attrValues.toArray(); }
public ASN1Encodable[] getAttributeValues() { return attrValues.toArray(); }
public ASN1Encodable[] getAttributeValues() { return attrValues.toArray(); }
public ASN1Encodable[] getAttributeValues() { return attrValues.toArray(); }
public ASN1Encodable[] getAttributeValues() { return attrValues.toArray(); }
public Iterator<ASN1Encodable> iterator() { return new Arrays.Iterator<ASN1Encodable>(toArray()); } }
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(); } }
for (final org.bouncycastle.asn1.x509.Attribute claimedRole : signerAttrValueArray) { final ASN1Encodable[] attrValues1 = claimedRole.getAttrValues().toArray(); for (final ASN1Encodable asn1Encodable : attrValues1) { if (asn1Encodable instanceof ASN1String) {
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>"; } }
if (certificates != null) { final byte[] certificatesBytes = new DERTaggedObject(false, 0, new DERSequence(certificates.toArray())).getEncoded(); if (LOG.isTraceEnabled()) { LOG.trace("Certificates: {}", DSSUtils.toHex(certificatesBytes));
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; }