XL profile of XAdES signature
Inheritance: XAdESProfileX
Esempio n. 1
0
        private SignatureExtension GetExtensionProfile(SignatureParameters parameters)
        {
            //jbonilla
            SignatureFormat signFormat = parameters.SignatureFormat;

            if (signFormat.Equals(SignatureFormat.XAdES_BES) || signFormat.Equals(SignatureFormat
                                                                                  .XAdES_EPES))
            {
                return(null);
            }
            else if (signFormat.Equals(SignatureFormat.XAdES_T))
            {
                XAdESProfileT extensionT = new XAdESProfileT();
                extensionT.SetTspSource(TspSource);
                return(extensionT);
            }
            else if (signFormat.Equals(SignatureFormat.XAdES_C))
            {
                XAdESProfileC extensionC = new XAdESProfileC();
                extensionC.SetTspSource(TspSource);
                extensionC.SetCertificateVerifier(Verifier);
                return(extensionC);
            }
            else if (signFormat.Equals(SignatureFormat.XAdES_X))
            {
                XAdESProfileX extensionX = new XAdESProfileX();
                extensionX.SetTspSource(TspSource);
                extensionX.SetCertificateVerifier(Verifier);
                return(extensionX);
            }
            else if (signFormat.Equals(SignatureFormat.XAdES_XL))
            {
                XAdESProfileXL extensionXL = new XAdESProfileXL();
                extensionXL.SetTspSource(TspSource);
                extensionXL.SetCertificateVerifier(Verifier);
                return(extensionXL);
            }
            //                else
            //                {
            //                    if (signFormat.Equals(SignatureFormat.XAdES_A))
            //                    {
            //                        throw new NotImplementedException();
            //                        //XAdESProfileA extensionA = new XAdESProfileA();
            //                        //extensionA.SetTspSource(tspSource);
            //                        //extensionA.SetCertificateVerifier(certificateVerifier);
            //                        //return extensionA;
            //                    }
            //                }
            //            }
            //        }
            //    }
            //}
            throw new ArgumentException("Unsupported signature format " + parameters.SignatureFormat);
        }
Esempio n. 2
0
        private SignatureExtension GetExtensionProfile(SignatureParameters parameters)
        {
            //jbonilla
            SignatureFormat signFormat = parameters.SignatureFormat;
            if (signFormat.Equals(SignatureFormat.XAdES_BES) || signFormat.Equals(SignatureFormat
                .XAdES_EPES))
            {
                return null;
            }
            else if (signFormat.Equals(SignatureFormat.XAdES_T))
            {
                XAdESProfileT extensionT = new XAdESProfileT();
                extensionT.SetTspSource(TspSource);
                return extensionT;

            }
            else if (signFormat.Equals(SignatureFormat.XAdES_C))
            {
                XAdESProfileC extensionC = new XAdESProfileC();
                extensionC.SetTspSource(TspSource);
                extensionC.SetCertificateVerifier(Verifier);
                return extensionC;
            }
            else if (signFormat.Equals(SignatureFormat.XAdES_X))
            {
                XAdESProfileX extensionX = new XAdESProfileX();
                extensionX.SetTspSource(TspSource);
                extensionX.SetCertificateVerifier(Verifier);
                return extensionX;
            }
            else if (signFormat.Equals(SignatureFormat.XAdES_XL))
            {
                XAdESProfileXL extensionXL = new XAdESProfileXL();
                extensionXL.SetTspSource(TspSource);
                extensionXL.SetCertificateVerifier(Verifier);
                return extensionXL;
            }
            //                else
            //                {
            //                    if (signFormat.Equals(SignatureFormat.XAdES_A))
            //                    {
            //                        throw new NotImplementedException();
            //                        //XAdESProfileA extensionA = new XAdESProfileA();
            //                        //extensionA.SetTspSource(tspSource);
            //                        //extensionA.SetCertificateVerifier(certificateVerifier);
            //                        //return extensionA;
            //                    }
            //                }
            //            }
            //        }
            //    }
            //}
            throw new ArgumentException("Unsupported signature format " + parameters.SignatureFormat);
        }