コード例 #1
0
 public void Constructor(byte[] key, EE ee)
 {
     try
     {
         var symmetricSecurityKey = new SymmetricSecurityKey(key);
         ee.ProcessNoException();
     }
     catch (Exception exception)
     {
         ee.ProcessException(exception);
     }
 }
コード例 #2
0
 public SignatureProviderTheoryData(string testId, string signingAlgorithm, string verifyAlgorithm, SecurityKey signingKey, SecurityKey verifyKey, EE expectedException = null)
 {
     SigningAlgorithm  = signingAlgorithm;
     VerifyAlgorithm   = verifyAlgorithm;
     SigningKey        = signingKey;
     VerifyKey         = verifyKey;
     ExpectedException = expectedException ?? EE.NoExceptionExpected;
     TestId            = testId;
 }
コード例 #3
0
 public CryptoProviderFactoryTheoryData(string testId, string algorithm, SecurityKey signingKey, SecurityKey verifyKey, EE expectedException = null)
 {
     SigningAlgorithm  = algorithm;
     SigningKey        = signingKey;
     VerifyKey         = verifyKey;
     ExpectedException = expectedException ?? EE.NoExceptionExpected;
     TestId            = testId;
 }
コード例 #4
0
        public static ClaimsPrincipal ValidateToken(string securityToken, TokenValidationParameters validationParameters, ISecurityTokenValidator tokenValidator, ExpectedException expectedException)
        {
            ClaimsPrincipal retVal = null;

            try
            {
                retVal = tokenValidator.ValidateToken(securityToken, validationParameters, out SecurityToken validatedToken);
                expectedException.ProcessNoException();
            }
            catch (Exception ex)
            {
                expectedException.ProcessException(ex);
            }

            return(retVal);
        }