//******************************************************************************************************// ICertificateChecker.cs - Gbtc//// Copyright © 2012, Grid Protection Alliance. All Rights Reserved.//// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See// the NOTICE file distributed with this work for additional information regarding copyright ownership.// The GPA licenses this file to you under the MIT License (MIT), the "License"; you may// not use this file except in compliance with the License. You may obtain a copy of the License at://// http://www.opensource.org/licenses/MIT//// Unless agreed to in writing, the subject software distributed under the License is distributed on an// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the// License for the specific language governing permissions and limitations.//// Code Modification History:// ----------------------------------------------------------------------------------------------------// 11/06/2012 - Stephen C. Wills// Generated original version of source code.// 12/14/2012 - Starlynn Danyelle Gilliam// Modified Header.////****************************************************************************************************** using System.Net.Security;using System.Security.Cryptography.X509Certificates; namespace GSF.Net.Security{ /// <summary> /// Defines the interface for a generic X.509 certificate checker. /// </summary> public interface ICertificateChecker { /// <summary> /// Gets the reason why the remote certificate validation /// failed, or null if certificate validation did not fail. /// </summary> string ReasonForFailure { get; } /// <summary> /// Verifies the remote certificate used for authentication. /// </summary> /// <param name="sender">An object that contains state information for this validation.</param> /// <param name="remoteCertificate">The certificate used to authenticate the remote party.</param> /// <param name="chain">The chain of certificate authorities associated with the remote certificate.</param> /// <param name="errors">One or more errors associated with the remote certificate.</param> /// <returns>A flag that determines whether the specified certificate is accepted for authentication.</returns> bool ValidateRemoteCertificate(object sender, X509Certificate remoteCertificate, X509Chain chain, SslPolicyErrors errors); }}
//******************************************************************************************************
// ICertificateChecker.cs - Gbtc
//
// Copyright © 2012, Grid Protection Alliance. All Rights Reserved.
//
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
// The GPA licenses this file to you under the MIT License (MIT), the "License"; you may
// not use this file except in compliance with the License. You may obtain a copy of the License at:
//
// http://www.opensource.org/licenses/MIT
//
// Unless agreed to in writing, the subject software distributed under the License is distributed on an
// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
// License for the specific language governing permissions and limitations.
//
// Code Modification History:
// ----------------------------------------------------------------------------------------------------
// 11/06/2012 - Stephen C. Wills
// Generated original version of source code.
// 12/14/2012 - Starlynn Danyelle Gilliam
// Modified Header.
//
//******************************************************************************************************
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
namespace GSF.Net.Security
{
/// <summary>
/// Defines the interface for a generic X.509 certificate checker.
/// </summary>
public interface ICertificateChecker
{
/// <summary>
/// Gets the reason why the remote certificate validation
/// failed, or null if certificate validation did not fail.
/// </summary>
string ReasonForFailure
{
get;
}
/// <summary>
/// Verifies the remote certificate used for authentication.
/// </summary>
/// <param name="sender">An object that contains state information for this validation.</param>
/// <param name="remoteCertificate">The certificate used to authenticate the remote party.</param>
/// <param name="chain">The chain of certificate authorities associated with the remote certificate.</param>
/// <param name="errors">One or more errors associated with the remote certificate.</param>
/// <returns>A flag that determines whether the specified certificate is accepted for authentication.</returns>
bool ValidateRemoteCertificate(object sender, X509Certificate remoteCertificate, X509Chain chain, SslPolicyErrors errors);
}
}