Ejemplo n.º 1
0
        EnsureSignatures()
        {
            //
            // if _reachSignaturs is not null we have already initialized this
            //
            if (null != _reachSignatures)
            {
                return;
            }
            _reachSignatures = new Collection <XpsDigitalSignature>();
            PackageDigitalSignatureManager packageSignatures = new PackageDigitalSignatureManager(CurrentXpsManager.MetroPackage);

            foreach (PackageDigitalSignature packSignature in packageSignatures.Signatures)
            {
                XpsDigitalSignature reachSignature = new XpsDigitalSignature(packSignature, this);
                //
                // Only add signatures that meet the policy for
                // signed Document Sequences
                //
                if (reachSignature.SignedDocumentSequence != null)
                {
                    _reachSignatures.Add(reachSignature);
                }
            }
        }
Ejemplo n.º 2
0
        RemoveSignature(
            XpsDigitalSignature signature
            )
        {
            CheckDisposed();

            if (null == signature)
            {
                throw new ArgumentNullException("signature");
            }
            if (null == signature.PackageSignature)
            {
                throw new NullReferenceException("signature.PackageSignature");
            }
            if (null == signature.PackageSignature.SignaturePart)
            {
                throw new NullReferenceException("signature.PackageSignature.SignaturePart");
            }
            if (CurrentXpsManager == null)
            {
                throw new InvalidOperationException(SR.Get(SRID.ReachPackaging_DocumentWasClosed));
            }
            PackageDigitalSignatureManager packageSignatures = new PackageDigitalSignatureManager(CurrentXpsManager.MetroPackage);

            packageSignatures.RemoveSignature(signature.PackageSignature.SignaturePart.Uri);
            _reachSignatures    = null;
            _reachSignatureList = null;
            EnsureSignatures();
        }
Ejemplo n.º 3
0
        AddSignature(PackageDigitalSignature packSignature)
        {
            XpsDigitalSignature reachSignature =
                new XpsDigitalSignature(packSignature, this);

            _reachSignatures.Add(reachSignature);
            return(reachSignature);
        }