예제 #1
0
        public void ExtractKeyInfo_01()
        {
            XmlDocument doc     = LoadDocument(@"Saml20\Assertions\Saml2Assertion_01");
            KeyInfo     keyInfo = XmlSignatureUtils.ExtractSignatureKeys(doc);

            Assert.IsNotNull(keyInfo);
        }
예제 #2
0
        /// <summary>
        /// Returns the KeyInfo element of the signature of the token.
        /// </summary>
        /// <returns>Null if the token is not signed. The KeyInfo element otherwise.</returns>
        public KeyInfo GetSignatureKeys()
        {
            if (!XmlSignatureUtils.IsSigned(_samlAssertion))
            {
                return(null);
            }

            return(XmlSignatureUtils.ExtractSignatureKeys(_samlAssertion));
        }
예제 #3
0
            public void CanExtractKeyInfo()
            {
                // Arrange
                var doc = LoadDocument(TestContext.CurrentContext.TestDirectory + @"\Assertions\Saml2Assertion_01");

                // Act
                var keyInfo = XmlSignatureUtils.ExtractSignatureKeys(doc);

                // Assert
                Assert.IsNotNull(keyInfo);
            }
예제 #4
0
            public void CanExtractKeyInfo()
            {
                // Arrange
                var doc = LoadDocument(Path.Combine("Assertions", "Saml2Assertion_01"));

                // Act
                var keyInfo = XmlSignatureUtils.ExtractSignatureKeys(doc);

                // Assert
                Assert.NotNull(keyInfo);
            }
            public void CanExtractKeyInfo()
            {
                // Arrange
                var doc = LoadDocument(@"Assertions\Saml2Assertion_01");

                // Act
                var keyInfo = XmlSignatureUtils.ExtractSignatureKeys(doc);

                // Assert
                Assert.IsNotNull(keyInfo);
            }
예제 #6
0
 /// <summary>
 /// Returns the KeyInfo element of the signature of the token.
 /// </summary>
 /// <returns>Null if the token is not signed. The KeyInfo element otherwise.</returns>
 public KeyInfo GetSignatureKeys()
 {
     return(!XmlSignatureUtils.IsSigned(XmlAssertion) ? null : XmlSignatureUtils.ExtractSignatureKeys(XmlAssertion));
 }