/** * return a table of the digested attributes indexed by * the OID of the attribute. */ public AttributeTable getAuthAttrs() { if (authAttrs == null) { return null; } return new AttributeTable(authAttrs); }
/** Genera un atributo de un SET en formato DER * @param attr * Atributo a formatear. * @return SET en formato DER del atributo. */ public static ASN1Set getAttributeSet(final AttributeTable attr) { if (attr != null) { return new DERSet(attr.toASN1EncodableVector()); } LOGGER.warning("Los atributos eran nulos, se devolvera null"); //$NON-NLS-1$ return null; }
public AttributeTable getAttributes(Map parameters) throws CMSAttributeTableGenerationException { AttributeTable table = signerInfoGen.getSignedAttributeTableGenerator().getAttributes(parameters); if (table.get(PKCSObjectIdentifiers.id_aa_signingCertificateV2) == null) { return table.add(PKCSObjectIdentifiers.id_aa_signingCertificateV2, new SigningCertificateV2(essCertid)); } return table; } }, signerInfoGen.getUnsignedAttributeTableGenerator());
/** * Return a new table with the passed in attribute added. * * @param attrType the type of the attribute to add. * @param attrValue the value corresponding to the attribute (will be wrapped in a SET). * @return a new table with the extra attribute in it. */ public AttributeTable add(ASN1ObjectIdentifier attrType, ASN1Encodable attrValue) { AttributeTable newTable = new AttributeTable(attributes); newTable.addAttribute(attrType, new Attribute(attrType, new DERSet(attrValue))); return newTable; }
ASN1TaggedObject taggedObject = (ASN1TaggedObject) signerInfo.getObjectAt(next); ASN1Set unat = ASN1Set.getInstance(taggedObject, false); AttributeTable attble = new AttributeTable(unat); Attribute ts = attble.get(PKCSObjectIdentifiers.id_aa_signatureTimeStampToken); if (ts != null && ts.getAttrValues().size() > 0) { ASN1Set attributeValues = ts.getAttrValues();
AttributeTable table = new AttributeTable(authAttrs); ASN1EncodableVector protectionAttributes = table.getAll(CMSAttributes.cmsAlgorithmProtect); if (protectionAttributes.size() > 1)
/** * @deprecated use ASN1ObjectIdentifier */ public Attribute get(DERObjectIdentifier oid) { return get(new ASN1ObjectIdentifier(oid.getId())); }
/** * @deprecated use ASN1ObjectIdentifier */ public ASN1EncodableVector getAll(DERObjectIdentifier oid) { return getAll(new ASN1ObjectIdentifier(oid.getId())); }
public AttributeTable( Attribute attr) { addAttribute(attr.getAttrType(), attr); }
public AttributeTable( Hashtable attrs) { attributes = copyTable(attrs); }
/** * Initialise with some extra attributes or overrides. * * @param attributeTable initial attribute table to use. */ public DefaultSignedAttributeTableGenerator( AttributeTable attributeTable) { if (attributeTable != null) { table = attributeTable.toHashtable(); } else { table = new Hashtable(); } }
AttributeTable table = new AttributeTable(authAttrs); ASN1EncodableVector protectionAttributes = table.getAll(CMSAttributes.cmsAlgorithmProtect); if (protectionAttributes.size() > 1)
/** * Return a new table with the passed in attribute added. * * @param attrType * @param attrValue * @return */ public AttributeTable add(ASN1ObjectIdentifier attrType, ASN1Encodable attrValue) { AttributeTable newTable = new AttributeTable(attributes); newTable.addAttribute(attrType, new Attribute(attrType, new DERSet(attrValue))); return newTable; }
/** * This will only be valid after the content has been read. * * @return the contents of the messageDigest attribute, if available. Null if not present. */ public byte[] getContentDigest() { if (authAttrs != null) { return ASN1OctetString.getInstance(authAttrs.get(CMSAttributes.messageDigest).getAttrValues().getObjectAt(0)).getOctets(); } return null; } }
ASN1EncodableVector allCSAttrs = unsignedAttributeTable.getAll(CMSAttributes.counterSignature);
public AttributeTable( ASN1EncodableVector v) { for (int i = 0; i != v.size(); i++) { Attribute a = Attribute.getInstance(v.get(i)); addAttribute(a.getAttrType(), a); } }
public AttributeTable( Hashtable attrs) { attributes = copyTable(attrs); }
/** * Initialise with some extra attributes or overrides. * * @param attributeTable initial attribute table to use. */ public DefaultAuthenticatedAttributeTableGenerator( AttributeTable attributeTable) { if (attributeTable != null) { table = attributeTable.toHashtable(); } else { table = new Hashtable(); } }
/** * return a table of the signed attributes - indexed by * the OID of the attribute. */ public AttributeTable getSignedAttributes() { if (signedAttributeSet != null && signedAttributeValues == null) { signedAttributeValues = new AttributeTable(signedAttributeSet); } return signedAttributeValues; }
private ASN1Set getAttributeSet( AttributeTable attr) { if (attr != null) { return new DERSet(attr.toASN1EncodableVector()); } return null; }