Exemplo n.º 1
0
 public SigningSettingsTests()
 {
     _sut = new SigningSettings {
         Expires            = TimeSpan.FromMinutes(9),
         KeyId              = new KeyId("client1"),
         SignatureAlgorithm = new HMACSignatureAlgorithm("s3cr3t", HashAlgorithmName.SHA384),
         Headers            = new[] {
             HeaderName.PredefinedHeaderNames.RequestTarget,
             HeaderName.PredefinedHeaderNames.Date,
             new HeaderName("dalion_app_id")
         },
         DigestHashAlgorithm = HashAlgorithmName.SHA256,
         AuthorizationScheme = "UnitTestAuth",
         EnableNonce         = false,
         AutomaticallyAddRecommendedHeaders = false,
         RequestTargetEscaping = RequestTargetEscaping.RFC2396,
         Events = new RequestSigningEvents {
             OnRequestSigned         = (message, signature, settings) => Task.CompletedTask,
             OnRequestSigning        = (message, settings) => Task.CompletedTask,
             OnSigningStringComposed = (HttpRequestMessage requestToSign, ref string signingString) => Task.CompletedTask,
             OnSignatureCreated      = (message, signature, settings) => Task.CompletedTask
         },
         UseDeprecatedAlgorithmParameter = true
     };
 }
Exemplo n.º 2
0
 public SigningSettingsTests()
 {
     _sut = new SigningSettings {
         Expires            = TimeSpan.FromMinutes(5),
         KeyId              = new KeyId("client1"),
         SignatureAlgorithm = new HMACSignatureAlgorithm("s3cr3t", HashAlgorithmName.SHA384),
         Headers            = new[] {
             HeaderName.PredefinedHeaderNames.RequestTarget,
             HeaderName.PredefinedHeaderNames.Date,
             new HeaderName("dalion_app_id")
         },
         DigestHashAlgorithm = default
     };
 }