Exemplo n.º 1
0
        /**
         * Return a signer information object with the passed in unsigned
         * attributes replacing the ones that are current associated with
         * the object passed in.
         *
         * @param signerInformation the signerInfo to be used as the basis.
         * @param unsignedAttributes the unsigned attributes to add.
         * @return a copy of the original SignerInformationObject with the changed attributes.
         */
        public static SignerInformation ReplaceUnsignedAttributes(
            SignerInformation signerInformation,
            Asn1.Cms.AttributeTable unsignedAttributes)
        {
            SignerInfo sInfo        = signerInformation.info;
            Asn1Set    unsignedAttr = null;

            if (unsignedAttributes != null)
            {
                unsignedAttr = new DerSet(unsignedAttributes.ToAsn1EncodableVector());
            }

            return(new SignerInformation(
                       new SignerInfo(
                           sInfo.SignerID,
                           sInfo.DigestAlgorithm,
                           sInfo.AuthenticatedAttributes,
                           sInfo.DigestEncryptionAlgorithm,
                           sInfo.EncryptedDigest,
                           unsignedAttr),
                       signerInformation.contentType,
                       signerInformation.content,
                       null));
        }
Exemplo n.º 2
0
 internal virtual void AddSignerCallback(
     SignerInformation si)
 {
 }
Exemplo n.º 3
0
 /**
  * generate a set of one or more SignerInformation objects representing counter signatures on
  * the passed in SignerInformation object.
  *
  * @param signer the signer to be countersigned
  * @param sigProvider the provider to be used for counter signing.
  * @return a store containing the signers.
  */
 public SignerInformationStore GenerateCounterSigners(
     SignerInformation signer)
 {
     return(this.Generate(null, new CmsProcessableByteArray(signer.GetSignature()), false).GetSignerInfos());
 }