_digests.put(_digestOID, hash.clone());
Map parameters = getBaseParameters(contentType, digAlgId, hash);
AttributeTable signed = (_sAttr != null) ? _sAttr.getAttributes(Collections.unmodifiableMap(parameters)) : null;
ASN1Set signedAttr = getAttributeSet(signed);
//
// sig must be composed from the DER encoding.
//
byte[] tmp;
if (signedAttr != null)
{
tmp = signedAttr.getEncoded(ASN1Encodable.DER);
}
else
{
throw new RuntimeException("signatures without signed attributes not implemented.");
}
_signature.update(tmp);
ASN1OctetString encDigest = new DEROctetString(_signature.sign());
parameters = getBaseParameters(contentType, digAlgId, hash);
parameters.put(CMSAttributeTableGenerator.SIGNATURE, encDigest.getOctets().clone());
AttributeTable unsigned = (_unsAttr != null) ? _unsAttr.getAttributes(Collections.unmodifiableMap(parameters)) : null;
ASN1Set unsignedAttr = getAttributeSet(unsigned);
X509Certificate cert = this.getCertificate();
ASN1InputStream aIn = new ASN1InputStream(cert.getTBSCertificate());