Files
Desktop_RCULogAgent/bin/aliyun-log-csharp-sdk-master/SLSSDK/Common/Authentication/ServiceSignature.cs
2025-12-11 11:39:02 +08:00

40 lines
1.1 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* Copyright (C) Alibaba Cloud Computing
* All rights reserved.
*
* 版权所有 C阿里云计算有限公司
*/
using System;
namespace Aliyun.Api.LOG.Common.Authentication
{
internal abstract class ServiceSignature
{
public abstract string SignatureMethod { get; }
public abstract string SignatureVersion { get; }
protected ServiceSignature()
{
}
public string ComputeSignature(String key, String data)
{
if (string.IsNullOrEmpty(key))
throw new ArgumentException(Aliyun.Api.LOG.Properties.Resources.ExceptionIfArgumentStringIsNullOrEmpty, "key");
if (string.IsNullOrEmpty(data))
throw new ArgumentException(Aliyun.Api.LOG.Properties.Resources.ExceptionIfArgumentStringIsNullOrEmpty, "data");
return ComputeSignatureCore(key, data);
}
protected abstract string ComputeSignatureCore(string key, string data);
public static ServiceSignature Create()
{
return new HmacSHA1Signature();
}
}
}