public String getOID() { return attr.getAttrType().getId(); }
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(); } }
ASN1ObjectIdentifier attributeType = ((Attribute) attribute).getAttrType(); AttributeTypeType att = AttributeTypeType.resolveOid(attributeType.getId()); String attributeTypeStr = (att == AttributeTypeType.UNKNOWN) ? attributeType.getId() : att.friendly();
for (int i = 0; i < expN; i++) { Attribute attr = Attribute.getInstance(reqSubDirAttrs.get(i)); ASN1ObjectIdentifier attrType = attr.getAttrType(); ASN1Encodable attrVal = attr.getAttributeValues()[0]; for (int i = 0; i < n; i++) { Attribute attr = Attribute.getInstance(subDirAttrs.get(i)); ASN1ObjectIdentifier attrType = attr.getAttrType(); if ( !attrTypes.contains(attrType)) { failureMsg.append("attribute of type " + attrType.getId()
if( attr.getAttrType().toString().equals(UTF8NameValueMicroformat.OID)) { log.debug("name-value microformat attribute: {}", DERUTF8String.getInstance(value).getString()); // our values are just UTF-8 strings but if you use new String(value.getEncoded()) you will get two extra spaces at the beginning of the string UTF8NameValueMicroformat microformat = new UTF8NameValueMicroformat(DERUTF8String.getInstance(value)); result.tags1.add(microformat); else if( attr.getAttrType().toString().equals(UTF8NameValueSequence.OID)) { UTF8NameValueSequence sequence = new UTF8NameValueSequence(ASN1Sequence.getInstance(value)); String name = sequence.getName(); log.debug("unrecognzied attribute type {}", attr.getAttrType().toString()); result.tagsOther.add(value);
final Attribute attribute = new Attribute( ( DERSequence ) attributesAsn1Set.getObjectAt( i ) ); if ( attribute.getAttrType().equals( PKCSObjectIdentifiers.pkcs_9_at_extensionRequest ) ) {
for (int i = 0; i < n; i++) { Attribute attr = (Attribute) reqSubDirAttrs.get(i); ASN1ObjectIdentifier attrType = attr.getAttrType(); ASN1Encodable attrVal = attr.getAttributeValues()[0];
for (int i = 0; i < n; i++) { Attribute attr = (Attribute) reqSubDirAttrs.get(i); ASN1ObjectIdentifier attrType = attr.getAttrType(); ASN1Encodable attrVal = attr.getAttributeValues()[0];