public static void Generate(XmlElement xmlElement, AsymmetricAlgorithm signingKey, X509Certificate2 x509Certificate, string inclusiveNamespacesPrefixList, string digestMethod, string signatureMethod)
        {
            if (inclusiveNamespacesPrefixList == null)
            {
                inclusiveNamespacesPrefixList = "#default md saml ds xs xsi";
            }
            XmlElement xmlSignature = XmlSignature.Generate(xmlElement, SAMLMetadataSignature.GetID(xmlElement), signingKey, x509Certificate, (SignedXml) new SignedMetadata(xmlElement), inclusiveNamespacesPrefixList, digestMethod, signatureMethod);

            SAMLMetadataSignature.AddSignature(xmlElement, xmlSignature);
        }
Example #2
0
        public static XmlElement Generate(XmlElement xmlElement, string elementId, AsymmetricAlgorithm signingKey, X509Certificate2 x509Certificate, SignedXml signedXml, string inclusiveNamespacesPrefixList, string digestMethod, string signatureMethod)
        {
            X509Certificate2Collection x509Certificates;

            try
            {
                x509Certificates = new X509Certificate2Collection();
                x509Certificates.Add(x509Certificate);
            }
            catch (Exception ex)
            {
                throw new SamlSignatureException("Failed to create X.509 certificate collection.", ex);
            }
            return(XmlSignature.Generate(xmlElement, elementId, signingKey, x509Certificates, signedXml, inclusiveNamespacesPrefixList, digestMethod, signatureMethod));
        }
Example #3
0
        public static XmlElement Generate(XmlElement xmlElement, string elementId, AsymmetricAlgorithm signingKey, KeyInfoX509Data keyInfoX509Data, SignedXml signedXml, string inclusiveNamespacesPrefixList, string digestMethod, string signatureMethod)
        {
            KeyInfo keyInfo;

            try
            {
                keyInfo = new KeyInfo();
                keyInfo.AddClause((KeyInfoClause)keyInfoX509Data);
            }
            catch (Exception ex)
            {
                throw new SamlSignatureException("Failed to create key info using X.509 data.", ex);
            }
            return(XmlSignature.Generate(xmlElement, elementId, signingKey, keyInfo, signedXml, inclusiveNamespacesPrefixList, digestMethod, signatureMethod));
        }
Example #4
0
 public static XmlElement Generate(XmlElement xmlElement, string elementId, AsymmetricAlgorithm signingKey, SignedXml signedXml, string inclusiveNamespacesPrefixList, string digestMethod, string signatureMethod)
 {
     return(XmlSignature.Generate(xmlElement, elementId, signingKey, new KeyInfo(), signedXml, inclusiveNamespacesPrefixList, digestMethod, signatureMethod));
 }